download_tv 2.8.4 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -0
- data/bin/tv +6 -0
- data/lib/download_tv/configuration.rb +4 -4
- data/lib/download_tv/grabbers/tpb.rb +12 -27
- data/lib/download_tv/grabbers/tpbapi.rb +45 -0
- data/lib/download_tv/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ac0cea3ddd27f103e007c188a563c03d1f815692bb2310ffe6afa30047765b5
|
4
|
+
data.tar.gz: ab4e79a7197b9cec989be91fd4229c45652d8c9cdaf938f4f09781f8a42ee458
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff1b66cb9a68975ba031638bcd66ab5ca01ad9555cdea8d1a42b2bb397dd5040564ddcc335e97a3976a28e87fa63b035b23b0344dcd5e1abbaeaa647b295bf7d
|
7
|
+
data.tar.gz: 3408d00841377fd73b8cc564c121ac1b9983362b72277b0563a942774de97081c247ffb138acb1bc83160407c575fddce02e10e388d24ff5bd3d4ccb1c430538
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
## Next (unreleased)
|
4
4
|
|
5
|
+
## 2.9.0 (2024-09-22)
|
6
|
+
|
7
|
+
* Improvements
|
8
|
+
* Add -e option to edit configuration manually.
|
9
|
+
|
10
|
+
## 2.8.5 (2024-09-22)
|
11
|
+
|
12
|
+
* Grabbers
|
13
|
+
* ThePirateBay: fix with upstream again...
|
14
|
+
* ThePirateBayAPI: added (disabled) in case they expose it again.
|
15
|
+
|
5
16
|
## 2.8.4 (2024-08-19)
|
6
17
|
|
7
18
|
* Grabbers
|
data/README.md
CHANGED
@@ -33,6 +33,7 @@ Specific options:
|
|
33
33
|
-p, --pending Show list of pending downloads
|
34
34
|
--clear-pending Clear list of pending downloads
|
35
35
|
-q, --queue SHOW Add show episode to pending downloads list
|
36
|
+
-e, --edit Open configuration with $EDITOR
|
36
37
|
-v, --version Print version
|
37
38
|
-h, --help Show this message
|
38
39
|
```
|
data/bin/tv
CHANGED
@@ -82,6 +82,12 @@ opt_parser = OptionParser.new do |opts|
|
|
82
82
|
options[:arg] = s
|
83
83
|
end
|
84
84
|
|
85
|
+
opts.on('-e', '--edit', 'Open configuration with $EDITOR') do
|
86
|
+
path = DownloadTV::Configuration.new.config_path
|
87
|
+
Process.detach(Process.spawn("$EDITOR #{path}"))
|
88
|
+
exit
|
89
|
+
end
|
90
|
+
|
85
91
|
opts.on('-v', '--version', 'Print version') do
|
86
92
|
puts DownloadTV::VERSION
|
87
93
|
exit
|
@@ -44,6 +44,10 @@ module DownloadTV
|
|
44
44
|
serialize
|
45
45
|
end
|
46
46
|
|
47
|
+
def config_path
|
48
|
+
(content[:path] || default_config_path)
|
49
|
+
end
|
50
|
+
|
47
51
|
private
|
48
52
|
|
49
53
|
def content
|
@@ -127,10 +131,6 @@ module DownloadTV
|
|
127
131
|
self[:filters][:excludes] = read_and_split_list :upcase
|
128
132
|
end
|
129
133
|
|
130
|
-
def config_path
|
131
|
-
(content[:path] || default_config_path)
|
132
|
-
end
|
133
|
-
|
134
134
|
def default_config_path
|
135
135
|
File.join(ENV['HOME'], '.config', 'download_tv', 'config')
|
136
136
|
end
|
@@ -4,42 +4,27 @@ module DownloadTV
|
|
4
4
|
##
|
5
5
|
# ThePirateBay grabber
|
6
6
|
class ThePirateBay < LinkGrabber
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
udp://movies.zsw.ca:6969/announce
|
12
|
-
udp://tracker.dler.org:6969/announce
|
13
|
-
udp://opentracker.i2p.rocks:6969/announce
|
14
|
-
udp://open.stealth.si:80/announce
|
15
|
-
udp://tracker.0x.tf:6969/announce
|
16
|
-
]
|
17
|
-
|
18
|
-
def initialize
|
19
|
-
super("https://tpb36.ukpass.co/apibay/q.php?q=%s&cat=")
|
7
|
+
def initialize(tpb_proxy = 'https://tpb30.ukpass.co/')
|
8
|
+
proxy = tpb_proxy.gsub(%r{/+$}, '')
|
9
|
+
|
10
|
+
super("#{proxy}/search/%s/0/7/0")
|
20
11
|
end
|
21
12
|
|
22
13
|
def get_links(show)
|
23
14
|
search = format(@url, show)
|
24
15
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
raise NoTorrentsError if parsed.size == 1 && parsed.first['name'] == 'No results returned'
|
16
|
+
# Skip the header
|
17
|
+
data = agent.get(search).search('#searchResult tr').drop 1
|
29
18
|
|
30
|
-
|
31
|
-
[elem['name'], build_magnet(elem['info_hash'], elem['name'])]
|
32
|
-
end
|
33
|
-
end
|
19
|
+
raise NoTorrentsError if data.empty?
|
34
20
|
|
35
|
-
|
21
|
+
# Second cell of each row contains links and name
|
22
|
+
results = data.map { |d| d.search('td')[1] }
|
36
23
|
|
37
|
-
|
38
|
-
|
39
|
-
end
|
24
|
+
names = results.collect { |i| i.search('.detName').text.strip }
|
25
|
+
links = results.collect { |i| i.search('a')[1].attribute('href').text }
|
40
26
|
|
41
|
-
|
42
|
-
trackers_params ||= "&tr=#{TRACKERS.map { |tracker| CGI.escape(tracker) }.join('&tr=')}"
|
27
|
+
names.zip(links)
|
43
28
|
end
|
44
29
|
end
|
45
30
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DownloadTV
|
4
|
+
##
|
5
|
+
# ThePirateBay grabber
|
6
|
+
class ThePirateBayAPI < LinkGrabber
|
7
|
+
TRACKERS = %w[
|
8
|
+
udp://tracker.coppersurfer.tk:6969/announce
|
9
|
+
udp://tracker.openbittorrent.com:6969/announce
|
10
|
+
udp://tracker.opentrackr.org:1337
|
11
|
+
udp://movies.zsw.ca:6969/announce
|
12
|
+
udp://tracker.dler.org:6969/announce
|
13
|
+
udp://opentracker.i2p.rocks:6969/announce
|
14
|
+
udp://open.stealth.si:80/announce
|
15
|
+
udp://tracker.0x.tf:6969/announce
|
16
|
+
]
|
17
|
+
|
18
|
+
def initialize
|
19
|
+
super("https://tpb36.ukpass.co/apibay/q.php?q=%s&cat=")
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_links(show)
|
23
|
+
search = format(@url, show)
|
24
|
+
|
25
|
+
data = agent.get(search)
|
26
|
+
parsed = JSON.parse(data.body)
|
27
|
+
|
28
|
+
raise NoTorrentsError if parsed.size == 1 && parsed.first['name'] == 'No results returned'
|
29
|
+
|
30
|
+
parsed.map do |elem|
|
31
|
+
[elem['name'], build_magnet(elem['info_hash'], elem['name'])]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def build_magnet(torrent_hash, name)
|
38
|
+
"magnet:?xt=urn:btih:#{torrent_hash}&dn=#{CGI.escape(name)}#{trackers_params}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def trackers_params
|
42
|
+
trackers_params ||= "&tr=#{TRACKERS.map { |tracker| CGI.escape(tracker) }.join('&tr=')}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/download_tv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: download_tv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- guille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/download_tv/grabbers/torrentgalaxy.rb
|
135
135
|
- lib/download_tv/grabbers/torrentz.rb
|
136
136
|
- lib/download_tv/grabbers/tpb.rb
|
137
|
+
- lib/download_tv/grabbers/tpbapi.rb
|
137
138
|
- lib/download_tv/linkgrabber.rb
|
138
139
|
- lib/download_tv/myepisodes.rb
|
139
140
|
- lib/download_tv/torrent.rb
|