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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cdb39e4207086f289d3e0d2dcabe074cf24e4e74bd3aaefaabceb68e4958113
4
- data.tar.gz: f960d0ef1b358b4d84d4e28cc470b96211f690d22f70e9ad4931e3536944519f
3
+ metadata.gz: 16290be3711a600665ce0651a6056268ebefe5380516757a6403a37953d5638a
4
+ data.tar.gz: 80e903cf6413073ed7f4bdd5a8277bf3486571cadb28dcabd86c38abc9539302
5
5
  SHA512:
6
- metadata.gz: 8de56b35aab493b54e628670c232d9ee920d26ac47afdf217f9a92ad4ef48929916e8964881b75c2e1d0b16237ea47654c26e64187e761233c67a15d2d681c61
7
- data.tar.gz: '0670878252cc519acd6b8967229998b37ceaae6ce17127ac7a65d14728ae551094e88908cf6873d165d98a56693881288c185666999ed4ba712830116dbeb25a'
6
+ metadata.gz: bac0d3ffd606f23d21cf0e0875201b01eea882e0f5041e919da29e20e453d3ff8c471370412de66f554fde8a076c49c59c7422dc9ddc6054311b54899a82604a
7
+ data.tar.gz: 58930a63aceaef5da023d04442ddf54c6332718a4abe69a8a487e5b104d95bc7f5874e0a11fa04922cc0267cd670a79482551116d0ce3d409b8146e3bba2e141
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## Next (unreleased)
4
4
 
5
+ ## 2.9.3 (2025-04-20)
6
+
7
+ * Grabbers
8
+ * ThePirateBay: fix error
9
+
10
+ ## 2.9.2 (2025-03-14)
11
+
12
+ * Grabbers
13
+ * ThePirateBay: update URL
14
+ * Torrentz: remove grabber
15
+
5
16
  ## 2.9.1 (2024-09-24)
6
17
 
7
18
  * Grabbers
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 Torrentz. 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.
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 'byebug', '~> 11.1'
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] ||= 'Torrentz'
143
+ self[:grabber] ||= 'ThePirateBay'
144
144
  self[:date] ||= Date.today - 1
145
145
  self[:filters] ||= default_filters
146
146
  self[:pending] ||= []
@@ -12,7 +12,7 @@ module DownloadTV
12
12
  raw_data = agent.get(format(@url, show))
13
13
  rows = raw_data.search('div.tgxtablerow')
14
14
 
15
- raise NoTorrentsError if rows.size == 0
15
+ raise NoTorrentsError if rows.size.zero?
16
16
 
17
17
  rows.map do |row|
18
18
  [row.children[4].text.strip,
@@ -4,7 +4,7 @@ module DownloadTV
4
4
  ##
5
5
  # ThePirateBay grabber
6
6
  class ThePirateBay < LinkGrabber
7
- def initialize(tpb_proxy = 'https://tpb30.ukpass.co/')
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
@@ -6,7 +6,7 @@ module DownloadTV
6
6
  class Torrent
7
7
  class << self
8
8
  def grabbers
9
- %w[Torrentz ThePirateBay Eztv]
9
+ %w[ThePirateBay Eztv]
10
10
  end
11
11
 
12
12
  def healthcheck
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DownloadTV
4
- VERSION = '2.9.1'
4
+ VERSION = '2.9.3'
5
5
  end
@@ -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('torrentz') }
7
- let(:fourth_grabber) { double('tpb') }
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::Torrentz).to receive(:new).and_return first_grabber
14
- allow(DownloadTV::ThePirateBay).to receive(:new).and_return second_grabber
15
- allow(DownloadTV::Eztv).to receive(:new).and_return third_grabber
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[Torrentz ThePirateBay Eztv]
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
- result = subject.get_links(test_show)
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
- result = subject.get_links(test_show)
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
- result = subject.get_links(test_show)
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).not_to receive(:get_links)
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
- result = subject.get_links(test_show)
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
- result = subject.get_links(test_show)
129
- result = subject.get_links(test_show)
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.1
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: 2024-09-24 00:00:00.000000000 Z
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: minitest
27
+ name: byebug
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '5.0'
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: '5.0'
39
+ version: '11.1'
41
40
  - !ruby/object:Gem::Dependency
42
- name: rake
41
+ name: minitest
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
- - - ">="
44
+ - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: 12.3.3
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: 12.3.3
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: byebug
69
+ name: rake
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - "~>"
72
+ - - ">="
74
73
  - !ruby/object:Gem::Version
75
- version: '11.1'
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: '11.1'
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.5.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