Sha256: 3a82729203ea70fb843054c91fda08101b8b48357269407e95d54481d6ff3d2f

Contents?: true

Size: 712 Bytes

Versions: 9

Compression:

Stored size: 712 Bytes

Contents

module DownloadTV

	class ThePirateBay < LinkGrabber

		def initialize(tpb_proxy = "https://pirateproxy.cc")
			proxy = tpb_proxy.gsub(/\/+$/, "") || "https://thepiratebay.cr"

			super("#{proxy}/search/%s/0/7/0")
			
		end

		def get_links(s)

			# Format the url
			search = @url % [s]

			data = @agent.get(search).search("#searchResult tr")
			# Skip the header
			data = data.drop 1

			raise NoTorrentsError if data.size == 0

			# Second cell of each row contains links and name
			results = data.map { |d| d.search("td")[1] }

			names = results.collect {|i| i.search(".detName").text.strip }
			links = results.collect {|i| i.search("a")[1].attribute("href").text }

			names.zip(links)

		end

	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
download_tv-2.2.1 lib/download_tv/grabbers/tpb.rb
download_tv-2.2.0 lib/download_tv/grabbers/tpb.rb
download_tv-2.1.1 lib/download_tv/grabbers/tpb.rb
download_tv-2.1.0 lib/download_tv/grabbers/tpb.rb
download_tv-2.0.6 lib/download_tv/grabbers/tpb.rb
download_tv-2.0.5 lib/download_tv/grabbers/tpb.rb
download_tv-2.0.4 lib/download_tv/grabbers/tpb.rb
download_tv-2.0.3 lib/download_tv/grabbers/tpb.rb
download_tv-2.0.0 lib/download_tv/grabbers/tpb.rb