TorrentFlux.com Hey, OppTupacShakur, you have 11 messages, 0 are new.
05-07-2007, 12:46:19
Home Help Search Profile Logout donate chat
News:


+  TorrentFlux Forums
|-+  TorrentFlux
| |-+  TorrentFlux Search Engine Modules and Updates (Moderator: kboy)
| | |-+  The Pirate Bay Search Module v1.06
« previous next »
Pages: 1 2 3 [All] Go Down Reply Notify of replies Send this topic Print
Author Topic: The Pirate Bay Search Module v1.06  (Read 12092 times)
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« on: 04-10-2006, 20:13:43 » Reply with quote

This is where updates for PirateBay Search module will be.

This engine requires a cookie. and English language

see below for example cookie
http://www.torrentflux.com/forum/index.php/topic,1125.msg8211.html#msg8211

see attached for latest version

Current Version:  1.06

-- Version History --

    v 1.06 - Feb 16, 07 - updated parsing
    v 1.05 - Oct 18, 06 - Seeds and Peers were off.
    v 1.04 - Oct 16, 06 - fix paging
    v 1.03 - Aug 23, 06 - Added Top 100
    v 1.02 - Jun 29, 06 - update to pageing
    v 1.01 - Apr 11, 06 - bug in parsing paging.

* PirateBayEngine.php (16.94 KB - downloaded 567 times.)
« Last Edit: 02-16-2007, 15:10:38 by kboy » Report to moderator   Logged
 
gringo
Full Member
***
Offline Offline

TF Base: Linux 1.x
Posts: 110





View Profile WWW Personal Message (Offline)
« Reply #1 on: 04-10-2006, 21:01:27 » Reply with quote

Thanks Smiley
Report to moderator   Logged

P4 2.8 | CentOS-4.2 | 1024MB RAM | 10 mb/s Connect

Apache 2.0.52 | PHP 4.3.9 | MySQL 4.1.12 | Python 2.3.4

TF 2.1b4rt with cosmetic changes.
munk
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 71




View Profile WWW Personal Message (Offline)
« Reply #2 on: 04-10-2006, 21:04:38 » Reply with quote

Cheers bud.
Report to moderator   Logged

Running:
FreeBSD 4.11-STABLE
Apache/1.3.36 (Unix)
PHP 4.4.2
MySQL 4.0.27-log
Python 2.4.3

Current Mods: Remember Me|Start/Stop All|Enhanced Link List|Multi Torrent Uploads|Multi File Delete

FreeBSD Torrentflux Fix

Torrentflux-b4rt
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #3 on: 04-10-2006, 21:39:35 » Reply with quote

My god you are a sexy man.
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
devils
Newbie
*
Offline Offline

Posts: 2



View Profile Personal Message (Offline)
« Reply #4 on: 04-11-2006, 10:53:14 » Reply with quote

I have installed this Search module in my Torrentflux 2.1Final. I cant get any results when i do a search. all the other search moules work like they should. Anyone got any ideas?
Report to moderator   Logged
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #5 on: 04-11-2006, 12:48:52 » Reply with quote

are you getting results on other engines ?
Report to moderator   Logged
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #6 on: 04-11-2006, 14:28:16 » Reply with quote

are you getting results on other engines ?

^^ he said the others worked.


This module worked great for me.  Maybe his server is blocked or can not reach PirateBay.   Try a ssh into your server and see if you can ping piratebay or pull up anything with lynx.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #7 on: 04-11-2006, 14:56:44 » Reply with quote

doh.. sorry.
Report to moderator   Logged
nthing
Newbie
*
Offline Offline

Posts: 3



View Profile Email Personal Message (Offline)
« Reply #8 on: 04-11-2006, 16:19:12 » Reply with quote

I found a bug Grin
when i try to go to a new page instead of going to

<hostname>/torrent/torrentSearch.php?searchEngine=PirateBay&LATEST=1&pg=1

it goes to

<hostname>/tflux/torrentSearch.php?searchEngine=PirateBay&LATEST=1&pg=1

tflux? :p
Report to moderator   Logged
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #9 on: 04-11-2006, 16:38:04 » Reply with quote

