From b692dc0ba8e8940844eb647a1f15e435a55ce4eb Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 11 Mar 2011 23:41:40 +0100 Subject: closed #259, #250 --- module/plugins/PluginManager.py | 19 ++++++-------- module/plugins/hoster/DepositfilesCom.py | 5 ++-- module/plugins/hoster/FileserveCom.py | 44 ++++++++++++++++++++++++++------ module/plugins/hoster/ShareonlineBiz.py | 14 +++++----- 4 files changed, 53 insertions(+), 29 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index a911cdd1e..0848d520e 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -20,16 +20,11 @@ import re import sys -from os import listdir -from os import makedirs - -from os.path import isfile -from os.path import join -from os.path import exists -from os.path import abspath - +from os import listdir, makedirs +from os.path import isfile, join, exists, abspath from sys import version_info from itertools import chain +from traceback import print_exc try: from ast import literal_eval @@ -292,13 +287,15 @@ class PluginManager(): try: module = __import__(value["path"], globals(), locals(), [value["name"]] , -1) + pluginClass = getattr(module, name) except Exception, e: self.log.error(_("Error importing %(name)s: %(msg)s") % {"name": name, "msg": str(e) }) self.log.error(_("You should fix dependicies or deactivate load on startup.")) + if self.core.debug: + print_exc() + continue - - pluginClass = getattr(module, name) - + value["class"] = pluginClass classes.append(pluginClass) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 3c1124709..b2cab30de 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -48,8 +48,9 @@ class DepositfilesCom(Hoster): wait_time = int(wait.group(1)) self.log.info( "%s: Traffic used up. Waiting %d seconds." % (self.__name__, wait_time) ) self.setWait(wait_time) - if wait_time > 300: - self.wantReconnect = True + self.wantReconnect = True + self.wait() + self.retry() wait = re.search(r'>Try in (\d+) minutes or use GOLD account', self.html) if wait: diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 2e1bb1a59..9e14bfe7d 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -38,7 +38,7 @@ def getInfo(urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __pattern__ = r"http://(www\.)?fileserve\.com/file/.*?(/.*)?" + __pattern__ = r"http://(www\.)?fileserve\.com/file/[a-zA-Z0-9]+" __version__ = "0.3" __description__ = """Fileserve.Com File Download Hoster""" __author_name__ = ("jeix", "mkaay") @@ -54,6 +54,8 @@ class FileserveCom(Hoster): else: self.multiDL = False + self.file_id = re.search(r"fileserve\.com/file/([a-zA-Z0-9]+)(http:.*)?", self.pyfile.url).group(1) + def process(self, pyfile): self.html = self.load(self.pyfile.url, ref=False, cookies=False if self.account else True, utf8=True) @@ -76,7 +78,26 @@ class FileserveCom(Hoster): self.download(self.pyfile.url, post={"download":"premium"}, cookies=True) def handleFree(self): - + + self.html = self.load(self.pyfile.url) + jsPage = re.search(r"\"(/landing/.*?/download_captcha\.js)\"", self.html) + self.req.putHeader("X-Requested-With", "XMLHttpRequest") + + jsPage = self.load("http://fileserve.com" + jsPage.group(1)) + action = self.load(self.pyfile.url, post={"checkDownload" : "check"}) + + if "timeLimit" in action: + html = self.load(self.pyfile.url, post={"checkDownload" : "showError", "errorType" : "timeLimit"}) + wait = re.search(r"You need to wait (\d+) seconds to start another download", html) + if wait: + wait = int(wait.group(1)) + else: + wait = 720 + + self.setWait(wait, True) + self.wait() + self.retry() + if r'