Sha256: 5b79318633c1d413a6a9fa0327355dd582a0b1c1821fbf99984e7d84bb39b9af

Contents?: true

Size: 569 Bytes

Versions: 13

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

module DownloadTV
  ##
  # Torrentz2 grabber
  class Torrentz < LinkGrabber
    def initialize
      super('https://torrentz2.nz/search?q=%s')
    end

    def get_links(show)
      raw_data = agent.get(format(@url, show))
      results = raw_data.search('dl')

      raise NoTorrentsError if results.empty?

      data = results.sort_by { |e| e.search('dd span')[3].text.to_i }.reverse

      data.collect do |i|
        [i.children[0].text.strip,
         i.search('dd span a').first.attribute('href').text]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
download_tv-2.9.1 lib/download_tv/grabbers/torrentz.rb
download_tv-2.9.0 lib/download_tv/grabbers/torrentz.rb
download_tv-2.8.5 lib/download_tv/grabbers/torrentz.rb
download_tv-2.8.4 lib/download_tv/grabbers/torrentz.rb
download_tv-2.8.3 lib/download_tv/grabbers/torrentz.rb
download_tv-2.8.2 lib/download_tv/grabbers/torrentz.rb
download_tv-2.8.1 lib/download_tv/grabbers/torrentz.rb
download_tv-2.8.0 lib/download_tv/grabbers/torrentz.rb
download_tv-2.7.0 lib/download_tv/grabbers/torrentz.rb
download_tv-2.6.10 lib/download_tv/grabbers/torrentz.rb
download_tv-2.6.9 lib/download_tv/grabbers/torrentz.rb
download_tv-2.6.8 lib/download_tv/grabbers/torrentz.rb
download_tv-2.6.7 lib/download_tv/grabbers/torrentz.rb