#!/usr/bin/python # -*- coding: utf-8 -*- import re import time from time import time from Plugin import Plugin class RapidshareCom(Plugin): def __init__(self, parent): Plugin.__init__(self, parent) props = {} props['name'] = "RapidshareCom" props['type'] = "hoster" props['pattern'] = r"http://(?:www.)?rapidshare.com/files/" props['version'] = "0.1" props['description'] = """Rapidshare.com Download Plugin""" props['author_name'] = ("spoob") props['author_mail'] = ("spoob@pyload.org") self.props = props self.parent = parent self.html = [None, None] self.html_old = None #time() where loaded the HTML self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False self.multi_dl = False self.read_config() if self.config['premium']: self.multi_dl = True def set_parent_status(self): """ sets all available Statusinfos about a File in self.parent.status """ if self.html[0] == None: self.download_html() self.get_wait_time() self.parent.status.filename = self.get_file_name() self.parent.status.url = self.get_file_url() self.parent.status.waituntil = self.wait_until() def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses """ url = self.parent.url html = self.req.load(url) self.html[0] = html self.html_old = time() def download_serverhtml(self): """downloads html with the important informations """ if self.html[0] == None: self.download_html() file_server_url = re.search(r"