From 01e76034bcad5e5aab7f6e141782071e5c328649 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 6 Jul 2014 19:08:06 +0200 Subject: Fix account checkLogin + related code cosmetics --- module/plugins/hoster/NetloadIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/NetloadIn.py') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 4b8842d18..a011d87b4 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -176,9 +176,9 @@ class NetloadIn(Hoster): return True if ">An access request has been made from IP address <" in page: wait = self.get_wait_time(page) - if wait == 0: + if not wait: self.logDebug("Netload: Wait was 0 setting 30") - wait = 30 + wait = 30 * 60 self.logInfo(_("Netload: waiting between downloads %d s." % wait)) self.wantReconnect = True self.setWait(wait) -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/NetloadIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/NetloadIn.py') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index a011d87b4..043de5463 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -24,7 +24,7 @@ def getInfo(urls): api = getURL(apiurl + ids, decode=True) - if api is None or len(api) < 10: + if not api or len(api) < 10: print "Netload prefetch: failed " return if api.find("unknown_auth") >= 0: -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/NetloadIn.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster/NetloadIn.py') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 043de5463..5431ebb9a 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -69,8 +69,8 @@ class NetloadIn(Hoster): def prepare(self): self.download_api_data() - if self.api_data and self.api_data["filename"]: - self.pyfile.name = self.api_data["filename"] + if self.api_data and self.api_data['filename']: + self.pyfile.name = self.api_data['filename'] if self.premium: self.logDebug("Netload: Use Premium Account") @@ -113,13 +113,13 @@ class NetloadIn(Hoster): self.api_data = {} if src and ";" in src and src not in ("unknown file_data", "unknown_server_data", "No input file specified."): lines = src.split(";") - self.api_data["exists"] = True - self.api_data["fileid"] = lines[0] - self.api_data["filename"] = lines[1] - self.api_data["size"] = lines[2] - self.api_data["status"] = lines[3] - if self.api_data["status"] == "online": - self.api_data["checksum"] = lines[4].strip() + self.api_data['exists'] = True + self.api_data['fileid'] = lines[0] + self.api_data['filename'] = lines[1] + self.api_data['size'] = lines[2] + self.api_data['status'] = lines[3] + if self.api_data['status'] == "online": + self.api_data['checksum'] = lines[4].strip() else: self.api_data = False # check manually since api data is useless sometimes -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/NetloadIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/NetloadIn.py') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 5431ebb9a..2baeed5da 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -24,7 +24,7 @@ def getInfo(urls): api = getURL(apiurl + ids, decode=True) - if not api or len(api) < 10: + if api is None or len(api) < 10: print "Netload prefetch: failed " return if api.find("unknown_auth") >= 0: -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/NetloadIn.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/NetloadIn.py') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 2baeed5da..a45aafa63 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- import re + from time import sleep, time -from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL +from module.plugins.Hoster import Hoster from module.plugins.Plugin import chunks @@ -51,12 +52,15 @@ def getInfo(urls): class NetloadIn(Hoster): __name__ = "NetloadIn" __type__ = "hoster" - __pattern__ = r'https?://(?:[^/]*\.)?netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)' __version__ = "0.45" + + __pattern__ = r'https?://(?:[^/]*\.)?netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)' + __description__ = """Netload.in hoster plugin""" __author_name__ = ("spoob", "RaNaN", "Gregy") __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz") + def setup(self): self.multiDL = self.resumeDownload = self.premium @@ -151,7 +155,7 @@ class NetloadIn(Hoster): self.offline() name = re.search(r'class="dl_first_filename">([^<]+)', page, re.MULTILINE) - # the found filename is not truncated + # the found filename is not truncated if name: name = name.group(1).strip() if not name.endswith(".."): -- cgit v1.2.3