torrents 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -3
- data/lib/torrents/trackers/torrentleech.rb +2 -2
- data/spec/trackers/torrentleech_spec.rb +11 -1
- data/torrents.gemspec +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -76,7 +76,7 @@ The method takes the url as an argument and returns a single `Container::Torrent
|
|
76
76
|
|
77
77
|
$ Torrents.the_pirate_bay.find_by_details("http://thepiratebay.org/torrent/6173093/")
|
78
78
|
|
79
|
-
|
79
|
+
## What data to work with
|
80
80
|
|
81
81
|
### The Container::Torrent class
|
82
82
|
|
@@ -109,13 +109,17 @@ All values you pass to `cookies` must be of type string, like in the example abo
|
|
109
109
|
- member_id
|
110
110
|
- pass_hash
|
111
111
|
- PHPSESSID
|
112
|
+
- tluid
|
113
|
+
- tlpass
|
112
114
|
- TTI
|
113
115
|
- hass
|
114
116
|
- pass
|
115
117
|
- uid
|
116
|
-
|
117
|
-
**Note:** The cookies you pass might be browser and IP-adress sensitive. Which means that it might only work in the current browser using the current Internet connection.
|
118
118
|
|
119
|
+
**General note:** The cookies you pass might be browser and IP-adress sensitive. Which means that it might only work in the current browser using the current Internet connection.
|
120
|
+
|
121
|
+
**Torrentleech note:** Remember to check the *Remember Me* checkbox before using your browsers cookies.
|
122
|
+
|
119
123
|
## Error handling
|
120
124
|
|
121
125
|
I decided in the beginning of the project to rescue parse errors during the runtime and instead print them as warnings.
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Trackers
|
2
2
|
class Torrentleech
|
3
3
|
def details(tr)
|
4
|
-
"http://torrentleech.org" + tr.at_css(".title a").attr("href")
|
4
|
+
"http://www.torrentleech.org" + tr.at_css(".title a").attr("href")
|
5
5
|
end
|
6
6
|
|
7
7
|
def torrent(tr)
|
8
|
-
"http://torrentleech.org" + tr.at_css("td.quickdownload a").attr("href")
|
8
|
+
"http://www.torrentleech.org" + tr.at_css("td.quickdownload a").attr("href")
|
9
9
|
end
|
10
10
|
|
11
11
|
def title(tr)
|
@@ -53,7 +53,7 @@ describe Trackers::Torrentleech do
|
|
53
53
|
it "should return the right details link when trying to fetch recent torrents" do
|
54
54
|
rest_client("http://www.torrentleech.org/torrents/browse/index/page/1", "recent")
|
55
55
|
Torrents.torrentleech.cookies(cookies).results.each do |torrent|
|
56
|
-
torrent.details.should match(/http:\/\/torrentleech\.org\/torrent\/\d+/)
|
56
|
+
torrent.details.should match(/http:\/\/www\.torrentleech\.org\/torrent\/\d+/)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
@@ -71,4 +71,14 @@ describe Trackers::Torrentleech do
|
|
71
71
|
torrent.torrent.should eq("http://torrentleech.org/download/281171/The.Tourist.2010.720p.BRRip.x264-TiMPE.torrent")
|
72
72
|
torrent.title.should eq("The Tourist 2010 720p BRRip x264-TiMPE")
|
73
73
|
end
|
74
|
+
|
75
|
+
it "should return the corrent url" do
|
76
|
+
rest_client("http://www.torrentleech.org/torrents/browse/index/query/dvd/page/1", "search")
|
77
|
+
torrents = Torrents.torrentleech.cookies(cookies).search("dvd")
|
78
|
+
|
79
|
+
torrents.results.each do |torrent|
|
80
|
+
torrent.torrent.should match(/^http:\/\/www/)
|
81
|
+
torrent.details.should match(/^http:\/\/www/)
|
82
|
+
end
|
83
|
+
end
|
74
84
|
end
|
data/torrents.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: torrents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.12
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Linus Oleander
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-03-23 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|