From 2404538888ced4e6964df55823d0514b1c0ba685 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:03:27 +0200 Subject: rapideo.pl files added --- module/plugins/accounts/RapideoPl.py | 102 +++++++++++++++++++++++++++ module/plugins/hooks/RapideoPl.py | 38 ++++++++++ module/plugins/hoster/RapideoPl.py | 132 +++++++++++++++++++++++++++++++++++ 3 files changed, 272 insertions(+) create mode 100644 module/plugins/accounts/RapideoPl.py create mode 100644 module/plugins/hooks/RapideoPl.py create mode 100644 module/plugins/hoster/RapideoPl.py (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py new file mode 100644 index 000000000..f7343cf02 --- /dev/null +++ b/module/plugins/accounts/RapideoPl.py @@ -0,0 +1,102 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +@author: Pawel W. +""" + +from datetime import datetime + +from module.plugins.Account import Account +from module.plugins.internal.SimpleHoster import parseHtmlForm +import re +from time import mktime, strptime +import module.lib.beaker.crypto as crypto + +try: + from json import loads +except ImportError: + from simplejson import loads + +class RapideoPl(Account): + __name__ = "RapideoPl" + __version__ = "0.01" + __type__ = "account" + __description__ = "Rapideo.pl account plugin" + __author_name__ = ("goddie") + __author_mail__ = ("dev@rapideo.pl") + + _api_url = "http://enc.rapideo.pl" + + _api_query = { + "site": "newrd", + "username": "", + "password": "", + "output": "json", + "loc": "1", + "info": "1" + } + + _req = None + _usr = None + _pwd = None + + def loadAccountInfo(self, name, req): + + self._req = req + + try: + result = loads(self.runAuthQuery()) + except: + #todo: ret? + return + + premium = False + valid_untill = -1 + + is_premium = "expire" in result.keys() and result["expire"] is not None + + if is_premium: + + premium = True + valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + + traffic_left = result["balance"] + + return ({ + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) + + def login(self, user, data, req): + + self._usr = user + self._pwd = crypto.md5(data["password"]).hexdigest() + + self._req = req + + try: + response = loads(self.runAuthQuery()) + except: + self.wrongPassword() + + if "errno" in response.keys(): + self.wrongPassword() + + data['usr'] = user + data['pwd'] = crypto.md5(data['password']).hexdigest() + + def createAuthQuery(self): + + query = self._api_query + query["username"] = self._usr + query["password"] = self._pwd + + return query + + def runAuthQuery(self): + + data = self._req.load(self._api_url, post=self.createAuthQuery()) + + return data \ No newline at end of file diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py new file mode 100644 index 000000000..5d7673826 --- /dev/null +++ b/module/plugins/hooks/RapideoPl.py @@ -0,0 +1,38 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +@author: Pawel W. +""" +from module.plugins.internal.MultiHoster import MultiHoster +from module.network.RequestFactory import getURL + +try: + from json import loads +except ImportError: + from simplejson import loads + +class RapideoPl(MultiHoster): + __name__ = "RapideoPl" + __version__ = "0.01" + __type__ = "hook" + + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("hosterList", "str", "Hoster list (comma separated)", ""), + ("unloadFailing", "bool", "Try standard download if download fails", "False"), + ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] + + __description__ = "Rapideo.pl hook" + __author_name__ = ("goddie") + __author_mail__ = ("dev@rapideo.pl") + + def getHoster(self): + + hostings = loads(getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) + return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] + + def getHosterCached(self): + return self.getHoster() + + diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py new file mode 100644 index 000000000..4d497faa9 --- /dev/null +++ b/module/plugins/hoster/RapideoPl.py @@ -0,0 +1,132 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +@author: Pawel W. +""" + +try: + from json import loads, dumps +except ImportError: + from simplejson import loads + +from module.plugins.internal.SimpleHoster import SimpleHoster + + +class RapideoPl(SimpleHoster): + + __name__ = "RapideoPl" + __version__ = "0.01" + __type__ = "hoster" + + __description__ = "Rapideo.pl hoster plugin" + __author_name__ = ("goddie") + __author_mail__ = ("dev@rapideo.pl") + + _api_url = "http://enc.rapideo.pl" + + _api_query = {"site": "newrd", + "output": "json", + "username": "", + "password": "", + "url": ""} + + _usr = False + _pwd = False + + def setup(self): + + self.resumeDownload = True + self.multiDL = True + + def get_username_password(self): + + if not self.account: + + self.fail("[Rapideo.pl] Login to Rapideo.pl plugin or turn plugin off") + + else: + + self._usr = self.account.getAccountData(self.user).get('usr') + self._pwd = self.account.getAccountData(self.user).get('pwd') + + def runFileQuery(self, url, mode=None): + + query = self._api_query.copy() + + query["username"] = self._usr + query["password"] = self._pwd + + query["url"] = url + + if mode == "fileinfo": + query['check'] = 2 + query['loc'] = 1 + + self.logDebug(query) + + return self.load(self._api_url, post=query) + + def process(self, pyfile): + + self.get_username_password() + + try: + data = self.runFileQuery(pyfile.url, 'fileinfo') + except Exception as e: + self.logDebug(str(e)) + self.tempOffline() + + try: + parsed = loads(data) + except Exception as e: + self.logDebug(str(e)) + self.tempOffline() + + self.logDebug(parsed) + + if "errno" in parsed.keys(): + + if parsed["errno"] == 0: + self.fail("[Rapideo.pl] Invalid account credentials") + + elif parsed["errno"] == 80: + self.fail("[Rapideo.pl] Too much incorrect login attempts, account blocked for 24h") + + elif parsed["errno"] == 1: + self.fail("[Rapideo.pl] Not enough transfer - top up to download") + + elif parsed["errno"] == 9: + self.fail("[Rapideo.pl] Account expired") + + elif parsed["errno"] == 2: + self.fail("[Rapideo.pl] Invalid / dead link") + + elif parsed["errno"] == 3: + self.fail("[Rapideo.pl] Error connecting to host") + + elif parsed["errno"] == 15: + self.fail("[Rapideo.pl] Hosting no longer supported") + + else: + self.fail( + parsed["errstring"] + or "Unknown error (code: {})".format(parsed["errno"]) + ) + + if "sdownload" in parsed: + if parsed["sdownload"] == "1": + self.fail( + "Download from {} is possible only when using \ + Rapideo.pl directly. Update this plugin.".format(parsed["hosting"])) + + pyfile.name = parsed["filename"] + pyfile.size = parsed["filesize"] + + try: + result_dl = self.runFileQuery(pyfile.url, 'filedownload') + except Exception as e: + self.logDebug(str(e)) + self.tempOffline() + + self.download(result_dl, disposition=True) -- cgit v1.2.3 From fa0db462b06e2d6b64b3b07ed2d7d6c31de22448 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:10:53 +0200 Subject: to-do & small simplification in username and password saving --- module/plugins/accounts/RapideoPl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index f7343cf02..8abfa4989 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -48,7 +48,7 @@ class RapideoPl(Account): try: result = loads(self.runAuthQuery()) except: - #todo: ret? + #todo: return or let it be thrown? return premium = False @@ -84,8 +84,8 @@ class RapideoPl(Account): if "errno" in response.keys(): self.wrongPassword() - data['usr'] = user - data['pwd'] = crypto.md5(data['password']).hexdigest() + data['usr'] = self._usr + data['pwd'] = self._pwd def createAuthQuery(self): -- cgit v1.2.3 From ea1cbeda0006bbf427223686892c9e6f87cfbe94 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 21:36:14 +0200 Subject: remove redundant author information --- module/plugins/accounts/RapideoPl.py | 4 ---- module/plugins/hooks/RapideoPl.py | 3 --- module/plugins/hoster/RapideoPl.py | 4 ---- 3 files changed, 11 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 8abfa4989..679f7eab0 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,10 +1,6 @@ # !/usr/bin/env python # -*- coding: utf-8 -*- -""" -@author: Pawel W. -""" - from datetime import datetime from module.plugins.Account import Account diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index 5d7673826..e032b426d 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -1,9 +1,6 @@ # !/usr/bin/env python # -*- coding: utf-8 -*- -""" -@author: Pawel W. -""" from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index 4d497faa9..4f23bc4a9 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -1,10 +1,6 @@ # !/usr/bin/env python # -*- coding: utf-8 -*- -""" -@author: Pawel W. -""" - try: from json import loads, dumps except ImportError: -- cgit v1.2.3 From 2ed13d51ab8cd28f2f3db4caabde9b6d2e2cec25 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 11:55:23 +0200 Subject: remove enviroment line --- module/plugins/accounts/RapideoPl.py | 1 - module/plugins/hooks/RapideoPl.py | 1 - module/plugins/hoster/RapideoPl.py | 12 ------------ 3 files changed, 14 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 679f7eab0..0463bba69 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index e032b426d..fa3df9f84 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- from module.plugins.internal.MultiHoster import MultiHoster diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index 4f23bc4a9..b7deaa8ed 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- try: @@ -10,11 +9,9 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class RapideoPl(SimpleHoster): - __name__ = "RapideoPl" __version__ = "0.01" __type__ = "hoster" - __description__ = "Rapideo.pl hoster plugin" __author_name__ = ("goddie") __author_mail__ = ("dev@rapideo.pl") @@ -31,28 +28,20 @@ class RapideoPl(SimpleHoster): _pwd = False def setup(self): - self.resumeDownload = True self.multiDL = True def get_username_password(self): - if not self.account: - self.fail("[Rapideo.pl] Login to Rapideo.pl plugin or turn plugin off") - else: - self._usr = self.account.getAccountData(self.user).get('usr') self._pwd = self.account.getAccountData(self.user).get('pwd') def runFileQuery(self, url, mode=None): - query = self._api_query.copy() - query["username"] = self._usr query["password"] = self._pwd - query["url"] = url if mode == "fileinfo": @@ -60,7 +49,6 @@ class RapideoPl(SimpleHoster): query['loc'] = 1 self.logDebug(query) - return self.load(self._api_url, post=query) def process(self, pyfile): -- cgit v1.2.3 From 2e8ed2bf0b357e907f6921c7bb88719bb347367b Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:47:49 +0200 Subject: remove blank lines and unused imports --- module/plugins/accounts/RapideoPl.py | 26 +++++++------------------- module/plugins/hooks/RapideoPl.py | 3 ++- module/plugins/hoster/RapideoPl.py | 2 -- 3 files changed, 9 insertions(+), 22 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 0463bba69..853731f26 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -3,9 +3,7 @@ from datetime import datetime from module.plugins.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm -import re -from time import mktime, strptime +from time import mktime import module.lib.beaker.crypto as crypto try: @@ -13,6 +11,7 @@ try: except ImportError: from simplejson import loads + class RapideoPl(Account): __name__ = "RapideoPl" __version__ = "0.01" @@ -37,40 +36,32 @@ class RapideoPl(Account): _pwd = None def loadAccountInfo(self, name, req): - self._req = req - try: result = loads(self.runAuthQuery()) except: - #todo: return or let it be thrown? + # todo: return or let it be thrown? return premium = False valid_untill = -1 - is_premium = "expire" in result.keys() and result["expire"] is not None - if is_premium: - premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] return ({ - "validuntil": valid_untill, - "trafficleft": traffic_left, - "premium": premium - }) + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) def login(self, user, data, req): - self._usr = user self._pwd = crypto.md5(data["password"]).hexdigest() - self._req = req - try: response = loads(self.runAuthQuery()) except: @@ -78,12 +69,10 @@ class RapideoPl(Account): if "errno" in response.keys(): self.wrongPassword() - data['usr'] = self._usr data['pwd'] = self._pwd def createAuthQuery(self): - query = self._api_query query["username"] = self._usr query["password"] = self._pwd @@ -91,7 +80,6 @@ class RapideoPl(Account): return query def runAuthQuery(self): - data = self._req.load(self._api_url, post=self.createAuthQuery()) return data \ No newline at end of file diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index fa3df9f84..de1a80908 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -8,6 +8,7 @@ try: except ImportError: from simplejson import loads + class RapideoPl(MultiHoster): __name__ = "RapideoPl" __version__ = "0.01" @@ -24,8 +25,8 @@ class RapideoPl(MultiHoster): __author_mail__ = ("dev@rapideo.pl") def getHoster(self): - hostings = loads(getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) + return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] def getHosterCached(self): diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index b7deaa8ed..587b00bca 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -52,9 +52,7 @@ class RapideoPl(SimpleHoster): return self.load(self._api_url, post=query) def process(self, pyfile): - self.get_username_password() - try: data = self.runFileQuery(pyfile.url, 'fileinfo') except Exception as e: -- cgit v1.2.3 From 25d2cceff065a0268a7e183449ef54edf98f1783 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:49:12 +0200 Subject: simplify json loads, replace crypto with hashlib --- module/plugins/accounts/RapideoPl.py | 11 +++-------- module/plugins/hooks/RapideoPl.py | 7 +------ module/plugins/hoster/RapideoPl.py | 6 +----- 3 files changed, 5 insertions(+), 19 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 853731f26..6ace9ede0 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -1,16 +1,11 @@ # -*- coding: utf-8 -*- from datetime import datetime +import hashlib from module.plugins.Account import Account from time import mktime -import module.lib.beaker.crypto as crypto - -try: - from json import loads -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads class RapideoPl(Account): __name__ = "RapideoPl" @@ -60,7 +55,7 @@ class RapideoPl(Account): def login(self, user, data, req): self._usr = user - self._pwd = crypto.md5(data["password"]).hexdigest() + self._pwd = hashlib.md5(data["password"]).hexdigest() self._req = req try: response = loads(self.runAuthQuery()) diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index de1a80908..0c5327903 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -2,12 +2,7 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL - -try: - from json import loads -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads class RapideoPl(MultiHoster): __name__ = "RapideoPl" diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index 587b00bca..d64919ae0 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -1,10 +1,6 @@ # -*- coding: utf-8 -*- -try: - from json import loads, dumps -except ImportError: - from simplejson import loads - +from module.common.json_layer import json_loads as loads from module.plugins.internal.SimpleHoster import SimpleHoster -- cgit v1.2.3 From 88ba5ecd9027ffa7a8bb5eb207085295ad35724d Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:49:42 +0200 Subject: newline fix --- module/plugins/accounts/RapideoPl.py | 1 + module/plugins/hooks/RapideoPl.py | 1 + 2 files changed, 2 insertions(+) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 6ace9ede0..cbec9809a 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -7,6 +7,7 @@ from module.plugins.Account import Account from time import mktime from module.common.json_layer import json_loads as loads + class RapideoPl(Account): __name__ = "RapideoPl" __version__ = "0.01" diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index 0c5327903..910dd175b 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -4,6 +4,7 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL from module.common.json_layer import json_loads as loads + class RapideoPl(MultiHoster): __name__ = "RapideoPl" __version__ = "0.01" -- cgit v1.2.3 From d0eea8f9baced6fd882e396e019940cff5fcf777 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 13:50:58 +0200 Subject: replace is_premium with direct expression, remove explicit "is not None" --- module/plugins/accounts/RapideoPl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index cbec9809a..f35d23827 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -41,8 +41,7 @@ class RapideoPl(Account): premium = False valid_untill = -1 - is_premium = "expire" in result.keys() and result["expire"] is not None - if is_premium: + if "expire" in result.keys() and result["expire"]: premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) -- cgit v1.2.3 From 4ef0c28e60efa92b0113c748afe5383e7cf432fd Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 14:04:16 +0200 Subject: fail messages localization and dictionary --- module/plugins/hoster/RapideoPl.py | 44 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index d64919ae0..1047b1002 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -20,6 +20,16 @@ class RapideoPl(SimpleHoster): "password": "", "url": ""} + _error_codes = { + 0: "[%s] Incorrect login credentials", + 1: "[%s] Not enough transfer to download - top-up your account", + 2: "[%s] Incorrect / dead link", + 3: "[%s] Error connecting to hosting, try again later", + 9: "[%s] Premium account has expired", + 15: "[%s] Hosting no longer supported", + 80: "[%s] Too many incorrect login attempts, account blocked for 24h" + } + _usr = False _pwd = False @@ -29,7 +39,7 @@ class RapideoPl(SimpleHoster): def get_username_password(self): if not self.account: - self.fail("[Rapideo.pl] Login to Rapideo.pl plugin or turn plugin off") + self.fail(_("Please enter your %s account or deactivate this plugin") % "Rapideo.pl") else: self._usr = self.account.getAccountData(self.user).get('usr') self._pwd = self.account.getAccountData(self.user).get('pwd') @@ -64,39 +74,21 @@ class RapideoPl(SimpleHoster): self.logDebug(parsed) if "errno" in parsed.keys(): - - if parsed["errno"] == 0: - self.fail("[Rapideo.pl] Invalid account credentials") - - elif parsed["errno"] == 80: - self.fail("[Rapideo.pl] Too much incorrect login attempts, account blocked for 24h") - - elif parsed["errno"] == 1: - self.fail("[Rapideo.pl] Not enough transfer - top up to download") - - elif parsed["errno"] == 9: - self.fail("[Rapideo.pl] Account expired") - - elif parsed["errno"] == 2: - self.fail("[Rapideo.pl] Invalid / dead link") - - elif parsed["errno"] == 3: - self.fail("[Rapideo.pl] Error connecting to host") - - elif parsed["errno"] == 15: - self.fail("[Rapideo.pl] Hosting no longer supported") - + if parsed["errno"] in self._error_codes: + # error code in known + self.fail(self._error_codes[parsed["errno"]] % self.__name__) else: + # error code isn't yet added to plugin self.fail( parsed["errstring"] - or "Unknown error (code: {})".format(parsed["errno"]) + or "Unknown error (code: %s)" % parsed["errno"] ) if "sdownload" in parsed: if parsed["sdownload"] == "1": self.fail( - "Download from {} is possible only when using \ - Rapideo.pl directly. Update this plugin.".format(parsed["hosting"])) + "Download from %s is possible only using Rapideo.pl webiste \ + directly. Update this plugin." % parsed["hosting"]) pyfile.name = parsed["filename"] pyfile.size = parsed["filesize"] -- cgit v1.2.3 From 1e90f0a46b7fd0f1d9376ea966e1650afa782c37 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 16 Sep 2014 23:20:17 +0200 Subject: fix to work with python 2.5 --- module/plugins/hoster/RapideoPl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index 1047b1002..0c46c0593 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -61,14 +61,14 @@ class RapideoPl(SimpleHoster): self.get_username_password() try: data = self.runFileQuery(pyfile.url, 'fileinfo') - except Exception as e: - self.logDebug(str(e)) + except Exception: + self.logDebug("RunFileQuery error") self.tempOffline() try: parsed = loads(data) - except Exception as e: - self.logDebug(str(e)) + except Exception: + self.logDebug("Loads error") self.tempOffline() self.logDebug(parsed) @@ -95,8 +95,8 @@ class RapideoPl(SimpleHoster): try: result_dl = self.runFileQuery(pyfile.url, 'filedownload') - except Exception as e: - self.logDebug(str(e)) + except Exception: + self.logDebug("runFileQuery error #2") self.tempOffline() self.download(result_dl, disposition=True) -- cgit v1.2.3 From 005710831caa04bbe372b54ac357658963fe02bb Mon Sep 17 00:00:00 2001 From: synweap15 Date: Mon, 3 Nov 2014 14:44:44 +0100 Subject: New __authors__ key, added __license__ --- module/plugins/accounts/RapideoPl.py | 4 ++-- module/plugins/hooks/RapideoPl.py | 4 ++-- module/plugins/hoster/RapideoPl.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index f35d23827..438ce7ad3 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -13,8 +13,8 @@ class RapideoPl(Account): __version__ = "0.01" __type__ = "account" __description__ = "Rapideo.pl account plugin" - __author_name__ = ("goddie") - __author_mail__ = ("dev@rapideo.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@rapideo.pl")] _api_url = "http://enc.rapideo.pl" diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index 910dd175b..a5d7a34a5 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -17,8 +17,8 @@ class RapideoPl(MultiHoster): ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] __description__ = "Rapideo.pl hook" - __author_name__ = ("goddie") - __author_mail__ = ("dev@rapideo.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@rapideo.pl")] def getHoster(self): hostings = loads(getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index 0c46c0593..9fd20e69e 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -9,8 +9,8 @@ class RapideoPl(SimpleHoster): __version__ = "0.01" __type__ = "hoster" __description__ = "Rapideo.pl hoster plugin" - __author_name__ = ("goddie") - __author_mail__ = ("dev@rapideo.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@rapideo.pl")] _api_url = "http://enc.rapideo.pl" -- cgit v1.2.3