Class: DownloadTV::TorrentGalaxy
- Inherits:
-
LinkGrabber
- Object
- LinkGrabber
- DownloadTV::TorrentGalaxy
- Defined in:
- lib/download_tv/grabbers/torrentgalaxy.rb
Overview
TorrentGalaxy grabber
Instance Attribute Summary
Attributes inherited from LinkGrabber
Instance Method Summary collapse
- #get_links(show) ⇒ Object
-
#initialize ⇒ TorrentGalaxy
constructor
A new instance of TorrentGalaxy.
Methods inherited from LinkGrabber
Constructor Details
#initialize ⇒ TorrentGalaxy
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
#get_links(show) ⇒ Object
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 |