lib/download_tv/grabbers/tpb.rb in download_tv-2.4.7 vs lib/download_tv/grabbers/tpb.rb in download_tv-2.5.0
- old
+ new
@@ -1,21 +1,21 @@
+# frozen_string_literal: true
+
module DownloadTV
##
# ThePirateBay grabber
class ThePirateBay < LinkGrabber
def initialize(tpb_proxy = 'https://pirateproxy.sh/')
proxy = tpb_proxy.gsub(%r{/+$}, '')
super("#{proxy}/search/%s/0/7/0")
end
- def get_links(s)
- # Format the url
- search = format(@url, s)
+ def get_links(show)
+ search = format(@url, show)
- data = @agent.get(search).search('#searchResult tr')
# Skip the header
- data = data.drop 1
+ data = @agent.get(search).search('#searchResult tr').drop 1
raise NoTorrentsError if data.empty?
# Second cell of each row contains links and name
results = data.map { |d| d.search('td')[1] }