hmm. will have an update shortly..

Ok updated code see first posting.
« Last Edit: 04-11-2006, 16:45:15 by kboy » Report to moderator   Logged
devils
Newbie
*
Offline Offline

Posts: 2



View Profile Personal Message (Offline)
« Reply #10 on: 04-11-2006, 17:26:01 » Reply with quote

are you getting results on other engines ?

Found the problem Thansk for the sugestions. I had put the wrong uid in the cookie admin for piratebay...
Report to moderator   Logged
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #11 on: 04-11-2006, 17:30:34 » Reply with quote

 Smiley yep that might do it Smiley
Report to moderator   Logged
DarkHawk
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #12 on: 04-11-2006, 17:32:07 » Reply with quote

Hello kboy,

I am using the latest Torrentflux 2.1 and I am also unable to get any search results.

I've looked at the php code a bit and found out what the problem is. It seems that
the makeRequest() function generates output in my native 'dutch' language instead
of english. Making the parseResponse() function fail. I tested it out by changing the
parseResponse() function, changing all the 'Search results' strings to the dutch
'Zoek resultaten'.

I have tried to find a way to let the makeRequest() function always generate english
output but so far no luck. Sadly it seems thepiratebay.org enables you to switch
between languages by setting a cookie in the browser. I just dont know anything
about cookies, and there doesn't seem to be a PHP function that works in this situation.

Hope you know a solution,
Dark Hawk
« Last Edit: 04-11-2006, 17:34:49 by DarkHawk » Report to moderator   Logged
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #13 on: 04-11-2006, 17:41:31 » Reply with quote

This is what thepiratebay.org cookies look like.
with language set to en_EN (english)
At this time this engine only supports (en_EN)

Yes this will mean that the results will be in english.

NOTE: This is a Sample Cookie will not work so don't even try..
Code:
uid=2999999;cryptpw=e999;authtoken=2d91b999bf9cd5c2a99c991ff99c999b;language=en_EN

If you have updated your code you can try using other languages.

Here are the Language codes from there site.
Code:
en_EN -> English
sv_SE -> Svenska
no_NO -> Norsk (Bokmål)
nn_NO -> Norsk (Nynorsk)
da_DK -> Dansk
fi_FI -> Suomeksi
is_IS -> Íslenska
nl_NL -> Nederlands
de_DE -> Deutsch
it_IT -> Italiano
es_ES -> Español
pt_PT -> Portuguese
pt_BR -> Português (Brazil)
fr_FR -> Français
pl_PL -> Polski
hu_HU -> Magyar
el_GR -> e???????
tr_TR -> Türkçe
ru_RU -> Russian
sk_SK -> Slovencina
ca_ES -> Català
he_IL -> Hebrew
ja_JP -> Japanese
bg_BG -> ?????????
et_EE -> Eesti
« Last Edit: 04-11-2006, 18:00:17 by kboy » Report to moderator   Logged
DarkHawk
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #14 on: 04-11-2006, 18:33:36 » Reply with quote

Which system do I need to change? I have got two systems:

1) WindowsXP system that just uses a browser to view TorrentFlux
    Regional options are set to the Dutch language.

2) Linux RedHat based webserver running TorrentFlux
    Had a quick look at the environment (set command) which is: LANG=en_US.UTF-8

Is it not possible to force TorrentFlux to always use 'en_EN' somehow?

Report to moderator   Logged
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #15 on: 04-11-2006, 19:00:23 » Reply with quote

Yes, that is what he is saying... you can create a cookie and associate it to torrentflux.... it has nothing to do with your OS or browser.   Go to your profile in TF and click on the Cookie Management and enter a cookie in there.   You will want to specify en_EN on the cookie since the search ONLY supports english.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
DarkHawk
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #16 on: 04-12-2006, 14:36:34 » Reply with quote

Ok but how? I've never done anything with cookies befor
Report to moderator   Logged
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #17 on: 04-12-2006, 15:38:06 » Reply with quote

