module TTWatcher
TTWatcher
¶ ↑
Torrents search tool for [rutor|unionpeer|megashara|zooqle] sites.
@example Detailed sample
require 'ttwatcher' torrent_name = 'happy new year' torrents = TTWatcher.search torrent_name puts '-----' * 20 puts "request: #{torrent_name}" puts "totally found: #{torrents.count}", "" puts "from megashara: #{torrents.select { |t| t.tracker == :megashara }.count }" puts "from rutor.org: #{torrents.select { |t| t.tracker == :rutor }.count }" puts "from unionpeer: #{torrents.select { |t| t.tracker == :unionpeer }.count }" puts "from zooqle: #{torrents.select { |t| t.tracker == :zooqle }.count }" puts '-----' * 20 torrents.each do |t| puts "name: #{t.name}" if t.name puts "url: #{t.url}" if t.url puts "size: #{t.size}" if t.size puts "added_date: #{t.added_date}" if t.added_date puts "tracker: #{t.tracker}" if t.tracker if t.download_url puts "download_url: #{t.download_url}" else puts "magnet_url: #{t.magnet_url}" end puts '-----' * 20 end
For further details, please @see Readme.md
@author Kuzichev Michael @license MIT
encoding : utf-8
encoding : utf-8
Constants
- H
Public Class Methods
search(name, params ={})
click to toggle source
Searches torrents.
@example Expansive sample
torrents = TTWatcher.search 'happy new year', from: [:rutor, :zooqle] puts torrents.count
@param [String] name
Torrent name.
@param [Hash] params @option params [Array<Symbol, String>, Symbol, String] :from
Site(s) where application should search torrents.
@return [Array<Torrent>]
Array (homogeneous) with torrents. Can be empty if nothing was found.
# File sources/ttwatcher.rb, line 67 def self.search(name, params ={}) TorrentAgent.search name, params end
Private Class Methods
load(**params)
click to toggle source
Loads *.rb files in requested order
# File sources/ttwatcher/project_structure.rb, line 27 def self.load(**params) params[:files].each do |f| require File.join(__dir__, params[:folder].to_s, f) end end