diff options
| author | 2011-06-27 19:41:03 +0200 | |
|---|---|---|
| committer | 2011-06-27 19:41:03 +0200 | |
| commit | cf8fea4179a673ffe2ec50de3a5d948a61f849aa (patch) | |
| tree | a24f3be129904f22836b8caa7fdca33cf0d7547a /module | |
| parent | DepositFiles lang fix (diff) | |
| download | pyload-cf8fea4179a673ffe2ec50de3a5d948a61f849aa.tar.xz | |
Shareonline, zshare fix, testing __slots__ attribute
Diffstat (limited to 'module')
| -rw-r--r-- | module/PyFile.py | 5 | ||||
| -rw-r--r-- | module/network/Browser.py | 3 | ||||
| -rw-r--r-- | module/plugins/Plugin.py | 2 | ||||
| -rw-r--r-- | module/plugins/hooks/CaptchaTrader.py | 3 | ||||
| -rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 6 | ||||
| -rw-r--r-- | module/plugins/hoster/ZShareNet.py | 8 | 
6 files changed, 19 insertions, 8 deletions
| diff --git a/module/PyFile.py b/module/PyFile.py index 776039ef8..6ab8318fc 100644 --- a/module/PyFile.py +++ b/module/PyFile.py @@ -48,6 +48,11 @@ def setSize(self, value):      self._size = int(value)  class PyFile(object): + +    __slots__ = ("m", "id", "url", "name", "size", "_size", "status", "pluginname", "packageid", +                 "error", "order", "lock", "plugin", "waitUntil", "active", "abort", +                 "reconnected", "progress", "pluginmodule", "pluginclass") +      def __init__(self, manager, id, url, name, size, status, error, pluginname, package, order):          self.m = manager diff --git a/module/network/Browser.py b/module/network/Browser.py index 2dc9c3d83..8bcedb773 100644 --- a/module/network/Browser.py +++ b/module/network/Browser.py @@ -8,6 +8,9 @@ from HTTPDownload import HTTPDownload  class Browser(object): + +    __slots__ = ("log", "options", "bucket", "cj", "_size", "http", "dl") +      def __init__(self, bucket=None, options={}):          self.log = getLogger("log") diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 68fb6f8be..9caf4d81a 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -244,7 +244,7 @@ class Plugin(object):          :param wait_time: time to wait in seconds          :param reason: reason for retrying, will be passed to fail if max_tries reached          """ -        if self.retries >= max_tries: +        if max_tries and self.retries >= max_tries:              if not reason: reason = "Max retries reached"              raise Fail(reason) diff --git a/module/plugins/hooks/CaptchaTrader.py b/module/plugins/hooks/CaptchaTrader.py index 00f517751..af6626897 100644 --- a/module/plugins/hooks/CaptchaTrader.py +++ b/module/plugins/hooks/CaptchaTrader.py @@ -76,6 +76,7 @@ class CaptchaTrader(Hook):          #if type(captcha) == str and captchaType == "file":          #    raise CaptchaTraderException("Invalid Type")          assert captchaType in ("file", "url-jpg", "url-jpeg", "url-png", "url-bmp") +        #todo more timeout          json = getURL(CaptchaTrader.SUBMIT_URL, post={"api_key": PYLOAD_KEY,                                                             "username": self.getConfig("username"),                                                             "password": self.getConfig("passkey"), @@ -112,7 +113,7 @@ class CaptchaTrader(Hook):          if self.getCredits() > 10:              task.handler.append(self) -            task.setWaiting(40) +            task.setWaiting(100)              start_new_thread(self.processCaptcha, (task,))          else: diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 360f0d788..03f24a2c9 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -38,7 +38,7 @@ class ShareonlineBiz(Hoster):      __name__ = "ShareonlineBiz"      __type__ = "hoster"      __pattern__ = r"http://[\w\.]*?(share\-online\.biz|egoshare\.com)/(download.php\?id\=|dl/)[\w]+" -    __version__ = "0.2" +    __version__ = "0.21"      __description__ = """Shareonline.biz Download Hoster"""      __author_name__ = ("spoob", "mkaay")      __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de") @@ -89,7 +89,7 @@ class ShareonlineBiz(Hoster):              self.setWait(120)              self.log.info("%s: no free slots, waiting 120 seconds" % self.__name__)              self.wait() -            self.retry() +            self.retry(max_tries=60)          if "Captcha number error or expired" in self.html:              captcha = self.decryptCaptcha("http://www.share-online.biz/captcha.php", get={"rand":"0.%s" % random.randint(10**15,10**16)}) @@ -149,7 +149,7 @@ class ShareonlineBiz(Hoster):          except:              self.fail("Session issue") -        self.download(download_url, cookies=True) +        self.download(download_url)      def checksum(self, local_file):          if self.api_data and self.api_data["checksum"]: diff --git a/module/plugins/hoster/ZShareNet.py b/module/plugins/hoster/ZShareNet.py index d3453ee5e..6ef456d97 100644 --- a/module/plugins/hoster/ZShareNet.py +++ b/module/plugins/hoster/ZShareNet.py @@ -11,9 +11,9 @@ class ZShareNet(Hoster):      __name__ = "ZShareNet"      __type__ = "hoster"      __pattern__ = r"http://[\w\.]*?zshare\.net/(download|video|image|audio|flash)/.*" -    __version__ = "0.1" +    __version__ = "0.2"      __description__ = """ZShareNet Download Hoster""" -    __author_name__ = ("espes") +    __author_name__ = ("espes","Cptn Sandwich")      def setup(self):          self.multiDL = False @@ -22,6 +22,8 @@ class ZShareNet(Hoster):      def process(self, pyfile):          self.pyfile = pyfile +        self.pyfile.url = re.sub("(video|image|audio|flash)","download",self.pyfile.url)  +                  self.html = self.load(pyfile.url)          if "File Not Found" in self.html:              self.offline() @@ -65,4 +67,4 @@ class ZShareNet(Hoster):          if check == "unav":              self.fail("Plugin defect")          elif check == "404": -            self.offline()
\ No newline at end of file +            self.offline() | 
