diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-05-14 15:37:58 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-05-14 15:37:58 +0200 |
commit | 9973f09a616900ab0900974da77d22b566598b5f (patch) | |
tree | 0669cdda0a367e1b53b7286f19b6aaf1b9e4004a /module/plugins/hoster | |
parent | revert premium account change see #309 (diff) | |
download | pyload-9973f09a616900ab0900974da77d22b566598b5f.tar.xz |
improved some code style issues
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 13 | ||||
-rw-r--r-- | module/plugins/hoster/UploadStationCom.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/UploadingCom.py | 25 | ||||
-rw-r--r-- | module/plugins/hoster/Xdcc.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/YourfilesTo.py | 2 |
5 files changed, 21 insertions, 25 deletions
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 6dd8933c0..360f0d788 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -72,9 +72,8 @@ class ShareonlineBiz(Hoster): src = self.load(api_url_base, cookies=False, post=api_param_file) fields = src.split(";") - self.api_data = {} - self.api_data["fileid"] = fields[0] - self.api_data["status"] = fields[1] + self.api_data = {"fileid": fields[0], + "status": fields[1]} if not self.api_data["status"] == "OK": self.offline() self.api_data["filename"] = fields[2] @@ -88,7 +87,7 @@ class ShareonlineBiz(Hoster): self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free":"1", "choice": "free"}) if re.search(r"/failure/full/1", self.req.lastEffectiveURL): self.setWait(120) - self.log.info("%s: no free slots, waiting 120 seconds" % (self.__name__)) + self.log.info("%s: no free slots, waiting 120 seconds" % self.__name__) self.wait() self.retry() @@ -160,8 +159,8 @@ class ShareonlineBiz(Hoster): f.close() hexd = h.hexdigest() if hexd == self.api_data["checksum"]: - return (True, 0) + return True, 0 else: - return (False, 1) + return False, 1 else: - return (True, 5) + return True, 5 diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py index b45472747..32ab1972a 100644 --- a/module/plugins/hoster/UploadStationCom.py +++ b/module/plugins/hoster/UploadStationCom.py @@ -118,7 +118,7 @@ class UploadStationCom(Hoster): self.load(self.pyfile.url, post={"downloadLink" : "show"})
# This may either download our file or forward us to an error page
- self.log.debug("%s: Downloading file." % (self.__name__))
+ self.log.debug("%s: Downloading file." % self.__name__)
dl = self.download(self.pyfile.url, post={"download" : "normal"})
self.handleDownloadedFile()
@@ -145,7 +145,7 @@ class UploadStationCom(Hoster): def handleCaptchaErrors(self, response):
if UploadStationCom.CAPTCHA_WRONG_TOKEN in response:
- self.log.info("%s: Invalid captcha response, retrying." % (self.__name__))
+ self.log.info("%s: Invalid captcha response, retrying." % self.__name__)
self.invalidCaptcha()
self.retry()
else:
diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 1f3889f0e..3fb2d4ba2 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -68,10 +68,9 @@ class UploadingCom(Hoster): self.download(url)
def handlePremium(self):
- postData = {}
- postData['action'] = 'get_link'
- postData['code'] = re.search('code: "(.*?)",', self.html[0]).group(1)
- postData['pass'] = 'undefined'
+ postData = {'action': 'get_link',
+ 'code': re.search('code: "(.*?)",', self.html[0]).group(1),
+ 'pass': 'undefined'}
self.html[2] = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData)
url = re.search(r'"link"\s*:\s*"(.*?)"', self.html[2])
@@ -84,11 +83,10 @@ class UploadingCom(Hoster): self.code = re.search(r'name="code" value="(.*?)"', self.html[0]).group(1)
self.fileid = re.search(r'name="file_id" value="(.*?)"', self.html[0]).group(1)
- postData = {}
- postData['action'] = 'second_page'
- postData['code'] = self.code
- postData['file_id'] = self.fileid
-
+ postData = {'action': 'second_page',
+ 'code': self.code,
+ 'file_id': self.fileid}
+
self.html[1] = self.load(self.pyfile.url, post=postData)
wait_time = re.search(r'timead_counter">(\d+)<', self.html[1])
@@ -102,11 +100,10 @@ class UploadingCom(Hoster): self.wait()
- postData = {}
- postData['action'] = 'get_link'
- postData['code'] = self.code
- postData['pass'] = 'undefined'
-
+ postData = {'action': 'get_link',
+ 'code': self.code,
+ 'pass': 'undefined'}
+
if r'var captcha_src' in self.html[1]:
captcha_url = "http://uploading.com/general/captcha/download%s/?ts=%d" % (self.fileid, timestamp())
postData['captcha_code'] = self.decryptCaptcha(captcha_url)
diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 7c81ccbe0..849748249 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -156,7 +156,7 @@ class Xdcc(Hoster): line = line.rstrip()
first = line.split()
- if(first[0] == "PING"):
+ if first[0] == "PING":
sock.send("PONG %s\r\n" % first[1])
if first[0] == "ERROR":
diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 18f2d3edf..2c3656c95 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -57,7 +57,7 @@ class YourfilesTo(Hoster): """
url = re.search(r"var bla = '(.*?)';", self.html).group(1)
url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", ""))
- return url;
+ return url
def get_file_name(self):
if self.html is None:
|