#!/usr/bin/env python # -*- coding: utf-8 -*- import re from time import time from Plugin import Plugin class UploadedTo(Plugin): def __init__(self, parent): Plugin.__init__(self, parent) props = {} props['name'] = "UploadedTo" props['type'] = "hoster" props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/" props['version'] = "0.1" props['description'] = """Uploaded.to Download Plugin""" props['author_name'] = ("spoob") props['author_mail'] = ("spoob@pyload.org") self.props = props self.parent = parent self.html = None self.html_old = None #time() where loaded the HTML self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = None self.multi_dl = False def download_html(self): url = self.parent.url self.html = self.req.load(url) try: wait_minutes = re.search(r"Or wait (\d+) minutes", self.html).group(1) self.time_plus_wait = time() + 60 * int(wait_minutes) self.want_reconnect = True except: self.time_plus_wait = 0 def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() if not self.want_reconnect: file_url_pattern = r".*