There is a help button once you get there ... click on the "How to get cookie information...." at the bottom of the cookies section under your profile.  The help will tell you how to get the cookie information.  Sorry, there is no easy way... private sites are private.   They require cookies.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
DarkHawk
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #18 on: 04-12-2006, 15:47:03 » Reply with quote

Now I get it!

There is a 'Cookie Management' in my profile.  Embarrassed
Didn't notice it before,  thx alot!
Report to moderator   Logged
kanchke
Newbie
*
Offline Offline

Posts: 24




View Profile Personal Message (Offline)
« Reply #19 on: 04-25-2006, 13:55:26 » Reply with quote

I understood pretty quick where to add the cookie but when I press the 'Add' button my server explodes !!  Oh no ... wait ... nothing happens, that's it  Grin Grin

I've searched the forums but only found and upgrade script tf2.0-tf2.1 for postgresql, next I checked my SQL tf_cookies table and found it was empty

any idea why this is happening (to me ?)

thanx,
k.
Report to moderator   Logged

P3 733 | FreeBSD6.0 | 128MB RAM

Lighttpd 1.4.11 | PHP 5.1.2 (cgi-fcgi) | Postgres8.1 | Python 2.3.4

TF 2.1 w/ AJAX on indexpage| MRTG statistics
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #20 on: 04-25-2006, 17:23:20 » Reply with quote

There is a post for fixing the code for cookies to work with postgress.   Try another search.   It has to do with removing the LIMIT 1 or something from the sql statement.   TF 2.1.1 has the fix in it and will be released soon.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
Infinity
Newbie
*
Offline Offline

Posts: 9



View Profile Personal Message (Offline)
« Reply #21 on: 04-27-2006, 00:00:30 » Reply with quote

My tf_cookies table is empty, too.  I'm using postgresql 8.1.3.

LIMITs shouldn't be used in sql if you're using ADODB.  They're apparently not cross-platform.  You'd want to use the SelectLimit function.  But I'm not seeing any LIMITs in the sql code in tf 2.1.

I'm seeing some bad syntax in queries, though, in functions.php.  One needs to properly quote the text strings going into a sql statement, not just put ' chars before and after it.  What about chars in the string that might screw up the sql statement?  The qstr function should be used.

From: http://phplens.com/lens/adodb/docs-adodb.htm
qstr($s,[$magic_quotes_enabled=false])

I went in and modified these functions.  I must have missed some of them in the older functions I converted way back when.
addCookieInfo
modCookieInfo
DisplayTitleBar
FetchHTML
GetDirList

I'm not sure how to test what you're trying to do, but maybe these changes can make it into 2.1.1?
Report to moderator   Logged
Infinity
Newbie
*
Offline Offline

Posts: 9



View Profile Personal Message (Offline)
« Reply #22 on: 04-27-2006, 00:08:52 » Reply with quote

Oh here it is.

The uid must not be quoted, it's an integer, and the cid must be removed from the query.  You can't insert a value into an auto-incrementing column in pgsql, especially not an empty string into a smallint.  Smallint?  Why is cid just a smallint instead of an int?

See addCookieInfo, line 410 or thereabouts becomes:
Code:
    $sql = "INSERT INTO tf_cookies ( uid, host, data ) VALUES ( " . $uid . ", " . $db->qstr($newCookie["host"]) . ", " . $db->qstr($newCookie["data"]) . " )";

That permits you to add cookies in cookie maintenance as described.

Also, don't quote the $cid elsewhere, like in modCookieInfo.  That'll blow up too.
Report to moderator   Logged
kanchke
Newbie
*
Offline Offline

Posts: 24




View Profile Personal Message (Offline)
« Reply #23 on: 04-27-2006, 06:02:50 » Reply with quote

thanx Infinity, I can add cookies now !!
Report to moderator   Logged

P3 733 | FreeBSD6.0 | 128MB RAM

Lighttpd 1.4.11 | PHP 5.1.2 (cgi-fcgi) | Postgres8.1 | Python 2.3.4

TF 2.1 w/ AJAX on indexpage| MRTG statistics
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #24 on: 04-27-2006, 10:45:02 » Reply with quote

