Class: DownloadTV::TorrentGalaxy

Inherits:
LinkGrabber show all
Defined in:
lib/download_tv/grabbers/torrentgalaxy.rb

Overview

TorrentGalaxy grabber

Instance Attribute Summary

Attributes inherited from LinkGrabber

#url

Instance Method Summary collapse

Methods inherited from LinkGrabber

#agent, #online?

Constructor Details

#initializeTorrentGalaxy

Returns a new instance of TorrentGalaxy.



7
8
9
# File 'lib/download_tv/grabbers/torrentgalaxy.rb', line 7

def initialize
  super('https://torrentgalaxy.to/torrents.php?search=%s&sort=seeders&order=desc')
end

Instance Method Details

Raises:



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/download_tv/grabbers/torrentgalaxy.rb', line 11

def get_links(show)
  raw_data = agent.get(format(@url, show))
  rows = raw_data.search('div.tgxtablerow')

  raise NoTorrentsError if rows.size == 0

  rows.map do |row|
    [row.children[4].text.strip,
     row.children[5].children[1].attribute('href').text]
  end
end