class DownloadTV::Addic7ed
Addic7ed prototype (WIP)
#
def download_file(url)
def download_file(url) # Url must be like 'http://www.addic7ed.com/updated/1/115337/0' # ADDIC7ED PROVIDES RSS agent = Mechanize.new page = agent.get(url, [], @url) puts page.save('Hi') end
def get_subs(show)
def get_subs(show) url = get_url(show) download_file(url) end
def get_url(show)
def get_url(show) # Change spaces for the separator s = show.gsub(' ', @sep) # Format the url search = Format(@url, s) agent = Mechanize.new res = agent.get(search) # No redirection means no subtitle found raise NoSubtitlesError if res.uri.to_s == search ########## # DO OPENSUBTITLES FIRST (see subtitles.rb) ##### # We now have an URL like: # http://www.addic7ed.com/serie/Mr._Robot/2/3/eps2.1k3rnel-pan1c.ksd # To find the real links: # see comments at the end of file end
def initialize
def initialize super('http://www.addic7ed.com/search.php?search=%s&Submit=Search') end