The codebase for TF 2.1.1 has been updated with this.   Also the tinyint will now be a integer.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
gunn0r
Newbie
*
Offline Offline

Posts: 25


G.I.R.



View Profile Personal Message (Offline)
« Reply #25 on: 05-08-2006, 16:47:04 » Reply with quote


See addCookieInfo, line 410 or thereabouts becomes:
Code:
    $sql = "INSERT INTO tf_cookies ( uid, host, data ) VALUES ( " . $uid . ", " . $db->qstr($newCookie["host"]) . ", " . $db->qstr($newCookie["data"]) . " )";

That permits you to add cookies in cookie maintenance as described.

Also, don't quote the $cid elsewhere, like in modCookieInfo.  That'll blow up too.

So I have to remove every "$cid" in functions.php, or did I get something wrong?  Huh?
Report to moderator   Logged

Don't eat yellow snow.
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #26 on: 06-29-2006, 14:35:39 » Reply with quote

Updated code for paging bug.
Report to moderator   Logged
azah
Newbie
*
Offline Offline

Posts: 9





View Profile Personal Message (Offline)
« Reply #27 on: 08-19-2006, 19:53:26 » Reply with quote

First, great job with the engine! Works like a charm!
I would like to ask for a request tho,

Personally i think top100 is more useful than "latest torrents", so if not an exchange maybe add a button for that?

Also, it would be great to be able to sort the output in seeds, since 90% of the searches now results in useless 0 seeders 0 leechers results.
Actually, it would be best to have it sort to seeders by default for all searches and genrebrowsing, then you get most relevant hits.

What do you think about that?

Cheers
/azah
« Last Edit: 08-19-2006, 20:23:23 by azah » Report to moderator   Logged

____________________________
TF 2.1b2
Debian Linux 2.4.27-2-386
Apache/2.0.54
PHP Version 4.3.10-16
Mysql 4.1.11-Debian_4sarge2-log
Python 2.3.5
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #28 on: 08-23-2006, 13:25:59 » Reply with quote

Ok I added Top 100 it is in the top header menu. this will give you the top 100 and still leave the lastest.

kboy
Report to moderator   Logged
dragon_788
Newbie
*
Offline Offline

Posts: 12



View Profile Personal Message (Offline)
« Reply #29 on: 09-17-2006, 02:42:19 » Reply with quote

Could you give a bit more of an example of what the auth token and whatnot is in the actually cookie file itself? I've got the cookie just can't figure out which is what. Or maybe allow uploading of the cookie and then the module parses the cookie itself?

Also, this was working great for me not 10 hours ago, and now its no longer working at all. Other search engines work and I think the only difference is I added the Ajax hack to the main page, that shouldn't affect the search should it?
« Last Edit: 09-17-2006, 13:23:30 by dragon_788 » Report to moderator   Logged
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #30 on: 09-21-2006, 13:43:30 » Reply with quote

If other engines are working I'm betting the ajax hack didn't break it.

possible the server went down or was busy.

Here is an example of the cookie
Code:
uid=#######;cryptpw=####;authtoken=#####################;language=en_EN

I have added it to the profile under both domains
http://www.piratebay.org/
and
thepiratebay.org
Report to moderator   Logged
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #31 on: 09-21-2006, 17:29:13 » Reply with quote

Your browser / cookie with the site has that information in it... not TorrentFlux.   The remote torrent site reads your cookie information and uses the language you have set there.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
dragon_788
Newbie
*
Offline Offline

Posts: 12



View Profile Personal Message (Offline)
« Reply #32 on: 09-23-2006, 02:45:30 » Reply with quote

Not sure what the glitch was but its back, and I took kboy's suggestion and added the site with both urls and it seems to be going a bit better.
Report to moderator   Logged
the care tacker
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 1



View Profile Personal Message (Offline)
« Reply #33 on: 10-09-2006, 12:53:16 » Reply with quote

I have had a punch of problems getting this to work. I did find the problem in the end...

My ubuntu install needed a little extra package: php5-curl

So it seems there is a requirement for this great engine to work... CURL must be installed.
Report to moderator   Logged
kendokar
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 9



