Sha256: 141c6f9c05d1ac1808566d8dde564aefaf2a47e2d5c26a7813f3b3811cad96a7

Contents?: true

Size: 653 Bytes

Versions: 6

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true

module DownloadTV
  ##
  # EZTV.ag grabber
  class Eztv < LinkGrabber
    def initialize
      super('https://eztv.ag/search/%s')
    end

    def get_links(show)
      raw_data = agent.get(format(@url, show))
      raw_seeders = raw_data.search('td.forum_thread_post_end').map { |e| e.children[0].text.to_i }
      raw_links = raw_data.search('a.magnet').sort_by.with_index { |_, index| raw_seeders[index] }.reverse

      raise NoTorrentsError if raw_links.size == 0

      raw_links.collect do |i|
        [i.attribute('title').text.chomp(' Magnet Link'),
         i.attribute('href').text]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
download_tv-2.9.0 lib/download_tv/grabbers/eztv.rb
download_tv-2.8.5 lib/download_tv/grabbers/eztv.rb
download_tv-2.8.4 lib/download_tv/grabbers/eztv.rb
download_tv-2.8.3 lib/download_tv/grabbers/eztv.rb
download_tv-2.8.2 lib/download_tv/grabbers/eztv.rb
download_tv-2.8.1 lib/download_tv/grabbers/eztv.rb