eztv 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +25 -1
- data/eztv.gemspec +1 -1
- data/lib/eztv.rb +1 -1
- data/test/eztv_test.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8585bd0c2793a97f013034cc7c2c648810dd091c
|
4
|
+
data.tar.gz: 27827e33d1f19c555fa6218a373dd3af9bc8c42c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38097442f74dc0318efa90d5b39e5c5dcbb3488892e5c3fe71d0a3000500d74d0ad675b3a61dcba0babd0c83daab2f5a26e7ab394e674efd8fee3b5f3a58ea8d
|
7
|
+
data.tar.gz: 92550cb587ba5d07a2a7c8be951da7bed70a17c7b4c68f4b91e688b3ae7eebe86e1126b8b091128ea369a1b942733fb9161c68d5037ce4372c02ef10f7974e63
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# EZTV
|
2
|
+
[](https://travis-ci.org/DamirSvrtan/eztv)
|
3
|
+
[](http://badge.fury.io/rb/eztv)
|
2
4
|
|
3
5
|
A Ruby scraper for the catastrophic EZTV API. It is not using the RSS feed since it doesn't work well, so it scrapes the search results.
|
4
6
|
|
@@ -18,22 +20,44 @@ Or install it yourself as:
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
23
|
+
Fetch a series and get all the magnet links:
|
21
24
|
```ruby
|
25
|
+
require 'eztv'
|
26
|
+
|
22
27
|
white_collar = EZTV::Series.new("white collar")
|
23
28
|
|
24
29
|
white_collar.episodes.each do |episode|
|
25
30
|
puts episode.magnet_link
|
26
31
|
end
|
32
|
+
```
|
33
|
+
|
34
|
+
Get all regular torrent download links from S01E01:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
white_collar.episode(1,1).links
|
38
|
+
# ["//torrent.zoink.it/White.Collar.S01E01.Pilot.HDTV.XviD-FQM.[eztv].torrent",
|
39
|
+
# "http://www.mininova.org/tor/3077342",
|
40
|
+
# "http://www.bt-chat.com/download.php?info_hash=e0e74306adca549be19b147b5ee14bde1b99bb1d"]
|
41
|
+
```
|
27
42
|
|
43
|
+
Get number of seasons or number of episodes per season:
|
44
|
+
```ruby
|
28
45
|
puts "Number of seasons: #{white_collar.seasons.count}"
|
29
46
|
puts "Number of episodes in season 1: #{white_collar.season(1).count}"
|
47
|
+
```
|
30
48
|
|
49
|
+
Get the last episode of the latest season in SxxExx format:
|
50
|
+
```ruby
|
51
|
+
white_collar.episodes.last.s01e01_format
|
52
|
+
```
|
53
|
+
There will be an error raised if you browsed for a non existing series:
|
54
|
+
```ruby
|
31
55
|
nonny = EZTV::Series.new("nonny")
|
32
56
|
begin
|
33
57
|
nonny.episodes
|
34
58
|
rescue EZTV::SeriesNotFoundError => e
|
35
59
|
puts e.message
|
36
|
-
|
60
|
+
# "Unable to find 'nonny' on https://eztv.it."
|
37
61
|
end
|
38
62
|
```
|
39
63
|
|
data/eztv.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "eztv"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.2"
|
8
8
|
spec.authors = ["Damir Svrtan"]
|
9
9
|
spec.email = ["damir.svrtan@gmail.com"]
|
10
10
|
spec.summary = "EZTV wrapper in Ruby"
|
data/lib/eztv.rb
CHANGED
data/test/eztv_test.rb
CHANGED
@@ -19,10 +19,17 @@ class TestExistingSeries < Minitest::Test
|
|
19
19
|
|
20
20
|
def test_first_episode
|
21
21
|
first_episode = @white_collar.episodes.first
|
22
|
-
assert_equal 1, first_episode.episode_number
|
23
22
|
assert_equal 1, first_episode.season
|
23
|
+
assert_equal 1, first_episode.episode_number
|
24
24
|
assert_equal "S01E01", first_episode.s01e01_format
|
25
25
|
end
|
26
|
+
|
27
|
+
def test_latest_episode
|
28
|
+
first_episode = @white_collar.episodes.last
|
29
|
+
assert_equal 5, first_episode.season
|
30
|
+
assert_equal 13, first_episode.episode_number
|
31
|
+
assert_equal "S05E13", first_episode.s01e01_format
|
32
|
+
end
|
26
33
|
end
|
27
34
|
|
28
35
|
class TestNonExistingSeries < Minitest::Test
|