download_tv 2.9.1 → 2.9.3
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/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/download_tv.gemspec +2 -2
- data/lib/download_tv/configuration.rb +1 -1
- data/lib/download_tv/grabbers/torrentgalaxy.rb +1 -1
- data/lib/download_tv/grabbers/tpb.rb +3 -3
- data/lib/download_tv/torrent.rb +1 -1
- data/lib/download_tv/version.rb +1 -1
- data/spec/download_tv/torrent_spec.rb +22 -27
- metadata +16 -22
- data/lib/download_tv/grabbers/torrentz.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16290be3711a600665ce0651a6056268ebefe5380516757a6403a37953d5638a
|
4
|
+
data.tar.gz: 80e903cf6413073ed7f4bdd5a8277bf3486571cadb28dcabd86c38abc9539302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bac0d3ffd606f23d21cf0e0875201b01eea882e0f5041e919da29e20e453d3ff8c471370412de66f554fde8a076c49c59c7422dc9ddc6054311b54899a82604a
|
7
|
+
data.tar.gz: 58930a63aceaef5da023d04442ddf54c6332718a4abe69a8a487e5b104d95bc7f5874e0a11fa04922cc0267cd670a79482551116d0ce3d409b8146e3bba2e141
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -70,7 +70,7 @@ The `-f` flag can be used to read the list of episodes to download from a file.
|
|
70
70
|
|
71
71
|
### Available link grabbers
|
72
72
|
|
73
|
-
With `-g` and `--show-grabbers`, the user can see what grabbers are available and choose one of these as their preferred option. By default, the application searches for torrents using
|
73
|
+
With `-g` and `--show-grabbers`, the user can see what grabbers are available and choose one of these as their preferred option. By default, the application searches for torrents using ThePirateBay. When a grabber doesn't have a torrent for said episode, is offline, or causes any error to appear, it skips to the next grabber until exhausting the list.
|
74
74
|
|
75
75
|
I usually publish a patch update to the gem when I detect one of them isn't working, disabling it or fixing it altogether. If a specific grabber is giving you problems, check whether you're running the latest version of the gem before opening an issue here.
|
76
76
|
|
data/download_tv.gemspec
CHANGED
@@ -22,10 +22,10 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.executables = ['tv']
|
23
23
|
|
24
24
|
s.add_development_dependency 'bundler', '~> 2.0'
|
25
|
+
s.add_development_dependency 'byebug', '~> 11.1'
|
25
26
|
s.add_development_dependency 'minitest', '~> 5.0'
|
26
|
-
s.add_development_dependency "rake", ">= 12.3.3"
|
27
27
|
s.add_development_dependency 'pry', '~> 0.13'
|
28
|
-
s.add_development_dependency '
|
28
|
+
s.add_development_dependency 'rake', '>= 12.3.3'
|
29
29
|
|
30
30
|
s.add_dependency('json')
|
31
31
|
s.add_dependency('mechanize')
|
@@ -140,7 +140,7 @@ module DownloadTV
|
|
140
140
|
# Maintains the previous values, in case it's an update from an existing file.
|
141
141
|
def set_default_values
|
142
142
|
self[:auto] ||= true
|
143
|
-
self[:grabber] ||= '
|
143
|
+
self[:grabber] ||= 'ThePirateBay'
|
144
144
|
self[:date] ||= Date.today - 1
|
145
145
|
self[:filters] ||= default_filters
|
146
146
|
self[:pending] ||= []
|
@@ -4,7 +4,7 @@ module DownloadTV
|
|
4
4
|
##
|
5
5
|
# ThePirateBay grabber
|
6
6
|
class ThePirateBay < LinkGrabber
|
7
|
-
def initialize(tpb_proxy = 'https://
|
7
|
+
def initialize(tpb_proxy = 'https://tpirbay.site/')
|
8
8
|
proxy = tpb_proxy.gsub(%r{/+$}, '')
|
9
9
|
|
10
10
|
super("#{proxy}/search/%s/0/7/0")
|
@@ -21,8 +21,8 @@ module DownloadTV
|
|
21
21
|
# Second cell of each row contains links and name
|
22
22
|
results = data.map { |d| d.search('td')[1] }
|
23
23
|
|
24
|
-
names = results.collect { |i| i.search('.detName').text.strip }
|
25
|
-
links = results.collect { |i| i.search('a')[1].attribute('href').text }
|
24
|
+
names = results.compact.collect { |i| i.search('.detName').text.strip }
|
25
|
+
links = results.compact.collect { |i| i.search('a')[1].attribute('href').text }
|
26
26
|
|
27
27
|
names.zip(links)
|
28
28
|
end
|
data/lib/download_tv/torrent.rb
CHANGED
data/lib/download_tv/version.rb
CHANGED
@@ -2,30 +2,26 @@
|
|
2
2
|
|
3
3
|
describe DownloadTV::Torrent do
|
4
4
|
let(:default_grabber) { nil }
|
5
|
-
let(:third_grabber) { double('eztv') }
|
6
|
-
let(:second_grabber) { double('
|
7
|
-
let(:
|
8
|
-
let(:first_grabber) { double('torrentgalaxy') }
|
5
|
+
# let(:third_grabber) { double('eztv') }
|
6
|
+
let(:second_grabber) { double('eztv') }
|
7
|
+
let(:first_grabber) { double('tpb') }
|
9
8
|
let(:test_show) { double('test_show') }
|
10
9
|
subject { described_class.new(default_grabber) }
|
11
10
|
|
12
11
|
before :each do
|
13
|
-
allow(DownloadTV::
|
14
|
-
allow(DownloadTV::
|
15
|
-
allow(DownloadTV::
|
16
|
-
# allow(DownloadTV::TorrentGalaxy).to receive(:new).and_return fourth_grabber
|
12
|
+
allow(DownloadTV::ThePirateBay).to receive(:new).and_return first_grabber
|
13
|
+
allow(DownloadTV::Eztv).to receive(:new).and_return second_grabber
|
14
|
+
# allow(DownloadTV::TorrentGalaxy).to receive(:new).and_return third_grabber
|
17
15
|
|
18
16
|
allow(first_grabber).to receive(:online?).and_return(true)
|
19
17
|
allow(second_grabber).to receive(:online?).and_return(true)
|
20
|
-
allow(third_grabber).to receive(:online?).and_return(true)
|
21
|
-
# allow(fourth_grabber).to receive(:online?).and_return(true)
|
18
|
+
# allow(third_grabber).to receive(:online?).and_return(true)
|
22
19
|
end
|
23
20
|
|
24
21
|
describe 'Torrent.grabbers' do
|
25
22
|
it 'returns the list of grabbers' do
|
26
23
|
# This order is assumed in the other specs, so explicitly checking it here
|
27
|
-
expect(described_class.grabbers).to eq %w[
|
28
|
-
|
24
|
+
expect(described_class.grabbers).to eq %w[ThePirateBay Eztv]
|
29
25
|
end
|
30
26
|
end
|
31
27
|
|
@@ -34,7 +30,7 @@ describe DownloadTV::Torrent do
|
|
34
30
|
result = double('result')
|
35
31
|
expect(first_grabber).to receive(:get_links).with(test_show).and_return(result)
|
36
32
|
|
37
|
-
|
33
|
+
subject.get_links(test_show)
|
38
34
|
end
|
39
35
|
|
40
36
|
context 'when the first grabber is offline' do
|
@@ -45,10 +41,10 @@ describe DownloadTV::Torrent do
|
|
45
41
|
it 'will use the second grabber' do
|
46
42
|
expect(first_grabber).not_to receive(:get_links)
|
47
43
|
expect(second_grabber).to receive(:get_links).with(test_show)
|
48
|
-
expect(third_grabber).not_to receive(:get_links)
|
44
|
+
# expect(third_grabber).not_to receive(:get_links)
|
49
45
|
# Add other torrents here with expectation #not_to receive
|
50
46
|
|
51
|
-
|
47
|
+
subject.get_links(test_show)
|
52
48
|
end
|
53
49
|
end
|
54
50
|
|
@@ -56,13 +52,13 @@ describe DownloadTV::Torrent do
|
|
56
52
|
before do
|
57
53
|
allow(first_grabber).to receive(:online?).and_return(false)
|
58
54
|
allow(second_grabber).to receive(:online?).and_return(false)
|
59
|
-
allow(third_grabber).to receive(:online?).and_return(false)
|
55
|
+
# allow(third_grabber).to receive(:online?).and_return(false)
|
60
56
|
end
|
61
57
|
|
62
58
|
it 'will exit' do
|
63
59
|
expect(first_grabber).not_to receive(:get_links)
|
64
60
|
expect(second_grabber).not_to receive(:get_links)
|
65
|
-
expect(third_grabber).not_to receive(:get_links)
|
61
|
+
# expect(third_grabber).not_to receive(:get_links)
|
66
62
|
|
67
63
|
expect { subject.get_links(test_show) }.to raise_error(SystemExit)
|
68
64
|
end
|
@@ -77,7 +73,7 @@ describe DownloadTV::Torrent do
|
|
77
73
|
expect(first_grabber).to receive(:get_links).ordered
|
78
74
|
expect(second_grabber).to receive(:get_links).ordered
|
79
75
|
|
80
|
-
|
76
|
+
subject.get_links(test_show)
|
81
77
|
end
|
82
78
|
end
|
83
79
|
|
@@ -85,13 +81,13 @@ describe DownloadTV::Torrent do
|
|
85
81
|
before do
|
86
82
|
allow(first_grabber).to receive(:get_links).with(test_show).and_raise(DownloadTV::NoTorrentsError)
|
87
83
|
allow(second_grabber).to receive(:get_links).with(test_show).and_raise(DownloadTV::NoTorrentsError)
|
88
|
-
allow(third_grabber).to receive(:get_links).with(test_show).and_raise(DownloadTV::NoTorrentsError)
|
84
|
+
# allow(third_grabber).to receive(:get_links).with(test_show).and_raise(DownloadTV::NoTorrentsError)
|
89
85
|
end
|
90
86
|
|
91
87
|
it 'will return an empty array' do
|
92
88
|
expect(first_grabber).to receive(:get_links).ordered
|
93
89
|
expect(second_grabber).to receive(:get_links).ordered
|
94
|
-
expect(third_grabber).to receive(:get_links).ordered
|
90
|
+
# expect(third_grabber).to receive(:get_links).ordered
|
95
91
|
|
96
92
|
expect(subject.get_links(test_show)).to eq []
|
97
93
|
end
|
@@ -103,10 +99,10 @@ describe DownloadTV::Torrent do
|
|
103
99
|
it 'will use that grabber preferently' do
|
104
100
|
test_show = double('test_show')
|
105
101
|
expect(first_grabber).not_to receive(:get_links)
|
106
|
-
expect(second_grabber).
|
107
|
-
expect(third_grabber).to receive(:get_links).with(test_show)
|
102
|
+
expect(second_grabber).to receive(:get_links)
|
103
|
+
# expect(third_grabber).to receive(:get_links).with(test_show)
|
108
104
|
|
109
|
-
|
105
|
+
subject.get_links(test_show)
|
110
106
|
end
|
111
107
|
end
|
112
108
|
|
@@ -117,16 +113,15 @@ describe DownloadTV::Torrent do
|
|
117
113
|
count += 1
|
118
114
|
raise DownloadTV::NoTorrentsError if count == 1
|
119
115
|
end
|
120
|
-
|
121
116
|
end
|
122
117
|
|
123
118
|
it 'the second run will use the original order' do
|
124
119
|
expect(first_grabber).to receive(:get_links).exactly(2).times
|
125
120
|
expect(second_grabber).to receive(:get_links).exactly(1).time
|
126
|
-
expect(third_grabber).not_to receive(:get_links)
|
121
|
+
# expect(third_grabber).not_to receive(:get_links)
|
127
122
|
|
128
|
-
|
129
|
-
|
123
|
+
subject.get_links(test_show)
|
124
|
+
subject.get_links(test_show)
|
130
125
|
end
|
131
126
|
end
|
132
127
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: download_tv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- guille
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-04-20 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -25,33 +24,33 @@ dependencies:
|
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '2.0'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
27
|
+
name: byebug
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
32
|
+
version: '11.1'
|
34
33
|
type: :development
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
39
|
+
version: '11.1'
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
41
|
+
name: minitest
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
|
-
- - "
|
44
|
+
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
46
|
+
version: '5.0'
|
48
47
|
type: :development
|
49
48
|
prerelease: false
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
51
50
|
requirements:
|
52
|
-
- - "
|
51
|
+
- - "~>"
|
53
52
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
53
|
+
version: '5.0'
|
55
54
|
- !ruby/object:Gem::Dependency
|
56
55
|
name: pry
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,19 +66,19 @@ dependencies:
|
|
67
66
|
- !ruby/object:Gem::Version
|
68
67
|
version: '0.13'
|
69
68
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
69
|
+
name: rake
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
|
-
- - "
|
72
|
+
- - ">="
|
74
73
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
74
|
+
version: 12.3.3
|
76
75
|
type: :development
|
77
76
|
prerelease: false
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
79
78
|
requirements:
|
80
|
-
- - "
|
79
|
+
- - ">="
|
81
80
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
81
|
+
version: 12.3.3
|
83
82
|
- !ruby/object:Gem::Dependency
|
84
83
|
name: json
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,8 +107,6 @@ dependencies:
|
|
108
107
|
- - ">="
|
109
108
|
- !ruby/object:Gem::Version
|
110
109
|
version: '0'
|
111
|
-
description:
|
112
|
-
email:
|
113
110
|
executables:
|
114
111
|
- tv
|
115
112
|
extensions: []
|
@@ -132,7 +129,6 @@ files:
|
|
132
129
|
- lib/download_tv/filterer.rb
|
133
130
|
- lib/download_tv/grabbers/eztv.rb
|
134
131
|
- lib/download_tv/grabbers/torrentgalaxy.rb
|
135
|
-
- lib/download_tv/grabbers/torrentz.rb
|
136
132
|
- lib/download_tv/grabbers/tpb.rb
|
137
133
|
- lib/download_tv/grabbers/tpbapi.rb
|
138
134
|
- lib/download_tv/linkgrabber.rb
|
@@ -152,7 +148,6 @@ homepage: https://github.com/guille/download_tv
|
|
152
148
|
licenses:
|
153
149
|
- MIT
|
154
150
|
metadata: {}
|
155
|
-
post_install_message:
|
156
151
|
rdoc_options: []
|
157
152
|
require_paths:
|
158
153
|
- lib
|
@@ -167,8 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
162
|
- !ruby/object:Gem::Version
|
168
163
|
version: '0'
|
169
164
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
171
|
-
signing_key:
|
165
|
+
rubygems_version: 3.6.2
|
172
166
|
specification_version: 4
|
173
167
|
summary: DownloadTV is a tool that allows the user to find magnet links for tv show
|
174
168
|
episodes. It accepts shows as arguments, from a file or it can integrate with your
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DownloadTV
|
4
|
-
##
|
5
|
-
# Torrentz2 grabber
|
6
|
-
class Torrentz < LinkGrabber
|
7
|
-
def initialize
|
8
|
-
super('https://torrentz2.nz/search?q=%s')
|
9
|
-
end
|
10
|
-
|
11
|
-
def get_links(show)
|
12
|
-
raw_data = agent.get(format(@url, show))
|
13
|
-
results = raw_data.search('dl')
|
14
|
-
|
15
|
-
raise NoTorrentsError if results.empty?
|
16
|
-
|
17
|
-
data = results.sort_by { |e| e.search('dd span')[3].text.to_i }.reverse
|
18
|
-
|
19
|
-
data.collect do |i|
|
20
|
-
[i.children[0].text.strip,
|
21
|
-
i.search('dd span a').first.attribute('href').text]
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|