#!/usr/bin/python # -*- coding: utf-8 -*- import urllib2 import urllib import re import time from Plugin import Plugin from time import time class RapidshareCom(Plugin): def __init__(self, parent): Plugin.__init__(self, parent) self.plugin_name = "Rapidshare.com" self.plugin_pattern = r"http://(?:www.)?rapidshare.com/files/" self.plugin_type = "hoster" self.plugin_config = {} pluginProp = {} pluginProp ['name'] = "RapidshareCom" pluginProp ['version'] = "0.1" pluginProp ['format'] = "*.py" pluginProp ['description'] = """Rapidshare Plugin""" pluginProp ['author'] = "spoob" pluginProp ['author_email'] = "nn@nn.de" self.pluginProp = pluginProp self.parent = parent self.html = [None, None] self.prehtml = None self.html_old = None #time() where loaded the HTML self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False 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"