diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-22 20:50:34 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-22 21:20:06 +0200 |
commit | aaaf5a4cddec894aacd7400c59a9f2f5e710362f (patch) | |
tree | 9d9e89aff86598b3ffcc86117abd554b193e28b5 /pyload/plugins/hoster/RealdebridCom.py | |
parent | implemented media type filter (diff) | |
download | pyload-aaaf5a4cddec894aacd7400c59a9f2f5e710362f.tar.xz |
Fixed PEP 8 violations in Hosters
(cherry picked from commit 2edeee0532ec6d6b4b26fd045a5971f67ca455da)
Conflicts:
pyload/plugins/hoster/BasePlugin.py
pyload/plugins/hoster/MultishareCz.py
pyload/plugins/hoster/NetloadIn.py
pyload/plugins/hoster/PremiumizeMe.py
pyload/plugins/hoster/RapidshareCom.py
Diffstat (limited to 'pyload/plugins/hoster/RealdebridCom.py')
-rw-r--r-- | pyload/plugins/hoster/RealdebridCom.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/pyload/plugins/hoster/RealdebridCom.py b/pyload/plugins/hoster/RealdebridCom.py index 73baff5b3..fd91b89b7 100644 --- a/pyload/plugins/hoster/RealdebridCom.py +++ b/pyload/plugins/hoster/RealdebridCom.py @@ -6,10 +6,11 @@ from time import time from urllib import quote, unquote from random import randrange -from module.utils import parseFileSize, remove_chars +from module.utils import parseFileSize from module.common.json_layer import json_loads from module.plugins.Hoster import Hoster + class RealdebridCom(Hoster): __name__ = "RealdebridCom" __version__ = "0.51" @@ -25,8 +26,8 @@ class RealdebridCom(Hoster): name = unquote(url.rsplit("/", 1)[1]) except IndexError: name = "Unknown_Filename..." - if not name or name.endswith(".."): #incomplete filename, append random stuff - name += "%s.tmp" % randrange(100,999) + if not name or name.endswith(".."): # incomplete filename, append random stuff + name += "%s.tmp" % randrange(100, 999) return name def init(self): @@ -34,7 +35,6 @@ class RealdebridCom(Hoster): self.chunkLimit = 3 self.resumeDownload = True - def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") @@ -45,10 +45,13 @@ class RealdebridCom(Hoster): new_url = pyfile.url else: password = self.getPassword().splitlines() - if not password: password = "" - else: password = password[0] + if not password: + password = "" + else: + password = password[0] - url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % (quote(pyfile.url, ""), password, int(time()*1000)) + url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % ( + quote(pyfile.url, ""), password, int(time() * 1000)) page = self.load(url) data = json_loads(page) @@ -80,9 +83,8 @@ class RealdebridCom(Hoster): self.download(new_url, disposition=True) check = self.checkDownload( - {"error": "<title>An error occured while processing your request</title>"}) + {"error": "<title>An error occured while processing your request</title>"}) if check == "error": #usual this download can safely be retried self.retry(reason="An error occured while generating link.", wait_time=60) - |