From afa6e88d46d61de5523a5d00b657d4a7f742a5cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Jun 2015 07:34:41 +0200 Subject: [UploadedTo] Fixup (2) --- module/plugins/hoster/FileserveCom.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index f8cf652b9..534b6bf7e 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -39,21 +39,23 @@ class FileserveCom(Hoster): __description__ = """Fileserve.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("mkaay", "mkaay@mkaay.de"), - ("Paul King", None), - ("zoidberg", "zoidberg@mujmail.cz")] + __authors__ = [("jeix" , "jeix@hasnomail.de" ), + ("mkaay" , "mkaay@mkaay.de" ), + ("Paul King", None ), + ("zoidberg" , "zoidberg@mujmail.cz")] - URLS = ["http://www.fileserve.com/file/", "http://www.fileserve.com/link-checker.php", + URLS = ["http://www.fileserve.com/file/", + "http://www.fileserve.com/link-checker.php", "http://www.fileserve.com/checkReCaptcha.php"] + LINKCHECK_TR = r'\s*(http://www\.fileserve\.com/file/.*?)' LINKCHECK_TD = r'(?:<.*?>| )*([^<]*)' - CAPTCHA_KEY_PATTERN = r'var reCAPTCHA_publickey=\'(.+?)\'' - LONG_WAIT_PATTERN = r'
  • You need to wait (\d+) (\w+) to start another download\.
  • ' - LINK_EXPIRED_PATTERN = r'Your download link has expired' - DAILY_LIMIT_PATTERN = r'Your daily download limit has been reached' + CAPTCHA_KEY_PATTERN = r'var reCAPTCHA_publickey=\'(.+?)\'' + LONG_WAIT_PATTERN = r'
  • You need to wait (\d+) (\w+) to start another download\.
  • ' + LINK_EXPIRED_PATTERN = r'Your download link has expired' + DL_LIMIT_PATTERN = r'Your daily download limit has been reached' NOT_LOGGED_IN_PATTERN = r'
    Login' @@ -119,7 +121,7 @@ class FileserveCom(Hoster): check = self.checkDownload({"expired": self.LINK_EXPIRED_PATTERN, "wait" : re.compile(self.LONG_WAIT_PATTERN), - "limit" : self.DAILY_LIMIT_PATTERN}) + "limit" : self.DL_LIMIT_PATTERN}) if check == "expired": self.logDebug("Download link was expired") -- cgit v1.2.3 From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/hoster/FileserveCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 534b6bf7e..6ea1d6541 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -4,8 +4,8 @@ import re from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster -from module.plugins.Plugin import chunks +from module.plugins.internal.Hoster import Hoster +from module.plugins.internal.Plugin import chunks from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import secondsToMidnight from module.utils import parseFileSize @@ -33,7 +33,7 @@ def checkFile(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.55" + __version__ = "0.56" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/hoster/FileserveCom.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 6ea1d6541..3f4c7d6ed 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -12,7 +12,7 @@ from module.utils import parseFileSize def checkFile(plugin, urls): - html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}, decode=True) + html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}) file_info = [] for li in re.finditer(plugin.LINKCHECK_TR, html, re.S): @@ -81,14 +81,13 @@ class FileserveCom(Hoster): def handleFree(self): self.html = self.load(self.url) - action = self.load(self.url, post={"checkDownload": "check"}, decode=True) + action = self.load(self.url, post={"checkDownload": "check"}) action = json_loads(action) self.logDebug(action) if "fail" in action: if action['fail'] == "timeLimit": - self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"}, - decode=True) + self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"}) self.doLongWait(re.search(self.LONG_WAIT_PATTERN, self.html)) @@ -110,7 +109,7 @@ class FileserveCom(Hoster): self.error(_("Unknown server response")) # show download link - res = self.load(self.url, post={"downloadLink": "show"}, decode=True) + res = self.load(self.url, post={"downloadLink": "show"}) self.logDebug("Show downloadLink response: %s" % res) if "fail" in res: self.error(_("Couldn't retrieve download url")) @@ -140,7 +139,7 @@ class FileserveCom(Hoster): def doTimmer(self): - res = self.load(self.url, post={"downloadLink": "wait"}, decode=True) + res = self.load(self.url, post={"downloadLink": "wait"}) self.logDebug("Wait response: %s" % res[:80]) if "fail" in res: @@ -191,8 +190,7 @@ class FileserveCom(Hoster): res = self.load("http://app.fileserve.com/api/download/premium/", post={"username": self.user, "password": self.account.getAccountData(self.user)['password'], - "shorten": self.file_id}, - decode=True) + "shorten": self.file_id}) if res: res = json_loads(res) if res['error_code'] == "302": -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/hoster/FileserveCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 3f4c7d6ed..71cdb1fae 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -108,13 +108,13 @@ class FileserveCom(Hoster): else: self.error(_("Unknown server response")) - # show download link + #: show download link res = self.load(self.url, post={"downloadLink": "show"}) self.logDebug("Show downloadLink response: %s" % res) if "fail" in res: self.error(_("Couldn't retrieve download url")) - # this may either download our file or forward us to an error page + #: this may either download our file or forward us to an error page self.download(self.url, post={"download": "normal"}) self.logDebug(self.req.http.lastEffectiveURL) @@ -135,7 +135,7 @@ class FileserveCom(Hoster): self.wait() self.retry() - self.thread.m.reconnecting.wait(3) # Ease issue with later downloads appearing to be in parallel + self.thread.m.reconnecting.wait(3) #: Ease issue with later downloads appearing to be in parallel def doTimmer(self): -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hoster/FileserveCom.py | 74 +++++++++++++++++------------------ 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 71cdb1fae..8ba963588 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -7,11 +7,11 @@ from module.network.RequestFactory import getURL from module.plugins.internal.Hoster import Hoster from module.plugins.internal.Plugin import chunks from module.plugins.internal.ReCaptcha import ReCaptcha -from module.plugins.internal.SimpleHoster import secondsToMidnight +from module.plugins.internal.SimpleHoster import seconds_to_midnight from module.utils import parseFileSize -def checkFile(plugin, urls): +def check_file(plugin, urls): html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}) file_info = [] @@ -33,7 +33,7 @@ def checkFile(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.56" + __version__ = "0.57" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' @@ -60,39 +60,39 @@ class FileserveCom(Hoster): def setup(self): - self.resumeDownload = self.multiDL = self.premium + self.resume_download = self.multi_dl = self.premium self.file_id = re.match(self.__pattern__, self.pyfile.url).group('ID') self.url = "%s%s" % (self.URLS[0], self.file_id) - self.logDebug("File ID: %s URL: %s" % (self.file_id, self.url)) + self.log_debug("File ID: %s URL: %s" % (self.file_id, self.url)) def process(self, pyfile): pyfile.name, pyfile.size, status, self.url = checkFile(self, [self.url])[0] if status != 2: self.offline() - self.logDebug("File Name: %s Size: %d" % (pyfile.name, pyfile.size)) + self.log_debug("File Name: %s Size: %d" % (pyfile.name, pyfile.size)) if self.premium: - self.handlePremium() + self.handle_premium() else: - self.handleFree() + self.handle_free() - def handleFree(self): + def handle_free(self): self.html = self.load(self.url) action = self.load(self.url, post={"checkDownload": "check"}) action = json_loads(action) - self.logDebug(action) + self.log_debug(action) if "fail" in action: if action['fail'] == "timeLimit": self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"}) - self.doLongWait(re.search(self.LONG_WAIT_PATTERN, self.html)) + self.do_long_wait(re.search(self.LONG_WAIT_PATTERN, self.html)) elif action['fail'] == "parallelDownload": - self.logWarning(_("Parallel download error, now waiting 60s")) + self.log_warning(_("Parallel download error, now waiting 60s")) self.retry(wait_time=60, reason=_("parallelDownload")) else: @@ -100,47 +100,47 @@ class FileserveCom(Hoster): elif "success" in action: if action['success'] == "showCaptcha": - self.doCaptcha() - self.doTimmer() + self.do_captcha() + self.do_timmer() elif action['success'] == "showTimmer": - self.doTimmer() + self.do_timmer() else: self.error(_("Unknown server response")) #: show download link res = self.load(self.url, post={"downloadLink": "show"}) - self.logDebug("Show downloadLink response: %s" % res) + self.log_debug("Show downloadLink response: %s" % res) if "fail" in res: self.error(_("Couldn't retrieve download url")) #: this may either download our file or forward us to an error page self.download(self.url, post={"download": "normal"}) - self.logDebug(self.req.http.lastEffectiveURL) + self.log_debug(self.req.http.lastEffectiveURL) - check = self.checkDownload({"expired": self.LINK_EXPIRED_PATTERN, + check = self.check_download({"expired": self.LINK_EXPIRED_PATTERN, "wait" : re.compile(self.LONG_WAIT_PATTERN), "limit" : self.DL_LIMIT_PATTERN}) if check == "expired": - self.logDebug("Download link was expired") + self.log_debug("Download link was expired") self.retry() elif check == "wait": - self.doLongWait(self.lastCheck) + self.do_long_wait(self.last_check) elif check == "limit": - self.logWarning(_("Download limited reached for today")) - self.setWait(secondsToMidnight(gmt=2), True) + self.log_warning(_("Download limited reached for today")) + self.set_wait(seconds_to_midnight(gmt=2), True) self.wait() self.retry() self.thread.m.reconnecting.wait(3) #: Ease issue with later downloads appearing to be in parallel - def doTimmer(self): + def do_timmer(self): res = self.load(self.url, post={"downloadLink": "wait"}) - self.logDebug("Wait response: %s" % res[:80]) + self.log_debug("Wait response: %s" % res[:80]) if "fail" in res: self.fail(_("Failed getting wait time")) @@ -153,11 +153,11 @@ class FileserveCom(Hoster): else: wait_time = int(res) + 3 - self.setWait(wait_time) + self.set_wait(wait_time) self.wait() - def doCaptcha(self): + def do_captcha(self): captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1) recaptcha = ReCaptcha(self) @@ -168,25 +168,25 @@ class FileserveCom(Hoster): 'recaptcha_response_field' : response, 'recaptcha_shortencode_field': self.file_id})) if not res['success']: - self.invalidCaptcha() + self.invalid_captcha() else: - self.correctCaptcha() + self.correct_captcha() break else: self.fail(_("Invalid captcha")) - def doLongWait(self, m): + def do_long_wait(self, m): wait_time = (int(m.group(1)) * {'seconds': 1, 'minutes': 60, 'hours': 3600}[m.group(2)]) if m else 12 * 60 - self.setWait(wait_time, True) + self.set_wait(wait_time, True) self.wait() self.retry() - def handlePremium(self): + def handle_premium(self): premium_url = None if self.__name__ == "FileserveCom": - #try api download + # try api download res = self.load("http://app.fileserve.com/api/download/premium/", post={"username": self.user, "password": self.account.getAccountData(self.user)['password'], @@ -196,21 +196,21 @@ class FileserveCom(Hoster): if res['error_code'] == "302": premium_url = res['next'] elif res['error_code'] in ["305", "500"]: - self.tempOffline() + self.temp_offline() elif res['error_code'] in ["403", "605"]: - self.resetAccount() + self.reset_account() elif res['error_code'] in ["606", "607", "608"]: self.offline() else: - self.logError(res['error_code'], res['error_message']) + self.log_error(res['error_code'], res['error_message']) self.download(premium_url or self.pyfile.url) - if not premium_url and self.checkDownload({"login": re.compile(self.NOT_LOGGED_IN_PATTERN)}): + if not premium_url and self.check_download({"login": re.compile(self.NOT_LOGGED_IN_PATTERN)}): self.account.relogin(self.user) self.retry(reason=_("Not logged in")) -def getInfo(urls): +def get_info(urls): for chunk in chunks(urls, 100): yield checkFile(FileserveCom, chunk) -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/hoster/FileserveCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 8ba963588..5a792a425 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -189,7 +189,7 @@ class FileserveCom(Hoster): # try api download res = self.load("http://app.fileserve.com/api/download/premium/", post={"username": self.user, - "password": self.account.getAccountData(self.user)['password'], + "password": self.account.get_account_data(self.user)['password'], "shorten": self.file_id}) if res: res = json_loads(res) -- cgit v1.2.3 From 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Jul 2015 20:04:36 +0200 Subject: Code cosmetics --- module/plugins/hoster/FileserveCom.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 5a792a425..f38de699e 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -3,16 +3,16 @@ import re from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.Hoster import Hoster from module.plugins.internal.Plugin import chunks from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import seconds_to_midnight -from module.utils import parseFileSize +from module.utils import parseFileSize as parse_size def check_file(plugin, urls): - html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}) + html = get_url(plugin.URLS[1], post={"urls": "\n".join(urls)}) file_info = [] for li in re.finditer(plugin.LINKCHECK_TR, html, re.S): @@ -21,7 +21,7 @@ def check_file(plugin, urls): if cols: file_info.append(( cols[1] if cols[1] != '--' else cols[0], - parseFileSize(cols[2]) if cols[2] != '--' else 0, + parse_size(cols[2]) if cols[2] != '--' else 0, 2 if cols[3].startswith('Available') else 1, cols[0])) except Exception, e: @@ -131,8 +131,7 @@ class FileserveCom(Hoster): elif check == "limit": self.log_warning(_("Download limited reached for today")) - self.set_wait(seconds_to_midnight(gmt=2), True) - self.wait() + self.wait(seconds_to_midnight(gmt=2), True) self.retry() self.thread.m.reconnecting.wait(3) #: Ease issue with later downloads appearing to be in parallel @@ -153,8 +152,7 @@ class FileserveCom(Hoster): else: wait_time = int(res) + 3 - self.set_wait(wait_time) - self.wait() + self.wait(wait_time) def do_captcha(self): @@ -178,8 +176,7 @@ class FileserveCom(Hoster): def do_long_wait(self, m): wait_time = (int(m.group(1)) * {'seconds': 1, 'minutes': 60, 'hours': 3600}[m.group(2)]) if m else 12 * 60 - self.set_wait(wait_time, True) - self.wait() + self.wait(wait_time, True) self.retry() -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/hoster/FileserveCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index f38de699e..fd50bd265 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -108,13 +108,13 @@ class FileserveCom(Hoster): else: self.error(_("Unknown server response")) - #: show download link + #: Show download link res = self.load(self.url, post={"downloadLink": "show"}) self.log_debug("Show downloadLink response: %s" % res) if "fail" in res: self.error(_("Couldn't retrieve download url")) - #: this may either download our file or forward us to an error page + #: This may either download our file or forward us to an error page self.download(self.url, post={"download": "normal"}) self.log_debug(self.req.http.lastEffectiveURL) @@ -183,7 +183,7 @@ class FileserveCom(Hoster): def handle_premium(self): premium_url = None if self.__name__ == "FileserveCom": - # try api download + #: Try api download res = self.load("http://app.fileserve.com/api/download/premium/", post={"username": self.user, "password": self.account.get_account_data(self.user)['password'], -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/hoster/FileserveCom.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index fd50bd265..0b6b693b1 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -12,7 +12,7 @@ from module.utils import parseFileSize as parse_size def check_file(plugin, urls): - html = get_url(plugin.URLS[1], post={"urls": "\n".join(urls)}) + html = get_url(plugin.URLS[1], post={'urls': "\n".join(urls)}) file_info = [] for li in re.finditer(plugin.LINKCHECK_TR, html, re.S): @@ -81,13 +81,13 @@ class FileserveCom(Hoster): def handle_free(self): self.html = self.load(self.url) - action = self.load(self.url, post={"checkDownload": "check"}) + action = self.load(self.url, post={'checkDownload': "check"}) action = json_loads(action) self.log_debug(action) if "fail" in action: if action['fail'] == "timeLimit": - self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"}) + self.html = self.load(self.url, post={'checkDownload': "showError", 'errorType': "timeLimit"}) self.do_long_wait(re.search(self.LONG_WAIT_PATTERN, self.html)) @@ -109,18 +109,18 @@ class FileserveCom(Hoster): self.error(_("Unknown server response")) #: Show download link - res = self.load(self.url, post={"downloadLink": "show"}) + res = self.load(self.url, post={'downloadLink': "show"}) self.log_debug("Show downloadLink response: %s" % res) if "fail" in res: self.error(_("Couldn't retrieve download url")) #: This may either download our file or forward us to an error page - self.download(self.url, post={"download": "normal"}) + self.download(self.url, post={'download': "normal"}) self.log_debug(self.req.http.lastEffectiveURL) - check = self.check_download({"expired": self.LINK_EXPIRED_PATTERN, - "wait" : re.compile(self.LONG_WAIT_PATTERN), - "limit" : self.DL_LIMIT_PATTERN}) + check = self.check_download({'expired': self.LINK_EXPIRED_PATTERN, + 'wait' : re.compile(self.LONG_WAIT_PATTERN), + 'limit' : self.DL_LIMIT_PATTERN}) if check == "expired": self.log_debug("Download link was expired") @@ -138,7 +138,7 @@ class FileserveCom(Hoster): def do_timmer(self): - res = self.load(self.url, post={"downloadLink": "wait"}) + res = self.load(self.url, post={'downloadLink': "wait"}) self.log_debug("Wait response: %s" % res[:80]) if "fail" in res: @@ -185,9 +185,9 @@ class FileserveCom(Hoster): if self.__name__ == "FileserveCom": #: Try api download res = self.load("http://app.fileserve.com/api/download/premium/", - post={"username": self.user, - "password": self.account.get_account_data(self.user)['password'], - "shorten": self.file_id}) + post={'username': self.user, + 'password': self.account.get_account_data(self.user)['password'], + 'shorten': self.file_id}) if res: res = json_loads(res) if res['error_code'] == "302": @@ -203,7 +203,7 @@ class FileserveCom(Hoster): self.download(premium_url or self.pyfile.url) - if not premium_url and self.check_download({"login": re.compile(self.NOT_LOGGED_IN_PATTERN)}): + if not premium_url and self.check_download({'login': re.compile(self.NOT_LOGGED_IN_PATTERN)}): self.account.relogin(self.user) self.retry(reason=_("Not logged in")) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hoster/FileserveCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 0b6b693b1..6f796ca69 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -34,6 +34,7 @@ class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" __version__ = "0.57" + __status__ = "stable" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' -- cgit v1.2.3 From 027cb529d79558de19c47da88a782b31745a65c9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 21 Jul 2015 22:53:37 +0200 Subject: New Captcha skeleton --- module/plugins/hoster/FileserveCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 6f796ca69..117ee1f4c 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -167,9 +167,9 @@ class FileserveCom(Hoster): 'recaptcha_response_field' : response, 'recaptcha_shortencode_field': self.file_id})) if not res['success']: - self.invalid_captcha() + self.captcha.invalid() else: - self.correct_captcha() + self.captcha.correct() break else: self.fail(_("Invalid captcha")) -- cgit v1.2.3 From 6af9b38a8d5d49355b85aef6ddd003605d6bba05 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Jul 2015 23:44:45 +0200 Subject: Improve Captcha --- module/plugins/hoster/FileserveCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 117ee1f4c..60df758f5 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -6,7 +6,7 @@ from module.common.json_layer import json_loads from module.network.RequestFactory import getURL as get_url from module.plugins.internal.Hoster import Hoster from module.plugins.internal.Plugin import chunks -from module.plugins.internal.ReCaptcha import ReCaptcha +from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import seconds_to_midnight from module.utils import parseFileSize as parse_size -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hoster/FileserveCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 60df758f5..13680dec0 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -34,7 +34,7 @@ class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" __version__ = "0.57" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' @@ -61,7 +61,7 @@ class FileserveCom(Hoster): def setup(self): - self.resume_download = self.multi_dl = self.premium + self.resume_download = self.multiDL = self.premium self.file_id = re.match(self.__pattern__, self.pyfile.url).group('ID') self.url = "%s%s" % (self.URLS[0], self.file_id) -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/hoster/FileserveCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 13680dec0..6cc42cb4b 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -187,7 +187,7 @@ class FileserveCom(Hoster): #: Try api download res = self.load("http://app.fileserve.com/api/download/premium/", post={'username': self.user, - 'password': self.account.get_account_data(self.user)['password'], + 'password': self.account.get_data(self.user)['password'], 'shorten': self.file_id}) if res: res = json_loads(res) -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/hoster/FileserveCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 6cc42cb4b..ba6e253b0 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -187,7 +187,7 @@ class FileserveCom(Hoster): #: Try api download res = self.load("http://app.fileserve.com/api/download/premium/", post={'username': self.user, - 'password': self.account.get_data(self.user)['password'], + 'password': self.account.get_info(self.user)['login']['password'], 'shorten': self.file_id}) if res: res = json_loads(res) -- cgit v1.2.3 From 5ceb174cb7eb6a3cf706a1ed861ddd778069d7b6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 10:29:06 +0200 Subject: Then update others --- module/plugins/hoster/FileserveCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index ba6e253b0..21b5897ab 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -69,7 +69,7 @@ class FileserveCom(Hoster): def process(self, pyfile): - pyfile.name, pyfile.size, status, self.url = checkFile(self, [self.url])[0] + pyfile.name, pyfile.size, status, self.url = check_file(self, [self.url])[0] if status != 2: self.offline() self.log_debug("File Name: %s Size: %d" % (pyfile.name, pyfile.size)) @@ -196,7 +196,7 @@ class FileserveCom(Hoster): elif res['error_code'] in ["305", "500"]: self.temp_offline() elif res['error_code'] in ["403", "605"]: - self.reset_account() + self.restart(reset=True) elif res['error_code'] in ["606", "607", "608"]: self.offline() else: @@ -211,4 +211,4 @@ class FileserveCom(Hoster): def get_info(urls): for chunk in chunks(urls, 100): - yield checkFile(FileserveCom, chunk) + yield check_file(FileserveCom, chunk) -- cgit v1.2.3 From 21cf50c60a794b5ca7d54408b590f74d4567ca79 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 07:15:28 +0200 Subject: Update some plugins --- module/plugins/hoster/FileserveCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 21b5897ab..a74589cff 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -33,7 +33,7 @@ def check_file(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.57" + __version__ = "0.58" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' @@ -196,7 +196,7 @@ class FileserveCom(Hoster): elif res['error_code'] in ["305", "500"]: self.temp_offline() elif res['error_code'] in ["403", "605"]: - self.restart(reset=True) + self.restart(nopremium=True) elif res['error_code'] in ["606", "607", "608"]: self.offline() else: -- cgit v1.2.3