download_tv 2.8.4 → 2.8.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c39ab8c419d632acdd80ea9a072dbb119e27bec036d8e631bd1fe677a7cdc133
4
- data.tar.gz: 6df0b53c0faedfa474631b8fb9c071b2bb3465a0b2172e599e2cd57d3d07b995
3
+ metadata.gz: f949ddf2dd0814373780e8b72b0186573f7b255b4704b1df13a4130cd86d0d08
4
+ data.tar.gz: 85c530552c796b1ae499a705368290d14108f82931dee5cd867184552adaf8f5
5
5
  SHA512:
6
- metadata.gz: e455efa1fb3c2a86b480f3e1cbc814dc97297e45f26eb3b611cd740d19033682980e2f4a85a69b8f9b16f2575806d625a63290b631966788838bde3001b9c803
7
- data.tar.gz: 65d73597d67dc3f03280d18d32d11a1b32d10e1c53ea3b8bac6cdda910de4af2800e90010d6a558906830837d770a2e96229059a620d62307b8935832b20ec61
6
+ metadata.gz: f7cd21e015d34429eda44aed2ba7ebb1565bac83064ef512e634479b65890e46a9ac6e562378e5fe0fe926f00dcd7d07ed1b87e0a0962862db133591af35d9d5
7
+ data.tar.gz: fc2f51385747ce6305214bdd5819edaa24d2e288c631d3648d30397d5e4250b9d70a664702a5be10c7f483e552cbed4e2a04e1cf69bb6acfb70f5f8bd97f2969
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Next (unreleased)
4
4
 
5
+ ## 2.8.5 (2024-09-22)
6
+
7
+ * Grabbers
8
+ * ThePirateBay: fix with upstream again...
9
+ * ThePirateBayAPI: added (disabled) in case they expose it again.
10
+
5
11
  ## 2.8.4 (2024-08-19)
6
12
 
7
13
  * Grabbers
@@ -4,42 +4,27 @@ module DownloadTV
4
4
  ##
5
5
  # ThePirateBay grabber
6
6
  class ThePirateBay < 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=")
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
- data = agent.get(search)
26
- parsed = JSON.parse(data.body)
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
- parsed.map do |elem|
31
- [elem['name'], build_magnet(elem['info_hash'], elem['name'])]
32
- end
33
- end
19
+ raise NoTorrentsError if data.empty?
34
20
 
35
- private
21
+ # Second cell of each row contains links and name
22
+ results = data.map { |d| d.search('td')[1] }
36
23
 
37
- def build_magnet(torrent_hash, name)
38
- "magnet:?xt=urn:btih:#{torrent_hash}&dn=#{CGI.escape(name)}#{trackers_params}"
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
- def trackers_params
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DownloadTV
4
- VERSION = '2.8.4'
4
+ VERSION = '2.8.5'
5
5
  end
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.8.4
4
+ version: 2.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - guille
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-19 00:00:00.000000000 Z
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