View Profile Personal Message (Offline)
« Reply #34 on: 10-16-2006, 01:54:00 » Reply with quote

I use TF21 + linux 2.x..,

Search result is no problem, but the problem is if the search result have many page..
my url for TF is http://x.x.x.x/torrent/ but in search result, the url for showing next page is
http://x.x.x./search.phptorrentSearch.php?searchEngine=PirateBay&searchterm ...
it should  http://x.x.x/torrent/search.phptorrentSearch.php?searchEngine=Pi....

another search module works fine..
Report to moderator   Logged
kboy
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 79





View Profile Personal Message (Offline)
« Reply #35 on: 10-16-2006, 23:21:27 » Reply with quote

yep. see the problem .. code is updated.
Report to moderator   Logged
kendokar
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 9



View Profile Personal Message (Offline)
« Reply #36 on: 10-18-2006, 02:30:22 » Reply with quote


Thanks kboy.. it work fine now..

Report to moderator   Logged
guzza
Newbie
*
Offline Offline

Posts: 1



View Profile Personal Message (Offline)
« Reply #37 on: 01-20-2007, 14:44:36 » Reply with quote

I have a problem with your and other searches. When for example I search "anatomy" the results are nowhere to be found but I noticed that it did a search because there are 5 pages of results just like on pirate bay. And when changing the query and observing the result pages it all fit just like on pirate bay's search.

Here :

    Torrent Name  (Hide Seedless)    Category      Size    Date Added    Seeds    Peers
 1 2 3 4 5 Next
[Return to Torrents]

as you can see there are 5 pages for the search on "anatomy" ... any ideas?
torrentflux is 2.3 and module 1.05

p.s. only mininova,torrentportal and torrentspy searches are working ... everything other is empty
« Last Edit: 01-20-2007, 15:09:53 by guzza » Report to moderator   Logged
spifff
Newbie
*
Offline Offline

Posts: 1



View Profile Personal Message (Offline)
« Reply #38 on: 01-30-2007, 12:06:20 » Reply with quote

i have exactly the samr probleme as guzza above.

I seems to be working but dont show the results.

TF 2.3
Report to moderator   Logged
evilscoop
Newbie
*
Offline Offline

Posts: 4



View Profile Personal Message (Offline)
« Reply #39 on: 02-21-2007, 07:59:23 » Reply with quote

Call me thick, but all I get from this version is :-
Parse error: parse error, unexpected T_CLASS, expecting T_FUNCTION in /var/www/flux/searchEngines/PirateBayEngine.php on line 833

TF2.3 final, linux
« Last Edit: 02-21-2007, 08:01:54 by evilscoop » Report to moderator   Logged
morsub4u
Newbie
*
Offline Offline

Posts: 40

morsub4u



View Profile Personal Message (Offline)
« Reply #40 on: 02-21-2007, 18:00:56 » Reply with quote

I also get the same error as above:

Parse error: parse error, unexpected T_CLASS, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/www/html/TF2/searchEngines/PirateBayEngine.php on line 833

Any ideas?

NOTE: Also, I have never had to use cookies before.  Isn't piratebay public?
« Last Edit: 02-21-2007, 18:03:49 by morsub4u » Report to moderator   Logged

Linux distrobution - Mandrake 10.2 (3.4.3-3mdk)
TorrentFlux version - 2.3
Python version - 2.4
PHP Version - 4.3.10
BitTornado Version - 0.3.13
Webserver software and version - Apache 2.0
prof. Czit
Newbie
*
Offline Offline

Posts: 1



View Profile Personal Message (Offline)
« Reply #41 on: 04-06-2007, 04:42:51 » Reply with quote

I've fixed 1.06 script, so I'm posting it here. Grin

* PirateBayEngine.php (17.47 KB - downloaded 104 times.)
Report to moderator   Logged
evilscoop
Newbie
*
Offline Offline

Posts: 4



View Profile Personal Message (Offline)
« Reply #42 on: 04-11-2007, 09:15:56 » Reply with quote

thanks prof, that seems to be working Cheesy
Report to moderator   Logged
Pages: 1 2 3 [All] Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


Powered by MySQL Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Powered by PHP