From 7a7e3e211e36af06d00e0effbcc37ac59e152427 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:00:23 +0200 Subject: nopremium.pl files added --- module/plugins/accounts/NoPremiumPl.py | 102 +++++++++++++++++++++++++ module/plugins/hooks/NoPremiumPl.py | 39 ++++++++++ module/plugins/hoster/NoPremiumPl.py | 132 +++++++++++++++++++++++++++++++++ 3 files changed, 273 insertions(+) create mode 100644 module/plugins/accounts/NoPremiumPl.py create mode 100644 module/plugins/hooks/NoPremiumPl.py create mode 100644 module/plugins/hoster/NoPremiumPl.py (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py new file mode 100644 index 000000000..e44a6acff --- /dev/null +++ b/module/plugins/accounts/NoPremiumPl.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 NoPremiumPl(Account): + __name__ = "NoPremiumPl" + __version__ = "0.01" + __type__ = "account" + __description__ = "NoPremium.pl account plugin" + __author_name__ = ("goddie") + __author_mail__ = ("dev@nopremium.pl") + + _api_url = "http://crypt.nopremium.pl" + + _api_query = { + "site": "nopremium", + "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"] * 1024 + + return ({ + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) + + def login(self, user, data, req): + + self._usr = user + self._pwd = crypto.sha1(crypto.md5(data["password"]).hexdigest()).hexdigest() + + self._req = req + + try: + response = loads(self.runAuthQuery()) + except: + self.wrongPassword() + + 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 + + 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/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py new file mode 100644 index 000000000..154d748f1 --- /dev/null +++ b/module/plugins/hooks/NoPremiumPl.py @@ -0,0 +1,39 @@ +# !/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 NoPremiumPl(MultiHoster): + __name__ = "NoPremiumPl" + __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__ = "NoPremium.pl hook" + __author_name__ = ("goddie") + __author_mail__ = ("dev@nopremium.pl") + + def getHoster(self): + + hostings = loads(getURL("https://www.nopremium.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/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py new file mode 100644 index 000000000..7f61261b9 --- /dev/null +++ b/module/plugins/hoster/NoPremiumPl.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 NoPremiumPl(SimpleHoster): + + __name__ = "NoPremiumPl" + __version__ = "0.01" + __type__ = "hoster" + + __description__ = "NoPremium.pl hoster plugin" + __author_name__ = ("goddie") + __author_mail__ = ("dev@nopremium.pl") + + _api_url = "http://crypt.nopremium.pl" + + _api_query = {"site": "nopremium", + "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("[NoPremium.pl] Zaloguj się we wtyczce NoPremium.pl lub ją wyłącz") + + 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("[NoPremium.pl] Niepoprawne dane logowania") + + elif parsed["errno"] == 80: + self.fail("[NoPremium.pl] Zbyt dużo niepoprawnych logowań, konto zablokowane na 24h") + + elif parsed["errno"] == 1: + self.fail("[NoPremium.pl] Za mało transferu - doładuj aby pobrać") + + elif parsed["errno"] == 9: + self.fail("[NoPremium.pl] Konto wygasło") + + elif parsed["errno"] == 2: + self.fail("[NoPremium.pl] Niepoprawny / wygasły link") + + elif parsed["errno"] == 3: + self.fail("[NoPremium.pl] Błąd łączenia z hostingiem") + + elif parsed["errno"] == 15: + self.fail("[NoPremium.pl] Hosting nie jest już wspierany") + + else: + self.fail( + parsed["errstring"] + or "Nieznany błąd (kod: {})".format(parsed["errno"]) + ) + + if "sdownload" in parsed: + if parsed["sdownload"] == "1": + self.fail( + "Pobieranie z {} jest możliwe tylko przy bezpośrednim użyciu \ + NoPremium.pl. Zaktualizuj wtyczkę.".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 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 4a33d2e93055299e0108a23e0f2615e5cfd422f2 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 20:12:15 +0200 Subject: to-do elaborate --- module/plugins/accounts/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index e44a6acff..7ba89b881 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -48,7 +48,7 @@ class NoPremiumPl(Account): try: result = loads(self.runAuthQuery()) except: - #todo: ret? + #todo: return or let it be thrown? return premium = False -- cgit v1.2.3 From ccf15e75c12ad1e8347fdff834f8c62e5e2ab617 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 8 Jul 2014 21:33:01 +0200 Subject: remove redundant author information --- module/plugins/accounts/NoPremiumPl.py | 4 ---- module/plugins/hooks/NoPremiumPl.py | 4 ---- module/plugins/hoster/NoPremiumPl.py | 4 ---- 3 files changed, 12 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 7ba89b881..8cfdbe1a7 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.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/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 154d748f1..527119c5f 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -1,10 +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/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 7f61261b9..b324dff84 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.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 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 e325412cd71ae329f3f0b7084e5989e6ffbdbd18 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 11:57:05 +0200 Subject: remove enviroment line --- module/plugins/accounts/NoPremiumPl.py | 1 - module/plugins/hooks/NoPremiumPl.py | 1 - module/plugins/hoster/NoPremiumPl.py | 1 - 3 files changed, 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 8cfdbe1a7..df9e94a42 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 527119c5f..ef36331eb 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.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/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index b324dff84..7665e589f 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -1,4 +1,3 @@ -# !/usr/bin/env python # -*- coding: utf-8 -*- try: -- cgit v1.2.3 From 352301e4892d311d1a4cf6127f6bc70bc23eede3 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:02:59 +0200 Subject: remove blank lines and unused imports --- module/plugins/accounts/NoPremiumPl.py | 25 +++++++------------------ module/plugins/hooks/NoPremiumPl.py | 2 +- module/plugins/hoster/NoPremiumPl.py | 12 ------------ 3 files changed, 8 insertions(+), 31 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index df9e94a42..494b559c3 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.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 NoPremiumPl(Account): __name__ = "NoPremiumPl" __version__ = "0.01" @@ -37,38 +36,31 @@ class NoPremiumPl(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"] * 1024 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.sha1(crypto.md5(data["password"]).hexdigest()).hexdigest() - self._req = req try: @@ -78,12 +70,10 @@ class NoPremiumPl(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 +81,6 @@ class NoPremiumPl(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/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index ef36331eb..121e92f91 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -24,8 +24,8 @@ class NoPremiumPl(MultiHoster): __author_mail__ = ("dev@nopremium.pl") def getHoster(self): - hostings = loads(getURL("https://www.nopremium.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/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 7665e589f..bd5260a55 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -9,7 +9,6 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class NoPremiumPl(SimpleHoster): - __name__ = "NoPremiumPl" __version__ = "0.01" __type__ = "hoster" @@ -30,42 +29,31 @@ class NoPremiumPl(SimpleHoster): _pwd = False def setup(self): - self.resumeDownload = True self.multiDL = True def get_username_password(self): - if not self.account: - self.fail("[NoPremium.pl] Zaloguj się we wtyczce NoPremium.pl lub ją wyłącz") - 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: -- cgit v1.2.3 From ce18793af9864acdf9e9c71b7324d923a53adaad Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:05:22 +0200 Subject: fix json loads, dumps on ImportError exception --- module/plugins/accounts/NoPremiumPl.py | 5 +++-- module/plugins/hooks/NoPremiumPl.py | 5 +++-- module/plugins/hoster/NoPremiumPl.py | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 494b559c3..7b4140169 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -7,9 +7,10 @@ from time import mktime import module.lib.beaker.crypto as crypto try: - from json import loads + from json import loads, dumps except ImportError: - from simplejson import loads + from module.common.json_layer import json_loads as loads + from module.common.json_layer import json_dumps as dumps class NoPremiumPl(Account): diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 121e92f91..47aa117df 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -4,9 +4,10 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL try: - from json import loads + from json import loads, dumps except ImportError: - from simplejson import loads + from module.common.json_layer import json_loads as loads + from module.common.json_layer import json_dumps as dumps class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index bd5260a55..86255f95a 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -3,7 +3,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.common.json_layer import json_dumps as dumps from module.plugins.internal.SimpleHoster import SimpleHoster -- cgit v1.2.3 From dfd5cb44138494b803f66559747cacc1260b5595 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:15:03 +0200 Subject: simplify json loads, replace crypto with hashlib --- module/plugins/accounts/NoPremiumPl.py | 10 +++------- module/plugins/hooks/NoPremiumPl.py | 8 +++----- module/plugins/hoster/NoPremiumPl.py | 7 +------ 3 files changed, 7 insertions(+), 18 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 7b4140169..0f3b5286f 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -1,16 +1,12 @@ # -*- 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, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps +from module.common.json_layer import json_loads as loads class NoPremiumPl(Account): @@ -61,7 +57,7 @@ class NoPremiumPl(Account): def login(self, user, data, req): self._usr = user - self._pwd = crypto.sha1(crypto.md5(data["password"]).hexdigest()).hexdigest() + self._pwd = hashlib.sha1(hashlib.md5(data["password"]).hexdigest()).hexdigest() self._req = req try: diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 47aa117df..1357c95e8 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -3,11 +3,9 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL -try: - from json import loads, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps +from module.common.json_layer import json_loads as loads + + class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 86255f95a..39e5b435c 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -1,11 +1,6 @@ # -*- coding: utf-8 -*- -try: - from json import loads, dumps -except ImportError: - from module.common.json_layer import json_loads as loads - from module.common.json_layer import json_dumps as dumps - +from module.common.json_layer import json_loads as loads from module.plugins.internal.SimpleHoster import SimpleHoster -- cgit v1.2.3 From 0fc351436bfb4a94749899e34c46bf81a44c92c9 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:16:36 +0200 Subject: replace is_premium with direct expression --- module/plugins/accounts/NoPremiumPl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 0f3b5286f..49c9b7653 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -42,9 +42,8 @@ class NoPremiumPl(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"] is not None: premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] * 1024 -- cgit v1.2.3 From e6912eb377069cd8e28d293c2e1cb85ab4d4e986 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:38:17 +0200 Subject: fail messages localization and dictionary --- module/plugins/hoster/NoPremiumPl.py | 44 +++++++++++++++--------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 39e5b435c..2b6d2aa35 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -21,6 +21,16 @@ class NoPremiumPl(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 @@ -30,7 +40,7 @@ class NoPremiumPl(SimpleHoster): def get_username_password(self): if not self.account: - self.fail("[NoPremium.pl] Zaloguj się we wtyczce NoPremium.pl lub ją wyłącz") + self.fail(_("Please enter your %s account or deactivate this plugin") % "NoPremium.pl") else: self._usr = self.account.getAccountData(self.user).get('usr') self._pwd = self.account.getAccountData(self.user).get('pwd') @@ -65,39 +75,21 @@ class NoPremiumPl(SimpleHoster): self.logDebug(parsed) if "errno" in parsed.keys(): - - if parsed["errno"] == 0: - self.fail("[NoPremium.pl] Niepoprawne dane logowania") - - elif parsed["errno"] == 80: - self.fail("[NoPremium.pl] Zbyt dużo niepoprawnych logowań, konto zablokowane na 24h") - - elif parsed["errno"] == 1: - self.fail("[NoPremium.pl] Za mało transferu - doładuj aby pobrać") - - elif parsed["errno"] == 9: - self.fail("[NoPremium.pl] Konto wygasło") - - elif parsed["errno"] == 2: - self.fail("[NoPremium.pl] Niepoprawny / wygasły link") - - elif parsed["errno"] == 3: - self.fail("[NoPremium.pl] Błąd łączenia z hostingiem") - - elif parsed["errno"] == 15: - self.fail("[NoPremium.pl] Hosting nie jest już wspierany") - + 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 "Nieznany błąd (kod: {})".format(parsed["errno"]) + or "Unknown error (code: %s)" % parsed["errno"] ) if "sdownload" in parsed: if parsed["sdownload"] == "1": self.fail( - "Pobieranie z {} jest możliwe tylko przy bezpośrednim użyciu \ - NoPremium.pl. Zaktualizuj wtyczkę.".format(parsed["hosting"])) + "Download from %s is possible only using NoPremium.pl webiste \ + directly. Update this plugin." % parsed["hosting"]) pyfile.name = parsed["filename"] pyfile.size = parsed["filesize"] -- cgit v1.2.3 From 1df1779ded75e863994449ba034ed31ab2018ddc Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:40:13 +0200 Subject: remove explicit "is not None" --- module/plugins/accounts/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 49c9b7653..5f70440ac 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -43,7 +43,7 @@ class NoPremiumPl(Account): premium = False valid_untill = -1 - if "expire" in result.keys() and result["expire"] is not None: + if "expire" in result.keys() and result["expire"]: premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] * 1024 -- cgit v1.2.3 From 1b0dad0b60b155a3629b705c44bbbd45aa3a1cf6 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 12:48:29 +0200 Subject: nopremium link pattern --- module/plugins/hoster/NoPremiumPl.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins') diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 2b6d2aa35..51e171f7a 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -9,6 +9,7 @@ class NoPremiumPl(SimpleHoster): __version__ = "0.01" __type__ = "hoster" + __pattern__ = r"https?://direct\.nopremium\.pl.*" __description__ = "NoPremium.pl hoster plugin" __author_name__ = ("goddie") __author_mail__ = ("dev@nopremium.pl") -- 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 0824528da43d0842c15ffa0d4fe132309ca592eb Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 14:05:40 +0200 Subject: newline fix --- module/plugins/accounts/NoPremiumPl.py | 1 - module/plugins/hooks/NoPremiumPl.py | 2 -- module/plugins/hoster/NoPremiumPl.py | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 5f70440ac..bf1aec841 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -5,7 +5,6 @@ import hashlib from module.plugins.Account import Account from time import mktime - from module.common.json_layer import json_loads as loads diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 1357c95e8..757af6037 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -2,11 +2,9 @@ from module.plugins.internal.MultiHoster import MultiHoster from module.network.RequestFactory import getURL - from module.common.json_layer import json_loads as loads - class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" __version__ = "0.01" diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 51e171f7a..636220ca7 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- -from module.common.json_layer import json_loads as loads from module.plugins.internal.SimpleHoster import SimpleHoster - +from module.common.json_layer import json_loads as loads class NoPremiumPl(SimpleHoster): __name__ = "NoPremiumPl" -- cgit v1.2.3 From 307523821d61811032bd3a2f6f9e6661fdc489ca Mon Sep 17 00:00:00 2001 From: synweap15 Date: Wed, 9 Jul 2014 14:05:53 +0200 Subject: newline fix --- module/plugins/hoster/NoPremiumPl.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins') diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 636220ca7..f43292156 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -3,6 +3,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster from module.common.json_layer import json_loads as loads + class NoPremiumPl(SimpleHoster): __name__ = "NoPremiumPl" __version__ = "0.01" -- cgit v1.2.3 From 36b5bfedc2e57bd000831559ca8fb4d7e7899e24 Mon Sep 17 00:00:00 2001 From: tjeh Date: Sun, 20 Jul 2014 21:49:27 +0200 Subject: Added support for Multihosters.com multihoster. --- module/plugins/accounts/MultihostersCom.py | 50 ++++++++++++++++++++++++++++++ module/plugins/hooks/MultihostersCom.py | 22 +++++++++++++ module/plugins/hoster/MultihostersCom.py | 41 ++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 module/plugins/accounts/MultihostersCom.py create mode 100644 module/plugins/hooks/MultihostersCom.py create mode 100644 module/plugins/hoster/MultihostersCom.py (limited to 'module/plugins') diff --git a/module/plugins/accounts/MultihostersCom.py b/module/plugins/accounts/MultihostersCom.py new file mode 100644 index 000000000..3f96fdf41 --- /dev/null +++ b/module/plugins/accounts/MultihostersCom.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +from time import mktime, strptime +from module.plugins.Account import Account + +class MultihostersCom(Account): + __name__ = "MultihostersCom" + __version__ = "0.01" + __type__ = "account" + __description__ = """Multihosters.com account plugin""" + __author_name__ = "tjeh" + __author_mail__ = "tjeh@gmx.net" + + def loadAccountInfo(self, user, req): + data = self.getAPIData(req) + if data == "No traffic": + account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + else: + account_info = { + "trafficleft": int(data['availabletodaytraffic']) * 1024, + "validuntil": mktime(strptime(data['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")), + "premium": True + } + return account_info + + def login(self, user, data, req): + self.loginname = user + self.password = data['password'] + if self.getAPIData(req) == "No traffic": + self.wrongPassword() + + def getAPIData(self, req, just_header=False, **kwargs): + get_data = { + 'cmd': 'accountinfo', + 'login': self.loginname, + 'pass': self.password + } + get_data.update(kwargs) + + response = req.load("http://www.multihosters.com/jDownloader.ashx", get=get_data, + decode=True, just_header=just_header) + self.logDebug(response) + + if ':' in response: + if not just_header: + response = response.replace(',', '\n') + return dict((y.strip().lower(), z.strip()) for (y, z) in + [x.split(':', 1) for x in response.splitlines() if ':' in x]) + else: + return response diff --git a/module/plugins/hooks/MultihostersCom.py b/module/plugins/hooks/MultihostersCom.py new file mode 100644 index 000000000..5ada3aa56 --- /dev/null +++ b/module/plugins/hooks/MultihostersCom.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + +class MultihostersCom(MultiHoster): + __name__ = "MultihostersCom" + __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", "Revert to standard download if download fails", False), + ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + + __description__ = """Multihosters.com hook plugin""" + __author_name__ = "tjeh" + __author_mail__ = "tjeh@gmx.net" + + def getHoster(self): + page = getURL("http://www.multihosters.com/jDownloader.ashx?cmd=gethosters") + return [x.strip() for x in page.split(",")] \ No newline at end of file diff --git a/module/plugins/hoster/MultihostersCom.py b/module/plugins/hoster/MultihostersCom.py new file mode 100644 index 000000000..04192cd8e --- /dev/null +++ b/module/plugins/hoster/MultihostersCom.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster + +class MultihostersCom(Hoster): + __name__ = "MultihostersCom" + __version__ = "0.01" + __type__ = "hoster" + __pattern__ = r'http://(?:www\.)?multihosters.com/.*' + __description__ = """Multihosters.com hoster plugin""" + __author_name__ = "tjeh" + __author_mail__ = "tjeh@gmx.net" + + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = 1 + + def process(self, pyfile): + if re.match(self.__pattern__, pyfile.url): + new_url = pyfile.url + elif not self.account: + self.logError(("Please enter your %s account or deactivate this plugin") % "multihosters.com") + self.fail("No multihosters.com account provided") + else: + self.logDebug("Old URL: %s" % pyfile.url) + new_url = "http://multihosters.com/getFiles.aspx?ourl=" + pyfile.url + pyfile.url = new_url + self.logDebug("New URL: %s" % new_url) + + if self.account.getAPIData(self.req, cmd="checklink", olink=pyfile.url) != "Alive": + self.fail("Offline or not downloadable - contact Multihosters support") + + header = self.account.getAPIData(self.req, just_header=True, cmd="generatedownloaddirect", olink=pyfile.url) + if not "location" in header: + self.fail("Unable to initialize download - contact Multihosters support") + self.download(header['location'], disposition=True) + + check = self.checkDownload({"error": 'action="ErrorDownload.aspx'}) + if check == "error": + self.fail("Error response received - contact Multihosters support") -- cgit v1.2.3 From 3554160654a1cb8e7000ebeea06aecdabc91af8e Mon Sep 17 00:00:00 2001 From: glukgluk Date: Thu, 7 Aug 2014 22:33:47 +0200 Subject: Create JustPremium.py --- module/plugins/hooks/JustPremium.py | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 module/plugins/hooks/JustPremium.py (limited to 'module/plugins') diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py new file mode 100644 index 000000000..17028ef5e --- /dev/null +++ b/module/plugins/hooks/JustPremium.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: mazleu +""" +from module.plugins.Hook import Hook +from module.plugins.Account import Account +from module.plugins.Hoster import Hoster + + +class JustPremium(Hook): + __name__ = "JustPremium" + __version__ = "0.15" + __description__ = "If you add multiple links with at least one premium hoster link, all non premium links get removed" + __config__ = [("activated", "bool", "Activated", "False"), + ("freehosters","bool", "Allow all freehosters and other unknown sites", "false"), + ("nicehoster", "str", "unblock this hosters (comma seperated)", "Zippyshare.com")] + + __author_name__ = ("mazleu") + __author_mail__ = ("mazleica@gmail.com") + + event_list = ["linksAdded"] + + def coreReady(self) : + accs=str(self.core.accountManager.getAccountInfos()) + global badhosts + global hosts + hosts = "" + while "[{" in accs: + startid=accs.rfind("[], ", 0, accs.find("[{"))+2 + endid=accs.find("}]",startid)+2 + hosts=hosts+","+accs[startid+3:accs.find("'",startid+3)] + accs=accs[0:startid]+accs[endid:] + badhosts=accs.replace("': [], '",",")[2:-6] + hosts=hosts[1:] + hosts=hosts+","+self.getConfig("nicehoster") + self.logDebug("good hosts:",hosts) + self.logDebug("bad hosts:",badhosts) + + + def filterLinks(self, t): + links = self.core.api.checkURLs(t) + hosterlist ="" + bhosters = [x.strip() for x in badhosts.split(",")] + ghosters = [x.strip() for x in hosts.split(",")] + premhoster = False + for hoster in links: + self.logDebug(hoster) + if hoster in ghosters: + premhoster = True + if premhoster : + for hoster in links: + if self.getConfig("freehosters"): + if hoster in bhosters: + for link in links[hoster]: + t.remove(link) + self.logDebug("removed link '%s'because hoster was: '%s' " % (link,hoster)) + else: + if not hoster in ghosters: + for link in links[hoster]: + t.remove(link) + self.logDebug("removed link '%s'because hoster was: '%s' " % (link,hoster)) + def linksAdded(self, links, pid): + self.filterLinks(links) -- cgit v1.2.3 From dabe45332a554aba173c47754d39b514fa77c1bb Mon Sep 17 00:00:00 2001 From: glukgluk Date: Fri, 8 Aug 2014 21:53:56 +0200 Subject: Update JustPremium.py --- module/plugins/hooks/JustPremium.py | 77 +++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 37 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py index 17028ef5e..2c5788b75 100644 --- a/module/plugins/hooks/JustPremium.py +++ b/module/plugins/hooks/JustPremium.py @@ -22,55 +22,58 @@ from module.plugins.Hoster import Hoster class JustPremium(Hook): __name__ = "JustPremium" - __version__ = "0.15" + __version__ = "0.16" __description__ = "If you add multiple links with at least one premium hoster link, all non premium links get removed" __config__ = [("activated", "bool", "Activated", "False"), - ("freehosters","bool", "Allow all freehosters and other unknown sites", "false"), + ("freehosters","bool", "Allow all freehosters and other unknown sites", "false"), ("nicehoster", "str", "unblock this hosters (comma seperated)", "Zippyshare.com")] - + __author_name__ = ("mazleu") __author_mail__ = ("mazleica@gmail.com") event_list = ["linksAdded"] - - def coreReady(self) : + + def coreReady(self) : accs=str(self.core.accountManager.getAccountInfos()) - global badhosts - global hosts - hosts = "" - while "[{" in accs: - startid=accs.rfind("[], ", 0, accs.find("[{"))+2 - endid=accs.find("}]",startid)+2 - hosts=hosts+","+accs[startid+3:accs.find("'",startid+3)] - accs=accs[0:startid]+accs[endid:] - badhosts=accs.replace("': [], '",",")[2:-6] - hosts=hosts[1:] - hosts=hosts+","+self.getConfig("nicehoster") - self.logDebug("good hosts:",hosts) - self.logDebug("bad hosts:",badhosts) + global badhosts + global hosts + hosts = "" + while "[{" in accs: + startid=accs.rfind("[], ", 0, accs.find("[{"))+2 + endid=accs.find("}]",startid)+2 + hosts=hosts+","+accs[startid+3:accs.find("'",startid+3)] + accs=accs[0:startid]+accs[endid:] + badhosts=accs.replace("': [], '",",")[2:-6] + hosts=hosts[1:] + hosts=hosts+","+self.getConfig("nicehoster") + self.logDebug("good hosts:",hosts) + self.logDebug("bad hosts:",badhosts) - def filterLinks(self, t): - links = self.core.api.checkURLs(t) + def filterLinks(self, t): + links = self.core.api.checkURLs(t) hosterlist ="" - bhosters = [x.strip() for x in badhosts.split(",")] - ghosters = [x.strip() for x in hosts.split(",")] - premhoster = False - for hoster in links: - self.logDebug(hoster) + bhosters = [x.strip() for x in badhosts.split(",")] + ghosters = [x.strip() for x in hosts.split(",")] + premhoster = False + for hoster in links: + self.logDebug(hoster) if hoster in ghosters: premhoster = True - if premhoster : - for hoster in links: - if self.getConfig("freehosters"): - if hoster in bhosters: - for link in links[hoster]: - t.remove(link) - self.logDebug("removed link '%s'because hoster was: '%s' " % (link,hoster)) - else: - if not hoster in ghosters: - for link in links[hoster]: - t.remove(link) - self.logDebug("removed link '%s'because hoster was: '%s' " % (link,hoster)) + self.logDebug ("Found at least one hoster with account") + if premhoster : + for hoster in links: + if self.getConfig("freehosters"): + if hoster in bhosters: + self.logInfo("remove links from hoster '%s' " % (hoster)) + for link in links[hoster]: + t.remove(link) + self.logDebug("remove link '%s'because hoster was: '%s' " % (link,hoster)) + else: + if not hoster in ghosters: + self.logInfo("remove links from hoster '%s' " % (hoster)) + for link in links[hoster]: + t.remove(link) + self.logDebug("remove link '%s' because hoster was: '%s' " % (link,hoster)) def linksAdded(self, links, pid): self.filterLinks(links) -- 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 542bb076b6a51c779f73249b02ffb5fae6950841 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Tue, 16 Sep 2014 23:21:57 +0200 Subject: fix to work with python 2.5 --- module/plugins/hoster/NoPremiumPl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index f43292156..1bdd6eda0 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -63,14 +63,14 @@ class NoPremiumPl(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) @@ -97,8 +97,8 @@ class NoPremiumPl(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 168f175ce4765dec7e847c45d95e4babe20a7193 Mon Sep 17 00:00:00 2001 From: synweap15 Date: Mon, 3 Nov 2014 14:42:05 +0100 Subject: New __authors__ key, added __license__ --- module/plugins/accounts/NoPremiumPl.py | 4 ++-- module/plugins/hooks/NoPremiumPl.py | 4 ++-- module/plugins/hoster/NoPremiumPl.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index bf1aec841..f2223b7d9 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -13,8 +13,8 @@ class NoPremiumPl(Account): __version__ = "0.01" __type__ = "account" __description__ = "NoPremium.pl account plugin" - __author_name__ = ("goddie") - __author_mail__ = ("dev@nopremium.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@nopremium.pl")] _api_url = "http://crypt.nopremium.pl" diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 757af6037..f60cb3dd6 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -17,8 +17,8 @@ class NoPremiumPl(MultiHoster): ("interval", "int", "Reload supported hosts interval in hours (0 to disable)", "24")] __description__ = "NoPremium.pl hook" - __author_name__ = ("goddie") - __author_mail__ = ("dev@nopremium.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@nopremium.pl")] def getHoster(self): hostings = loads(getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 1bdd6eda0..f4f7ba56a 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -11,8 +11,8 @@ class NoPremiumPl(SimpleHoster): __pattern__ = r"https?://direct\.nopremium\.pl.*" __description__ = "NoPremium.pl hoster plugin" - __author_name__ = ("goddie") - __author_mail__ = ("dev@nopremium.pl") + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@nopremium.pl")] _api_url = "http://crypt.nopremium.pl" -- 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 From bea9ff8cc5fee181dad7181fd30b061abc64f2ee Mon Sep 17 00:00:00 2001 From: Guidobelix Date: Sat, 6 Dec 2014 20:12:44 +0100 Subject: [TusfilesNet] Updated OFFLINE_PATTERN --- module/plugins/hoster/TusfilesNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py index 8c80455b4..f1f8cd90a 100644 --- a/module/plugins/hoster/TusfilesNet.py +++ b/module/plugins/hoster/TusfilesNet.py @@ -19,7 +19,7 @@ class TusfilesNet(XFSHoster): HOSTER_DOMAIN = "tusfiles.net" INFO_PATTERN = r'\](?P.+) - (?P[\d.,]+) (?P[\w^_]+)\[' - OFFLINE_PATTERN = r'>File Not Found|TusFiles - Fast Sharing Files!' + OFFLINE_PATTERN = r'>File Not Found|<Title>TusFiles - Fast Sharing Files!|The file you are trying to download is no longer available' def setup(self): -- cgit v1.2.3 From 933323bddb64a6739eec8182100baab09e09be57 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 10 Dec 2014 19:28:37 +0100 Subject: [RapiduNet] Improve account plugin Conflicts: module/plugins/accounts/RapiduNet.py --- module/plugins/accounts/RapiduNet.py | 38 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 2fabb6120..fe465bc48 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -6,40 +6,42 @@ from module.common.json_layer import json_loads class RapiduNet(Account): - __name__ = "RapiduNet" - __type__ = "account" - __version__ = "0.01" + __name__ = "RapiduNet" + __type__ = "account" + __version__ = "0.02" __description__ = """Rapidu.net account plugin""" - __license__ = "GPLv3" - __authors__ = [("prOq", None)] + __license__ = "GPLv3" + __authors__ = [("prOq", None)] - ACCOUNT_INFO_PATTERN = '<a href="premium/" style="padding-left: 0px;">Account: <b>(.*?)</b></a>' + PREMIUM_PATTERN = r'<a href="premium/" style="padding-left: 0px;">Account: <b>Premium</b></a>' def loadAccountInfo(self, user, req): - premium = False + info = {'validuntil': None, 'trafficleft': None, 'premium': False} - req.load('https://rapidu.net/ajax.php?a=getChangeLang', post={"_go": "", "lang": "en"}) - self.html = req.load('https://rapidu.net/', decode=True) + req.load("https://rapidu.net/ajax.php", get={'a': "getChangeLang"}, post={"_go": "", "lang": "en"}) + html = req.load("https://rapidu.net/", decode=True) - m = re.search(self.ACCOUNT_INFO_PATTERN, self.html) - if m: - if m.group(1) == "Premium": - premium = True + if re.search(self.PREMIUM_PATTERN, html): + info['premium'] = True - return {"validuntil": None, "trafficleft": None, "premium": premium} + return info def login(self, user, data, req): try: - json = req.load('https://rapidu.net/ajax.php?a=getUserLogin', post={"_go": "", "login": user, "pass": data['password'], "member": "1"}) - json = json_loads(json) + json = json_loads(req.load("https://rapidu.net/ajax.php?a=getUserLogin", + post={'_go': "", + 'login': user, + 'pass': data['password'], + 'member': "1"})) + self.logDebug(json) if not json['message'] == "success": - self.wrongPassword() + self.wrongPassword() + except Exception, e: self.logError(e) - -- cgit v1.2.3 From 5981ad8ebf968642d433c3aeb8b8da9202f7615c Mon Sep 17 00:00:00 2001 From: zapp-brannigan <zapp-brannigan@users.noreply.github.com> Date: Thu, 11 Dec 2014 17:13:58 +0100 Subject: [FilecryptCc.py] Upgrade captcha handling Added support for "click the open circle" captchas. --- module/plugins/crypter/FilecryptCc.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index fb53e616b..9623ffdee 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -12,7 +12,7 @@ from module.plugins.Crypter import Crypter class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -27,6 +27,7 @@ class FilecryptCc(Crypter): WEBLINK_PATTERN = r"openLink.?'([\w_-]*)'," CAPTCHA_PATTERN = r'<img id="nc" src="(.+?)"' + CIRCLECAPTCHA_PATTERN = r'<input type="image" src="(.+?)"' MIRROR_PAGE_PATTERN = r'"[\w]*" href="(http://filecrypt.cc/Container/\w+\.html\?mirror=\d+)">' @@ -38,7 +39,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): self.html = self.load(pyfile.url, cookies=True) - if "content not found" in self.html: + if "content notfound" in self.html: #@pyload-devs: this is _not_ a typo self.offline() self.handlePasswordProtection() @@ -78,16 +79,21 @@ class FilecryptCc(Crypter): def handleCaptcha(self): m = re.search(self.CAPTCHA_PATTERN, self.html) + found = re.search(self.CIRCLECAPTCHA_PATTERN, self.html) - if m: + if m: #normal captcha self.logDebug("Captcha-URL: %s" % m.group(1)) captcha_code = self.decryptCaptcha("http://filecrypt.cc" + m.group(1), forceUser=True, imgtype="gif") self.siteWithLinks = self.load(self.pyfile.url, post={"recaptcha_response_field":captcha_code}, decode=True, cookies=True) + elif found: #circle captcha + self.logDebug("Captcha-URL: %s" % found.group(1)) + captcha_code = self.decryptCaptcha("http://filecrypt.cc" + found.group(1), forceUser=True, imgtype="gif", result_type='positional') + self.siteWithLinks = self.load(self.pyfile.url, post={"button.x":captcha_code[0], "button.y":captcha_code[1]}, decode=True, cookies=True) else: self.logDebug("No captcha found") self.siteWithLinks = self.html - if "recaptcha_response_field" in self.siteWithLinks: + if "recaptcha_image" in self.siteWithLinks: self.invalidCaptcha() self.retry() -- cgit v1.2.3 From 50f3fd2fad476184b2e64eb66319292c02ed68c2 Mon Sep 17 00:00:00 2001 From: sebdelsol <seb.morin@gmail.com> Date: Fri, 12 Dec 2014 15:45:21 +0100 Subject: Update ZippyshareCom.py #bug correction : bad download url that is rejected with a 400 html error. change p_url creation to use '/'.join() instead of os.path.join() that doesn't work for an url. --- module/plugins/hoster/ZippyshareCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 3edf3c5c1..69be6833c 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -2,7 +2,6 @@ import re -from os.path import join from urlparse import urljoin from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -57,7 +56,7 @@ class ZippyshareCom(SimpleHoster): def get_link(self): checksum = self.get_checksum() - p_url = join("d", self.info['pattern']['KEY'], str(checksum), self.pyfile.name) + p_url = '/'.join(("d", self.info['pattern']['KEY'], str(checksum), self.pyfile.name)) dl_link = urljoin(self.info['pattern']['HOST'], p_url) return dl_link -- cgit v1.2.3 From ffbcf11d953c47b8987c7c5bb1c45c67df49c92a Mon Sep 17 00:00:00 2001 From: sebdelsol <seb.morin@gmail.com> Date: Fri, 12 Dec 2014 16:07:30 +0100 Subject: [SendspaceCom] https link https link were not handled (a lot of sendspace link are https). --- module/plugins/hoster/SendspaceCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index b589bb021..09e571783 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -10,7 +10,7 @@ class SendspaceCom(SimpleHoster): __type__ = "hoster" __version__ = "0.14" - __pattern__ = r'http://(?:www\.)?sendspace\.com/file/.*' + __pattern__ = r'https?://(?:www\.)?sendspace\.com/file/.*' __description__ = """Sendspace.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 1fe525b92affd6d3829af219a9b1b5eeda136ca2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 12 Dec 2014 20:31:37 +0100 Subject: [SimpleHoster] Remove CONTENT_DISPOSITION + Rename parseInfo to parseInfos --- module/plugins/internal/SimpleHoster.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 530b67692..ddaea020a 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -104,9 +104,9 @@ def parseFileInfo(plugin, url="", html=""): #@TODO: Remove in 0.4.10 -#@NOTE: Every plugin must have own parseInfo classmethod to work with 0.4.10 +#@NOTE: Every plugin must have own parseInfos classmethod to work with 0.4.10 def create_getInfo(plugin): - return lambda urls: [(info['name'], info['size'], info['status'], info['url']) for info in plugin.parseInfo(urls)] + return lambda urls: [(info['name'], info['size'], info['status'], info['url']) for info in plugin.parseInfos(urls)] def timestamp(): @@ -144,7 +144,7 @@ def _isDirectLink(self, url, resumable=True): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "0.71" + __version__ = "0.72" __pattern__ = r'^unmatchable$' @@ -206,11 +206,10 @@ class SimpleHoster(Hoster): FORCE_CHECK_TRAFFIC = False #: Set to True to force checking traffic left for premium account CHECK_DIRECT_LINK = None #: Set to True to check for direct link, set to None to do it only if self.account is True MULTI_HOSTER = False #: Set to True to leech other hoster link (according its multihoster hook if available) - CONTENT_DISPOSITION = False #: Set to True to replace file name with content-disposition value from http header @classmethod - def parseInfo(cls, urls): + def parseInfos(cls, urls): for url in urls: url = replace_patterns(url, cls.FILE_URL_REPLACEMENTS if hasattr(cls, "FILE_URL_REPLACEMENTS") else cls.URL_REPLACEMENTS) #@TODO: Remove FILE_URL_REPLACEMENTS check in 0.4.10 yield cls.getInfo(url) @@ -392,7 +391,7 @@ class SimpleHoster(Hoster): if not link: return - self.download(link, disposition=self.CONTENT_DISPOSITION) + self.download(link, disposition=True) def checkFile(self): -- cgit v1.2.3 From 0f530be2642c63759cb6156866f1d4ab119760da Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 12 Dec 2014 20:33:34 +0100 Subject: Fix missing create_getInfo --- module/plugins/crypter/BitshareComFolder.py | 5 ++++- module/plugins/crypter/CrockoComFolder.py | 5 ++++- module/plugins/crypter/DataHuFolder.py | 5 ++++- module/plugins/crypter/DepositfilesComFolder.py | 5 ++++- module/plugins/crypter/DevhostStFolder.py | 5 ++++- module/plugins/crypter/DlProtectCom.py | 5 ++++- module/plugins/crypter/EasybytezComFolder.py | 5 ++++- module/plugins/crypter/FilecloudIoFolder.py | 5 ++++- module/plugins/crypter/FilefactoryComFolder.py | 5 ++++- module/plugins/crypter/FilerNetFolder.py | 5 ++++- module/plugins/crypter/FilestubeCom.py | 5 ++++- module/plugins/crypter/FiletramCom.py | 5 ++++- module/plugins/crypter/FreakhareComFolder.py | 5 ++++- module/plugins/crypter/FreetexthostCom.py | 5 ++++- module/plugins/crypter/FshareVnFolder.py | 5 ++++- module/plugins/crypter/ImgurComAlbum.py | 5 ++++- module/plugins/crypter/JunocloudMeFolder.py | 5 ++++- module/plugins/crypter/LinkSaveIn.py | 5 ++++- module/plugins/crypter/MegaRapidCzFolder.py | 5 ++++- module/plugins/crypter/MultiUpOrg.py | 5 ++++- module/plugins/crypter/NetfolderIn.py | 5 ++++- module/plugins/crypter/NosvideoCom.py | 5 ++++- module/plugins/crypter/PastebinCom.py | 5 ++++- module/plugins/crypter/RapidfileshareNetFolder.py | 5 ++++- module/plugins/crypter/TnyCz.py | 5 ++++- module/plugins/crypter/TurbobitNetFolder.py | 5 ++++- module/plugins/crypter/TusfilesNetFolder.py | 5 ++++- module/plugins/crypter/UploadableChFolder.py | 5 ++++- module/plugins/crypter/UploadedToFolder.py | 5 ++++- module/plugins/crypter/XFileSharingProFolder.py | 5 ++++- module/plugins/hoster/BasePlugin.py | 3 +++ module/plugins/hoster/DodanePl.py | 2 +- module/plugins/internal/XFSCrypter.py | 4 ++-- 33 files changed, 126 insertions(+), 33 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/BitshareComFolder.py b/module/plugins/crypter/BitshareComFolder.py index e4038aebf..c70a849b6 100644 --- a/module/plugins/crypter/BitshareComFolder.py +++ b/module/plugins/crypter/BitshareComFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class BitshareComFolder(SimpleCrypter): @@ -19,3 +19,6 @@ class BitshareComFolder(SimpleCrypter): LINK_PATTERN = r'<a href="(http://bitshare\.com/files/.+)">.+</a></td>' NAME_PATTERN = r'View public folder "(?P<N>.+)"</h1>' + + +getInfo = create_getInfo(BitshareComFolder) diff --git a/module/plugins/crypter/CrockoComFolder.py b/module/plugins/crypter/CrockoComFolder.py index 64a1f8bce..bf91b0afc 100644 --- a/module/plugins/crypter/CrockoComFolder.py +++ b/module/plugins/crypter/CrockoComFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class CrockoComFolder(SimpleCrypter): @@ -18,3 +18,6 @@ class CrockoComFolder(SimpleCrypter): LINK_PATTERN = r'<td class="last"><a href="([^"]+)">download</a>' + + +getInfo = create_getInfo(CrockoComFolder) diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py index 0399e686d..a5602d6c6 100644 --- a/module/plugins/crypter/DataHuFolder.py +++ b/module/plugins/crypter/DataHuFolder.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class DataHuFolder(SimpleCrypter): @@ -38,3 +38,6 @@ class DataHuFolder(SimpleCrypter): if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password self.fail(_("Wrong password")) + + +getInfo = create_getInfo(DataHuFolder) diff --git a/module/plugins/crypter/DepositfilesComFolder.py b/module/plugins/crypter/DepositfilesComFolder.py index 79c31c97a..147f093c3 100644 --- a/module/plugins/crypter/DepositfilesComFolder.py +++ b/module/plugins/crypter/DepositfilesComFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class DepositfilesComFolder(SimpleCrypter): @@ -18,3 +18,6 @@ class DepositfilesComFolder(SimpleCrypter): LINK_PATTERN = r'<div class="progressName"[^>]*>\s*<a href="([^"]+)" title="[^"]*" target="_blank">' + + +getInfo = create_getInfo(DepositfilesComFolder) diff --git a/module/plugins/crypter/DevhostStFolder.py b/module/plugins/crypter/DevhostStFolder.py index 192c5962c..5ac9d4faf 100644 --- a/module/plugins/crypter/DevhostStFolder.py +++ b/module/plugins/crypter/DevhostStFolder.py @@ -7,7 +7,7 @@ import re from urlparse import urljoin -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class DevhostStFolder(SimpleCrypter): @@ -56,3 +56,6 @@ class DevhostStFolder(SimpleCrypter): def getLinks(self): return [urljoin("http://d-h.st", link) for link in re.findall(self.LINK_PATTERN, self.html)] + + +getInfo = create_getInfo(DevhostStFolder) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 5efb03c15..0f59e925e 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -5,7 +5,7 @@ import re from base64 import urlsafe_b64encode from time import time -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class DlProtectCom(SimpleCrypter): @@ -63,3 +63,6 @@ class DlProtectCom(SimpleCrypter): pattern = r'<a href="([^/].+?)" target="_blank">' return re.findall(pattern, self.html) + + +getInfo = create_getInfo(DlProtectCom) diff --git a/module/plugins/crypter/EasybytezComFolder.py b/module/plugins/crypter/EasybytezComFolder.py index fa3e6165c..04f9b853b 100644 --- a/module/plugins/crypter/EasybytezComFolder.py +++ b/module/plugins/crypter/EasybytezComFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class EasybytezComFolder(XFSCrypter): @@ -20,3 +20,6 @@ class EasybytezComFolder(XFSCrypter): HOSTER_DOMAIN = "easybytez.com" LOGIN_ACCOUNT = True + + +getInfo = create_getInfo(EasybytezComFolder) diff --git a/module/plugins/crypter/FilecloudIoFolder.py b/module/plugins/crypter/FilecloudIoFolder.py index 5640ab5c9..83cce352d 100644 --- a/module/plugins/crypter/FilecloudIoFolder.py +++ b/module/plugins/crypter/FilecloudIoFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FilecloudIoFolder(SimpleCrypter): @@ -19,3 +19,6 @@ class FilecloudIoFolder(SimpleCrypter): LINK_PATTERN = r'href="(http://filecloud\.io/\w+)" title' NAME_PATTERN = r'>(?P<N>.+?) - filecloud\.io<' + + +getInfo = create_getInfo(FilecloudIoFolder) diff --git a/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py index 52c39c386..26e28acbd 100644 --- a/module/plugins/crypter/FilefactoryComFolder.py +++ b/module/plugins/crypter/FilefactoryComFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FilefactoryComFolder(SimpleCrypter): @@ -26,3 +26,6 @@ class FilefactoryComFolder(SimpleCrypter): def loadPage(self, page_n): return self.load(self.pyfile.url, get={'page': page_n}) + + +getInfo = create_getInfo(FilefactoryComFolder) diff --git a/module/plugins/crypter/FilerNetFolder.py b/module/plugins/crypter/FilerNetFolder.py index a2daba136..00db173bb 100644 --- a/module/plugins/crypter/FilerNetFolder.py +++ b/module/plugins/crypter/FilerNetFolder.py @@ -1,6 +1,6 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FilerNetFolder(SimpleCrypter): @@ -24,3 +24,6 @@ class FilerNetFolder(SimpleCrypter): def getLinks(self): return ['http://filer.net%s' % link for link in re.findall(self.LINK_PATTERN, self.html)] + + +getInfo = create_getInfo(FilerNetFolder) diff --git a/module/plugins/crypter/FilestubeCom.py b/module/plugins/crypter/FilestubeCom.py index 29de108e5..16ebdda37 100644 --- a/module/plugins/crypter/FilestubeCom.py +++ b/module/plugins/crypter/FilestubeCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FilestubeCom(SimpleCrypter): @@ -19,3 +19,6 @@ class FilestubeCom(SimpleCrypter): LINK_PATTERN = r'<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)' NAME_PATTERN = r'<h1\s*> (?P<N>.+) download\s*</h1>' + + +getInfo = create_getInfo(FilestubeCom) diff --git a/module/plugins/crypter/FiletramCom.py b/module/plugins/crypter/FiletramCom.py index e4c8b6360..76530c589 100644 --- a/module/plugins/crypter/FiletramCom.py +++ b/module/plugins/crypter/FiletramCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FiletramCom(SimpleCrypter): @@ -20,3 +20,6 @@ class FiletramCom(SimpleCrypter): LINK_PATTERN = r'\s+(http://.+)' NAME_PATTERN = r'<title>(?P<N>.+?) - Free Download' + + +getInfo = create_getInfo(FiletramCom) diff --git a/module/plugins/crypter/FreakhareComFolder.py b/module/plugins/crypter/FreakhareComFolder.py index d4d3c6d3c..7c1b7de2b 100644 --- a/module/plugins/crypter/FreakhareComFolder.py +++ b/module/plugins/crypter/FreakhareComFolder.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FreakhareComFolder(SimpleCrypter): @@ -36,3 +36,6 @@ class FreakhareComFolder(SimpleCrypter): 'entrys': '20', 'page': page_n - 1, 'order': ''}, decode=True) + + +getInfo = create_getInfo(FreakhareComFolder) diff --git a/module/plugins/crypter/FreetexthostCom.py b/module/plugins/crypter/FreetexthostCom.py index 36bc61d35..c33c9ff64 100644 --- a/module/plugins/crypter/FreetexthostCom.py +++ b/module/plugins/crypter/FreetexthostCom.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FreetexthostCom(SimpleCrypter): @@ -25,3 +25,6 @@ class FreetexthostCom(SimpleCrypter): self.error(_("Unable to extract links")) links = m.group(1) return links.strip().split("<br />\r\n") + + +getInfo = create_getInfo(FreetexthostCom) diff --git a/module/plugins/crypter/FshareVnFolder.py b/module/plugins/crypter/FshareVnFolder.py index e6e67ea13..d31a5c6a0 100644 --- a/module/plugins/crypter/FshareVnFolder.py +++ b/module/plugins/crypter/FshareVnFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class FshareVnFolder(SimpleCrypter): @@ -18,3 +18,6 @@ class FshareVnFolder(SimpleCrypter): LINK_PATTERN = r'<li class="w_80pc"><a href="([^"]+)" target="_blank">' + + +getInfo = create_getInfo(FshareVnFolder) diff --git a/module/plugins/crypter/ImgurComAlbum.py b/module/plugins/crypter/ImgurComAlbum.py index f8f226a1b..6c074f5f1 100644 --- a/module/plugins/crypter/ImgurComAlbum.py +++ b/module/plugins/crypter/ImgurComAlbum.py @@ -1,6 +1,6 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo from module.utils import uniqify @@ -25,3 +25,6 @@ class ImgurComAlbum(SimpleCrypter): def getLinks(self): f = lambda url: "http://" + re.sub(r'(\w{7})s\.', r'\1.', url) return uniqify(map(f, re.findall(self.LINK_PATTERN, self.html))) + + +getInfo = create_getInfo(ImgurComAlbum) diff --git a/module/plugins/crypter/JunocloudMeFolder.py b/module/plugins/crypter/JunocloudMeFolder.py index 509f1f7ec..990f25902 100644 --- a/module/plugins/crypter/JunocloudMeFolder.py +++ b/module/plugins/crypter/JunocloudMeFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class JunocloudMeFolder(XFSCrypter): @@ -18,3 +18,6 @@ class JunocloudMeFolder(XFSCrypter): HOSTER_DOMAIN = "junocloud.me" + + +getInfo = create_getInfo(JunocloudMeFolder) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 46babd156..22aba8afc 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -9,7 +9,7 @@ import re from Crypto.Cipher import AES -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo from module.unescape import unescape @@ -244,3 +244,6 @@ class LinkSaveIn(SimpleCrypter): # Log and return self.logDebug("Package has %d links" % len(links)) return links + + +getInfo = create_getInfo(LinkSaveIn) diff --git a/module/plugins/crypter/MegaRapidCzFolder.py b/module/plugins/crypter/MegaRapidCzFolder.py index d9fb828a8..e7dff6c8a 100644 --- a/module/plugins/crypter/MegaRapidCzFolder.py +++ b/module/plugins/crypter/MegaRapidCzFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class MegaRapidCzFolder(SimpleCrypter): @@ -18,3 +18,6 @@ class MegaRapidCzFolder(SimpleCrypter): LINK_PATTERN = r'<td class="soubor"[^>]*><a href="([^"]+)">' + + +getInfo = create_getInfo(MegaRapidCzFolder) diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py index 5f3fc8b17..ada8d0728 100644 --- a/module/plugins/crypter/MultiUpOrg.py +++ b/module/plugins/crypter/MultiUpOrg.py @@ -3,7 +3,7 @@ import re from urlparse import urljoin -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class MultiUpOrg(SimpleCrypter): @@ -36,3 +36,6 @@ class MultiUpOrg(SimpleCrypter): self.html = self.load(miror_page) return re.findall(pattern, self.html) + + +getInfo = create_getInfo(MultiUpOrg) diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index a47bd0503..bfdf5cb82 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class NetfolderIn(SimpleCrypter): @@ -68,3 +68,6 @@ class NetfolderIn(SimpleCrypter): links = re.search(r'name="list" value="(.*?)"', self.html).group(1).split(",") self.logDebug("Package has %d links" % len(links)) return links + + +getInfo = create_getInfo(NetfolderIn) diff --git a/module/plugins/crypter/NosvideoCom.py b/module/plugins/crypter/NosvideoCom.py index 3abefdadb..1e280abd2 100644 --- a/module/plugins/crypter/NosvideoCom.py +++ b/module/plugins/crypter/NosvideoCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class NosvideoCom(SimpleCrypter): @@ -19,3 +19,6 @@ class NosvideoCom(SimpleCrypter): LINK_PATTERN = r'href="(http://(?:w{3}\.)?nosupload\.com/\?d=\w+)"' NAME_PATTERN = r'<[tT]itle>Watch (?P<N>.+?)<' + + +getInfo = create_getInfo(NosvideoCom) diff --git a/module/plugins/crypter/PastebinCom.py b/module/plugins/crypter/PastebinCom.py index 1dae39bb8..b3d5a4bea 100644 --- a/module/plugins/crypter/PastebinCom.py +++ b/module/plugins/crypter/PastebinCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class PastebinCom(SimpleCrypter): @@ -19,3 +19,6 @@ class PastebinCom(SimpleCrypter): LINK_PATTERN = r'<div class="de\d+">(https?://[^ <]+)(?:[^<]*)</div>' NAME_PATTERN = r'<div class="paste_box_line1" title="(?P<N>[^"]+)">' + + +getInfo = create_getInfo(PastebinCom) diff --git a/module/plugins/crypter/RapidfileshareNetFolder.py b/module/plugins/crypter/RapidfileshareNetFolder.py index 5531d5a90..fc3d4241e 100644 --- a/module/plugins/crypter/RapidfileshareNetFolder.py +++ b/module/plugins/crypter/RapidfileshareNetFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class RapidfileshareNetFolder(XFSCrypter): @@ -18,3 +18,6 @@ class RapidfileshareNetFolder(XFSCrypter): HOSTER_DOMAIN = "rapidfileshare.net" + + +getInfo = create_getInfo(RapidfileshareNetFolder) diff --git a/module/plugins/crypter/TnyCz.py b/module/plugins/crypter/TnyCz.py index 6dde729f5..d36128550 100644 --- a/module/plugins/crypter/TnyCz.py +++ b/module/plugins/crypter/TnyCz.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo import re @@ -25,3 +25,6 @@ class TnyCz(SimpleCrypter): def getLinks(self): m = re.search(r'<a id=\'save_paste\' href="(.+save\.php\?hash=.+)">', self.html) return re.findall(".+", self.load(m.group(1), decode=True)) if m else None + + +getInfo = create_getInfo(TnyCz) diff --git a/module/plugins/crypter/TurbobitNetFolder.py b/module/plugins/crypter/TurbobitNetFolder.py index 4e07564af..64fcefac6 100644 --- a/module/plugins/crypter/TurbobitNetFolder.py +++ b/module/plugins/crypter/TurbobitNetFolder.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo from module.common.json_layer import json_loads @@ -42,3 +42,6 @@ class TurbobitNetFolder(SimpleCrypter): id = re.match(self.__pattern__, self.pyfile.url).group("ID") fixurl = lambda id: "http://turbobit.net/%s.html" % id return map(fixurl, self._getLinks(id)) + + +getInfo = create_getInfo(TurbobitNetFolder) diff --git a/module/plugins/crypter/TusfilesNetFolder.py b/module/plugins/crypter/TusfilesNetFolder.py index 9533a6e76..0db3470cc 100644 --- a/module/plugins/crypter/TusfilesNetFolder.py +++ b/module/plugins/crypter/TusfilesNetFolder.py @@ -4,7 +4,7 @@ import math import re from urlparse import urljoin -from module.plugins.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class TusfilesNetFolder(XFSCrypter): @@ -43,3 +43,6 @@ class TusfilesNetFolder(XFSCrypter): for p in xrange(2, pages + 1): self.html = self.loadPage(p) self.links += self.getLinks() + + +getInfo = create_getInfo(TusfilesNetFolder) diff --git a/module/plugins/crypter/UploadableChFolder.py b/module/plugins/crypter/UploadableChFolder.py index 070753ac0..22f9ca2ed 100644 --- a/module/plugins/crypter/UploadableChFolder.py +++ b/module/plugins/crypter/UploadableChFolder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class UploadableChFolder(SimpleCrypter): @@ -22,3 +22,6 @@ class UploadableChFolder(SimpleCrypter): NAME_PATTERN = r'<div class="folder"><span> </span>(?P<N>.+?)</div>' OFFLINE_PATTERN = r'We are sorry... The URL you entered cannot be found on the server.' TEMP_OFFLINE_PATTERN = r'<div class="icon_err">' + + +getInfo = create_getInfo(UploadableChFolder) diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py index 359ba92d0..3e77d73a9 100644 --- a/module/plugins/crypter/UploadedToFolder.py +++ b/module/plugins/crypter/UploadedToFolder.py @@ -4,7 +4,7 @@ import re from urlparse import urljoin -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class UploadedToFolder(SimpleCrypter): @@ -32,3 +32,6 @@ class UploadedToFolder(SimpleCrypter): plain_link = urljoin("http://uploaded.net/", m.group('plain')) return self.load(plain_link).split('\n')[:-1] + + +getInfo = create_getInfo(UploadedToFolder) diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index dffd8909c..10e4d8c83 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.XFSCrypter import XFSCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): @@ -45,3 +45,6 @@ class XFileSharingProFolder(XFSCrypter): self.user, data = self.account.selectAccount() self.req = self.account.getAccountRequest(self.user) self.premium = self.account.isPremium(self.user) + + +getInfo = create_getInfo(XFileSharingProFolder) diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index c8d632dc7..7b59303ef 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -104,3 +104,6 @@ class BasePlugin(Hoster): self.fail(_("Too many redirects")) self.download(unquote(url), disposition=True) + + +getInfo = create_getInfo(BasePlugin) diff --git a/module/plugins/hoster/DodanePl.py b/module/plugins/hoster/DodanePl.py index 58f1c02d8..65d8452fa 100644 --- a/module/plugins/hoster/DodanePl.py +++ b/module/plugins/hoster/DodanePl.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.DeadHoster import DeadHoster, parseFileInfo +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class DodanePl(DeadHoster): diff --git a/module/plugins/internal/XFSCrypter.py b/module/plugins/internal/XFSCrypter.py index 62fd8c017..4b57dab90 100644 --- a/module/plugins/internal/XFSCrypter.py +++ b/module/plugins/internal/XFSCrypter.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class XFSCrypter(SimpleCrypter): __name__ = "XFSCrypter" __type__ = "crypter" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'^unmatchable$' -- cgit v1.2.3 From 430092f0ba67e4bb2dd75433b08340d0afca0fa9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 12 Dec 2014 20:34:42 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hooks/SkipRev.py | 8 ++++---- module/plugins/hoster/FastshareCz.py | 5 ++--- module/plugins/hoster/FileSharkPl.py | 4 +--- module/plugins/hoster/FilerNet.py | 15 +++++++-------- module/plugins/hoster/Keep2shareCc.py | 25 +++++++++++-------------- 5 files changed, 25 insertions(+), 32 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 609bb4197..107740a3d 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -37,10 +37,10 @@ class SkipRev(Hook): if hasattr(plugin, "info") and 'name' in plugin.info and plugin.info['name']: name = plugin.info['name'] - elif hasattr(plugin, "parseInfo"): - name = next(plugin.parseInfo([url]))['name'] + elif hasattr(plugin, "parseInfos"): + name = next(plugin.parseInfos([url]))['name'] - elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfo was not found, getInfo should be missing too + elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfos was not found, getInfo should be missing too name = plugin.getInfo(url)['name'] else: diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 1f1e9e6ee..5e2057aa5 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" - __version__ = "0.24" + __version__ = "0.25" __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+' @@ -20,8 +20,7 @@ class FastshareCz(SimpleHoster): URL_REPLACEMENTS = [("#.*", "")] - COOKIES = [("fastshare.cz", "lang", "en")] - CONTENT_DISPOSITION = True + COOKIES = [("fastshare.cz", "lang", "en")] INFO_PATTERN = r'<h1 class="dwp">(?P<N>[^<]+)</h1>\s*<div class="fileinfo">\s*Size\s*: (?P<S>\d+) (?P<U>[\w^_]+),' OFFLINE_PATTERN = r'>(The file has been deleted|Requested page not found)' diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index ea2b56821..25825a229 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}' @@ -20,8 +20,6 @@ class FileSharkPl(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - CONTENT_DISPOSITION = True - NAME_PATTERN = r'<h2 class="name-file">(?P<N>.+)</h2>' SIZE_PATTERN = r'<p class="size-file">(.*?)<strong>(?P<S>\d+\.?\d*)\s(?P<U>\w+)</strong></p>' diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index c943a076d..5dd72efe7 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -15,7 +15,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -25,8 +25,6 @@ class FilerNet(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - CONTENT_DISPOSITION = True - INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>' OFFLINE_PATTERN = r'Nicht gefunden' @@ -66,16 +64,17 @@ class FilerNet(SimpleHoster): if 'location' in header and header['location']: self.correctCaptcha() - self.link = urljoin('http://filer.net', header['location']) + self.link = header['location'] return else: self.invalidCaptcha() - def handlePremium(self): - super(FilerNet, self).handlePremium() - if self.link: - self.link = urljoin("http://filer.net/", self.link) + def downloadLink(self, link): + if not link: + return + + self.download(urljoin("http://filer.net/", link), disposition=True) getInfo = create_getInfo(FilerNet) diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py index cb5e65a29..d98fa3c09 100644 --- a/module/plugins/hoster/Keep2shareCc.py +++ b/module/plugins/hoster/Keep2shareCc.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import _isDirectLink, SimpleHoster, cr class Keep2shareCc(SimpleHoster): __name__ = "Keep2shareCc" __type__ = "hoster" - __version__ = "0.16" + __version__ = "0.17" __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P<ID>\w+)' @@ -23,8 +23,6 @@ class Keep2shareCc(SimpleHoster): URL_REPLACEMENTS = [(__pattern__ + ".*", "http://k2s.cc/file/\g<ID>")] - CONTENT_DISPOSITION = True - NAME_PATTERN = r'File: <span>(?P<N>.+)</span>' SIZE_PATTERN = r'Size: (?P<S>[^<]+)</div>' @@ -87,13 +85,7 @@ class Keep2shareCc(SimpleHoster): if m is None: self.error(_("LINK_FREE_PATTERN not found")) - self.link = self._getDownloadLink(m.group(1)) - - - def handlePremium(self): - super(Keep2shareCc, self).handlePremium() - if self.link: - self.link = self._getDownloadLink(self.link) + self.link = m.group(1) def handleCaptcha(self): @@ -125,11 +117,16 @@ class Keep2shareCc(SimpleHoster): self.fail(_("All captcha attempts failed")) - def _getDownloadLink(self, url): - p = urlparse(self.pyfile.url) + def downloadLink(self, link): + if not link: + return + + p = urlparse(self.pyfile.url) base = "%s://%s" % (p.scheme, p.netloc) - link = _isDirectLink(self, url, self.premium) - return urljoin(base, link) if link else "" + link = _isDirectLink(self, link, self.premium) + + if link: + self.download(urljoin(base, link), disposition=True) getInfo = create_getInfo(Keep2shareCc) -- cgit v1.2.3 From c9b4f3b9a78904d34d7e58593eacdc26b93c2562 Mon Sep 17 00:00:00 2001 From: philou75 <admin@pju.fr> Date: Fri, 12 Dec 2014 22:49:23 +0100 Subject: Make the waiting time work again on OneFichier.com --- module/plugins/hoster/OneFichierCom.py | 11 ++--------- module/plugins/internal/SimpleHoster.py | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 977d45b6f..b5e034c0b 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" - __version__ = "0.74" + __version__ = "0.75" __pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P<ID2>\w+))?' @@ -30,7 +30,7 @@ class OneFichierCom(SimpleHoster): COOKIES = [("1fichier.com", "LG", "en")] - WAIT_PATTERN = r'>You must wait (\d+)' + WAIT_PATTERN = r'>You must wait (\d+) minutes' def setup(self): @@ -39,13 +39,6 @@ class OneFichierCom(SimpleHoster): def handle(self, reconnect): - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait_time = int(m.group(1)) * 60 - - self.wait(wait_time, reconnect) - self.retry(reason="You have to wait been each free download") - id = self.info['pattern']['ID1'] or self.info['pattern']['ID2'] url, inputs = self.parseHtmlForm('action="https://1fichier.com/\?%s' % id) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index f391445fd..47b713173 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -144,7 +144,7 @@ def _isDirectLink(self, url, resumable=True): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "0.70" + __version__ = "0.71" __pattern__ = r'^unmatchable$' @@ -412,7 +412,7 @@ class SimpleHoster(Hoster): m = re.search(self.WAIT_PATTERN, self.html) if m: wait_time = sum([int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in - re.findall(r'(\d+)\s*(hr|hour|min|sec)', m, re.I)]) + re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)]) self.wait(wait_time, False) return -- cgit v1.2.3 From 5cb925f5d23ca05c8e9bd5df75a68b0b4c2dc408 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 02:06:02 +0100 Subject: Update plugins --- module/plugins/crypter/FilecryptCc.py | 42 +++++++++++++++++++++++----------- module/plugins/hoster/SendspaceCom.py | 9 ++++---- module/plugins/hoster/TusfilesNet.py | 4 ++-- module/plugins/hoster/ZippyshareCom.py | 2 +- 4 files changed, 37 insertions(+), 20 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index 9793d4e5b..087f377ff 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -5,6 +5,7 @@ import binascii import re from Crypto.Cipher import AES +from urlparse import urljoin from module.plugins.Crypter import Crypter @@ -12,7 +13,7 @@ from module.plugins.Crypter import Crypter class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.06" + __version__ = "0.07" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -24,10 +25,10 @@ class FilecryptCc(Crypter): # URL_REPLACEMENTS = [(r'.html$', ""), (r'$', ".html")] #@TODO: Extend SimpleCrypter DLC_LINK_PATTERN = r'<button class="dlcdownload" type="button" title="Download \*.dlc" onclick="DownloadDLC\(\'(.+)\'\);"><i></i><span>dlc<' - WEBLINK_PATTERN = r"openLink.?'([\w_-]*)'," + WEBLINK_PATTERN = r"openLink.?'([\w_-]*)'," - CAPTCHA_PATTERN = r'<img id="nc" src="(.+?)"' - CIRCLECAPTCHA_PATTERN = r'<input type="image" src="(.+?)"' + CAPTCHA_PATTERN = r'<img id="nc" src="(.+?)"' + CIRCLE_CAPTCHA_PATTERN = r'<input type="image" src="(.+?)"' MIRROR_PAGE_PATTERN = r'"[\w]*" href="(http://filecrypt.cc/Container/\w+\.html\?mirror=\d+)">' @@ -39,7 +40,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): self.html = self.load(pyfile.url, cookies=True) - if "content notfound" in self.html: #@pyload-devs: this is _not_ a typo + if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() self.handlePasswordProtection() @@ -79,16 +80,31 @@ class FilecryptCc(Crypter): def handleCaptcha(self): m = re.search(self.CAPTCHA_PATTERN, self.html) - found = re.search(self.CIRCLECAPTCHA_PATTERN, self.html) + m2 = re.search(self.CIRCLE_CAPTCHA_PATTERN, self.html) - if m: #normal captcha + if m: #: normal captcha self.logDebug("Captcha-URL: %s" % m.group(1)) - captcha_code = self.decryptCaptcha("http://filecrypt.cc" + m.group(1), forceUser=True, imgtype="gif") - self.siteWithLinks = self.load(self.pyfile.url, post={"recaptcha_response_field":captcha_code}, decode=True, cookies=True) - elif found: #circle captcha - self.logDebug("Captcha-URL: %s" % found.group(1)) - captcha_code = self.decryptCaptcha("http://filecrypt.cc" + found.group(1), forceUser=True, imgtype="gif", result_type='positional') - self.siteWithLinks = self.load(self.pyfile.url, post={"button.x":captcha_code[0], "button.y":captcha_code[1]}, decode=True, cookies=True) + + captcha_code = self.decryptCaptcha(urljoin("http://filecrypt.cc", m.group(1)), + forceUser=True, + imgtype="gif") + + self.siteWithLinks = self.load(self.pyfile.url, + post={'recaptcha_response_field': captcha_code}, + cookies=True, + decode=True) + elif m2: #: circle captcha + self.logDebug("Captcha-URL: %s" % m2.group(1)) + + captcha_code = self.decryptCaptcha(urljoin("http://filecrypt.cc", m2.group(1)), + forceUser=True, + imgtype="gif", + result_type='positional') + + self.siteWithLinks = self.load(self.pyfile.url, + post={'button.x': captcha_code[0], 'button.y': captcha_code[1]}, + cookies=True, + decode=True) else: self.logDebug("No captcha found") self.siteWithLinks = self.html diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 09e571783..630a85cc4 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SendspaceCom(SimpleHoster): __name__ = "SendspaceCom" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __pattern__ = r'https?://(?:www\.)?sendspace\.com/file/.*' @@ -17,12 +17,13 @@ class SendspaceCom(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - NAME_PATTERN = r'<h2 class="bgray">\s*<(?:b|strong)>(?P<N>[^<]+)</' - SIZE_PATTERN = r'<div class="file_description reverse margin_center">\s*<b>File Size:</b>\s*(?P<S>[\d.,]+)(?P<U>[\w^_]+)\s*</div>' + NAME_PATTERN = r'<h2 class="bgray">\s*<(?:b|strong)>(?P<N>[^<]+)</' + SIZE_PATTERN = r'<div class="file_description reverse margin_center">\s*<b>File Size:</b>\s*(?P<S>[\d.,]+)(?P<U>[\w^_]+)\s*</div>' OFFLINE_PATTERN = r'<div class="msg error" style="cursor: default">Sorry, the file you requested is not available.</div>' LINK_PATTERN = r'<a id="download_button" href="([^"]+)"' - CAPTCHA_PATTERN = r'<td><img src="(/captchas/captcha\.php?captcha=([^"]+))"></td>' + + CAPTCHA_PATTERN = r'<td><img src="(/captchas/captcha\.php?captcha=([^"]+))"></td>' USER_CAPTCHA_PATTERN = r'<td><img src="/captchas/captcha\.php?user=([^"]+))"></td>' diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py index f1f8cd90a..235ad2434 100644 --- a/module/plugins/hoster/TusfilesNet.py +++ b/module/plugins/hoster/TusfilesNet.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class TusfilesNet(XFSHoster): __name__ = "TusfilesNet" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'https?://(?:www\.)?tusfiles\.net/\w{12}' @@ -18,7 +18,7 @@ class TusfilesNet(XFSHoster): HOSTER_DOMAIN = "tusfiles.net" - INFO_PATTERN = r'\](?P<N>.+) - (?P<S>[\d.,]+) (?P<U>[\w^_]+)\[' + INFO_PATTERN = r'\](?P<N>.+) - (?P<S>[\d.,]+) (?P<U>[\w^_]+)\[' OFFLINE_PATTERN = r'>File Not Found|<Title>TusFiles - Fast Sharing Files!|The file you are trying to download is no longer available' diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 69be6833c..67b384c5f 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" - __version__ = "0.62" + __version__ = "0.63" __pattern__ = r'(?P<HOST>http://www\d{0,2}\.zippyshare\.com)/v(?:/|iew\.jsp.*key=)(?P<KEY>\d+)' -- cgit v1.2.3 From 3d27f5ccee412d38102873a5b02e3f236375eb97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 03:44:15 +0100 Subject: Update plugins (2) --- module/plugins/hooks/RestartSlow.py | 4 +-- module/plugins/hooks/SkipRev.py | 6 ++-- module/plugins/hoster/FilerNet.py | 22 +++++++++------ module/plugins/hoster/SendspaceCom.py | 4 +-- module/plugins/hoster/ShareonlineBiz.py | 2 +- module/plugins/internal/MultiHoster.py | 50 ++++++++++++++++++--------------- 6 files changed, 49 insertions(+), 39 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py index 587799235..c2fdf6f95 100644 --- a/module/plugins/hooks/RestartSlow.py +++ b/module/plugins/hooks/RestartSlow.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class RestartSlow(Hook): __name__ = "RestartSlow" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("free_limit" , "int" , "Transfer speed threshold in kilobytes" , 100 ), ("free_time" , "int" , "Sample interval in minutes" , 5 ), @@ -45,7 +45,7 @@ class RestartSlow(Hook): limit = max(5, self.getConfig("%s_limit" % type) * 1024) chunks = [chunk for chunk in self.pyfile.req.dl.chunks \ - if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] not is (time, limit)] + if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] is not (time, limit)] for chunk in chunks: chunk.c.setopt(pycurl.LOW_SPEED_TIME , time) diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 107740a3d..d21aa0f6d 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -45,13 +45,13 @@ class SkipRev(Hook): else: self.logWarning("Unable to grab file name") - name = urlparse(unquote(url)).path.split('/')[-1]) + name = urlparse(unquote(url)).path.split('/')[-1] return name def downloadPreparing(self, pyfile): - if pyfile.getStatusName() is "unskipped" or not pyname(pyfile).endswith(".rev"): + if pyfile.getStatusName() is "unskipped" or not self.pyname(pyfile).endswith(".rev"): return tokeep = self.getConfig("tokeep") diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 5dd72efe7..5a33439d2 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -4,6 +4,7 @@ # http://filer.net/get/ivgf5ztw53et3ogd # http://filer.net/get/hgo14gzcng3scbvv +import pycurl import re from urlparse import urljoin @@ -15,13 +16,13 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' __description__ = """Filer.net hoster plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it") + __authors__ = [("stickell", "l.stickell@yahoo.it"), ("Walter Purcaro", "vuolter@gmail.com")] @@ -57,15 +58,18 @@ class FilerNet(SimpleHoster): for _i in xrange(5): challenge, response = recaptcha.challenge() - header = self.load(self.pyfile.url, - post={'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response, - 'hash' : inputs['hash']}) + #@NOTE: Work-around for v0.4.9 just_header issue + #@TODO: Check for v0.4.10 + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) + self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response, + 'hash' : inputs['hash']})) + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) - if 'location' in header and header['location']: + if 'location' in self.req.http.header.lower(): + self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1) self.correctCaptcha() - self.link = header['location'] - return + break else: self.invalidCaptcha() diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 630a85cc4..12f966e31 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -8,9 +8,9 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SendspaceCom(SimpleHoster): __name__ = "SendspaceCom" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" - __pattern__ = r'https?://(?:www\.)?sendspace\.com/file/.*' + __pattern__ = r'https?://(?:www\.)?sendspace\.com/file/\w+' __description__ = """Sendspace.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 1cb651b12..c40e8560f 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -48,7 +48,7 @@ class ShareonlineBiz(SimpleHoster): if field[1] == "OK": info['fileid'] = field[0] info['status'] = 2 - info['name'] = field[2] + info['name'] = field[2] info['size'] = field[3] #: in bytes info['md5'] = field[4].strip().lower().replace("\n\n", "") #: md5 diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index 6ec2e4b82..6d10d17d9 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -9,7 +9,7 @@ from module.utils import remove_chars class MultiHoster(Hook): __name__ = "MultiHoster" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __description__ = """Generic MultiHoster plugin""" __license__ = "GPLv3" @@ -18,12 +18,18 @@ class MultiHoster(Hook): interval = 12 * 60 * 60 #: reload hosters every 12h - HOSTER_REPLACEMENTS = [("1fichier.com", "onefichier.com"), ("2shared.com", "twoshared.com"), - ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"), - ("easy-share.com", "crocko.com"), ("freakshare.net", "freakshare.com"), - ("hellshare.com", "hellshare.cz"), ("ifile.it", "filecloud.io"), - ("putlocker.com", "firedrive.com"), ("share-rapid.cz", "multishare.cz"), - ("sharerapid.cz", "multishare.cz"), ("ul.to", "uploaded.to"), + HOSTER_REPLACEMENTS = [("1fichier.com", "onefichier.com"), + ("2shared.com", "twoshared.com"), + ("4shared.com", "fourshared.com"), + ("cloudnator.com", "shragle.com"), + ("easy-share.com", "crocko.com"), + ("freakshare.net", "freakshare.com"), + ("hellshare.com", "hellshare.cz"), + ("ifile.it", "filecloud.io"), + ("putlocker.com", "firedrive.com"), + ("share-rapid.cz", "multishare.cz"), + ("sharerapid.cz", "multishare.cz"), + ("ul.to", "uploaded.to"), ("uploaded.net", "uploaded.to")] HOSTER_EXCLUDED = [] @@ -152,9 +158,9 @@ class MultiHoster(Hook): # inject plugin plugin self.logDebug("Overwritten Hosters", ", ".join(sorted(self.supported))) for hoster in self.supported: - dict = self.core.pluginManager.hosterPlugins[hoster] - dict['new_module'] = module - dict['new_name'] = self.__name__ + hdict = self.core.pluginManager.hosterPlugins[hoster] + hdict['new_module'] = module + hdict['new_name'] = self.__name__ if excludedList: self.logInfo(_("The following hosters were not overwritten - account exists"), ", ".join(sorted(excludedList))) @@ -169,19 +175,19 @@ class MultiHoster(Hook): self.logDebug("Regexp", regexp) - dict = self.core.pluginManager.hosterPlugins[self.__name__] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) + hdict = self.core.pluginManager.hosterPlugins[self.__name__] + hdict['pattern'] = regexp + hdict['re'] = re.compile(regexp) def unloadHoster(self, hoster): - dict = self.core.pluginManager.hosterPlugins[hoster] - if "module" in dict: - del dict['module'] + hdict = self.core.pluginManager.hosterPlugins[hoster] + if "module" in hdict: + del hdict['module'] - if "new_module" in dict: - del dict['new_module'] - del dict['new_name'] + if "new_module" in hdict: + del hdict['new_module'] + del hdict['new_name'] def unload(self): @@ -191,9 +197,9 @@ class MultiHoster(Hook): # reset pattern klass = getattr(self.core.pluginManager.getPlugin(self.__name__), self.__name__) - dict = self.core.pluginManager.hosterPlugins[self.__name__] - dict['pattern'] = getattr(klass, "__pattern__", r'^unmatchable$') - dict['re'] = re.compile(dict['pattern']) + hdict = self.core.pluginManager.hosterPlugins[self.__name__] + hdict['pattern'] = getattr(klass, "__pattern__", r'^unmatchable$') + hdict['re'] = re.compile(hdict['pattern']) def downloadFailed(self, pyfile): -- cgit v1.2.3 From f2da6bca43b619121df3f76fd27c98fa662c49db Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 14:54:12 +0100 Subject: [UnrestrictLi] Fix secondsToMidnight on python 2.5 & 2.6 --- module/plugins/hoster/UnrestrictLi.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 94ce1b845..615409dab 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -10,18 +10,26 @@ from module.plugins.Hoster import Hoster def secondsToMidnight(gmt=0): now = datetime.utcnow() + timedelta(hours=gmt) + if now.hour is 0 and now.minute < 10: midnight = now else: midnight = now + timedelta(days=1) - midnight = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - return int((midnight - now).total_seconds()) + + dt = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now + + if hasattr(dt, 'total_seconds'): + res = dt.total_seconds() + else: + res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 + + return int(res) class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' -- cgit v1.2.3 From d4b3941f2a494eb42a7d80ef825a57ad083ce29e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 14:57:35 +0100 Subject: [UnrestrictLi] Fix secondsToMidnight on python 2.5 & 2.6 (2) --- module/plugins/hoster/UnrestrictLi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 615409dab..d5c3ddc15 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -16,10 +16,10 @@ def secondsToMidnight(gmt=0): else: midnight = now + timedelta(days=1) - dt = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now + td = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now - if hasattr(dt, 'total_seconds'): - res = dt.total_seconds() + if hasattr(td, 'total_seconds'): + res = td.total_seconds() else: res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 @@ -29,7 +29,7 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' -- cgit v1.2.3 From 07792444b38d993eb698fe0f1db4a6bc59cb486a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 15:23:11 +0100 Subject: [UploadableCh] Fixup (thx user01) --- module/plugins/hoster/UploadableCh.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 3dd796900..1310ded36 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UploadableCh(SimpleHoster): __name__ = "UploadableCh" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'http://(?:www\.)?uploadable\.ch/file/(?P<ID>\w+)' @@ -21,14 +21,16 @@ class UploadableCh(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] + FILE_URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.uploadable.ch/file/\g<ID>')] + FILE_INFO_PATTERN = r'div id=\"file_name\" title=.*>(?P<N>.+)<span class=\"filename_normal\">\((?P<S>[\d.]+) (?P<U>\w+)\)</span><' OFFLINE_PATTERN = r'>(File not available|This file is no longer available)' TEMP_OFFLINE_PATTERN = r'<div class="icon_err">' - WAIT_PATTERN = r'data-time="(\d+)" data-format' + WAIT_PATTERN = r'>Please wait.+?<' - FILE_URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.uploadable.ch/file/\g<ID>')] + RECAPTCHA_KEY = "6LdlJuwSAAAAAPJbPIoUhyqOJd7-yrah5Nhim5S3" def setup(self): @@ -41,11 +43,7 @@ class UploadableCh(SimpleHoster): a = self.load(self.pyfile.url, cookies=True, post={'downloadLink': "wait"}, decode=True) self.logDebug(a) - m = re.search(self.WAIT_PATTERN, a) - if m is not None: - self.wait(int(m.group(1))) #: Expected output: {"waitTime":30} - else: - self.error("WAIT_PATTERN") + self.wait(30) # Make the recaptcha appear and show it the pyload interface b = self.load(self.pyfile.url, cookies=True, post={'checkDownload': "check"}, decode=True) @@ -60,7 +58,7 @@ class UploadableCh(SimpleHoster): cookies=True, post={'recaptcha_challenge_field' : challenge, 'recaptcha_response_field' : response, - 'recaptcha_shortencode_field': self.info['ID']}, + 'recaptcha_shortencode_field': self.info['pattern']['ID']}, decode=True) self.wait(3) -- cgit v1.2.3 From 608af3e22f15a36ba7a3efab1886f5827fd6741e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:00:32 +0100 Subject: [Keep2shareCc] Fix captcha_url --- module/plugins/hoster/Keep2shareCc.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py index d98fa3c09..0d06a74c7 100644 --- a/module/plugins/hoster/Keep2shareCc.py +++ b/module/plugins/hoster/Keep2shareCc.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import _isDirectLink, SimpleHoster, cr class Keep2shareCc(SimpleHoster): __name__ = "Keep2shareCc" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P<ID>\w+)' @@ -99,7 +99,7 @@ class Keep2shareCc(SimpleHoster): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: - captcha_url = urljoin(self.base, m.group(1)) + captcha_url = urljoin("http://k2s.cc/", m.group(1)) post_data['CaptchaForm[code]'] = self.decryptCaptcha(captcha_url) else: challenge, response = recaptcha.challenge() @@ -121,12 +121,10 @@ class Keep2shareCc(SimpleHoster): if not link: return - p = urlparse(self.pyfile.url) - base = "%s://%s" % (p.scheme, p.netloc) link = _isDirectLink(self, link, self.premium) if link: - self.download(urljoin(base, link), disposition=True) + self.download(urljoin("http://k2s.cc/", link), disposition=True) getInfo = create_getInfo(Keep2shareCc) -- cgit v1.2.3 From f633832bbfce04f4b1b83e59c02701483ef03525 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:01:43 +0100 Subject: [XFSHoster] Improve SIZE_PATTERN --- module/plugins/internal/XFSHoster.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index 3ae0692dc..bb4baa274 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -16,7 +16,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.27" + __version__ = "0.28" __pattern__ = r'^unmatchable$' @@ -36,7 +36,7 @@ class XFSHoster(SimpleHoster): MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy... NAME_PATTERN = r'(>Filename:</b></td><td nowrap>|name="fname" value="|<span class="name">)(?P<N>.+?)(\s*<|")' - SIZE_PATTERN = r'(>Size:</b></td><td>|>File:.*>|<span class="size">)(?P<S>[\d.,]+)\s*(?P<U>[\w^_]+)' + SIZE_PATTERN = r'(>Size:</b></td><td>|>File:.*>|</font>\s*\(|<span class="size">)(?P<S>[\d.,]+)\s*(?P<U>[\w^_]+)' OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' @@ -199,13 +199,7 @@ class XFSHoster(SimpleHoster): def checkErrors(self): - m = re.search(self.PREMIUM_ONLY_PATTERN, self.html) - if m: - self.info['error'] = "premium-only" - return - m = re.search(self.ERROR_PATTERN, self.html) - if m is None: self.errmsg = None else: -- cgit v1.2.3 From b18bf426955d85d6cb3d046aa8b074dfe56340c1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:02:20 +0100 Subject: [UnZip] Password support --- module/plugins/internal/UnZip.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py index 053946dbe..52e279ccf 100644 --- a/module/plugins/internal/UnZip.py +++ b/module/plugins/internal/UnZip.py @@ -3,12 +3,12 @@ import sys import zipfile -from module.plugins.internal.AbstractExtractor import AbtractExtractor +from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError class UnZip(AbtractExtractor): __name__ = "UnZip" - __version__ = "0.10" + __version__ = "0.11" __description__ = """Zip extractor plugin""" __license__ = "GPLv3" @@ -32,9 +32,19 @@ class UnZip(AbtractExtractor): def extract(self, progress, password=None): - z = zipfile.ZipFile(self.file) - self.files = z.namelist() - z.extractall(self.out) + try: + z = zipfile.ZipFile(self.file) + self.files = z.namelist() + z.extractall(self.out, pwd=password) + + except (BadZipfile, LargeZipFile), e: + raise ArchiveError(e) + + except RuntimeError, e: + if e is "Bad password for file": + raise WrongPassword + else: + raise ArchiveError(e) def getDeleteFiles(self): -- cgit v1.2.3 From a51d35534fc38650dd7714572f6874ab262bd119 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:03:05 +0100 Subject: [SimpleHoster] Improve and fix --- module/plugins/internal/SimpleHoster.py | 58 +++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 24 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 992454451..86d9b4c9a 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -99,14 +99,24 @@ def parseHtmlForm(attr_str, html, input_names={}): #: Deprecated def parseFileInfo(plugin, url="", html=""): - info = plugin.getInfo(url, html) - return info['name'], info['size'], info['status'], info['url'] + if hasattr(plugin, "getInfo"): + info = plugin.getInfo(url, html) + res = info['name'], info['size'], info['status'], info['url'] + else: + res = urlparse(unquote(url)).path.split('/')[-1] or _("Unknown"), 0, 3, url + + return res #@TODO: Remove in 0.4.10 #@NOTE: Every plugin must have own parseInfos classmethod to work with 0.4.10 def create_getInfo(plugin): - return lambda urls: [(info['name'], info['size'], info['status'], info['url']) for info in plugin.parseInfos(urls)] + if hasattr(plugin, "parseInfos"): + fn = lambda urls: [(info['name'], info['size'], info['status'], info['url']) for info in plugin.parseInfos(urls)] + else: + fn = lambda urls: [parseFileInfo(url) for url in urls] + + return fn def timestamp(): @@ -144,7 +154,7 @@ def _isDirectLink(self, url, resumable=True): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "0.73" + __version__ = "0.74" __pattern__ = r'^unmatchable$' @@ -260,18 +270,18 @@ class SimpleHoster(Hoster): try: info['pattern'] = re.match(cls.__pattern__, url).groupdict() #: pattern groups will be saved here, please save api stuff to info['api'] except: - pass + info['pattern'] = {} for pattern in ("FILE_INFO_PATTERN", "INFO_PATTERN", "FILE_NAME_PATTERN", "NAME_PATTERN", "FILE_SIZE_PATTERN", "SIZE_PATTERN", "HASHSUM_PATTERN"): #@TODO: Remove old patterns starting with "FILE_" in 0.4.10 try: - attr = getattr(cls, pattern) - dict = re.search(attr, html).groupdict() + attr = getattr(cls, pattern) + pdict = re.search(attr, html).groupdict() - if all(True for k in dict if k not in info['pattern']): - info['pattern'].update(dict) + if all(True for k in pdict if k not in info['pattern']): + info['pattern'].update(pdict) except AttributeError: continue @@ -279,6 +289,9 @@ class SimpleHoster(Hoster): else: online = True + if not info['pattern']: + info.pop('pattern', None) + if online: info['status'] = 2 @@ -360,18 +373,21 @@ class SimpleHoster(Hoster): if self.html is None: self.fail(_("No html retrieved")) - self.checkErrors() - - premium_only = 'error' in self.info and self.info['error'] == "premium-only" - - self._updateInfo(self.getInfo(pyfile.url, self.html)) + self.updateInfo(self.getInfo(pyfile.url, self.html)) self.checkNameSize() + if hasattr(self, 'PREMIUM_ONLY_PATTERN'): + premium_only = re.search(self.PREMIUM_ONLY_PATTERN, self.html) + else: + premium_only = False + #: Usually premium only pages doesn't show any file information if not premium_only: self.checkStatus() + self.checkErrors() + if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): self.logDebug("Handled as premium download") self.handlePremium() @@ -406,18 +422,12 @@ class SimpleHoster(Hoster): errmsg = self.info['error'] = m.group(1) self.error(errmsg) - if hasattr(self, 'PREMIUM_ONLY_PATTERN'): - m = re.search(self.PREMIUM_ONLY_PATTERN, self.html) - if m: - self.info['error'] = "premium-only" - return - if hasattr(self, 'WAIT_PATTERN'): m = re.search(self.WAIT_PATTERN, self.html) if m: wait_time = sum([int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)]) - self.wait(wait_time, True if wait_time > 300 else False) + self.wait(wait_time, wait_time > 300) return self.info.pop('error', None) @@ -460,7 +470,7 @@ class SimpleHoster(Hoster): def checkInfo(self): self.checkErrors() - self._updateInfo(self.getInfo(self.pyfile.url, self.html or "")) + self.updateInfo(self.getInfo(self.pyfile.url, self.html or "")) self.checkNameSize() self.checkStatus() @@ -473,7 +483,7 @@ class SimpleHoster(Hoster): return self.info - def _updateInfo(self, info): + def updateInfo(self, info): self.logDebug(_("File info (before update): %s") % self.info) self.info.update(info) self.logDebug(_("File info (after update): %s") % self.info) @@ -487,7 +497,7 @@ class SimpleHoster(Hoster): self.link = link - self._updateInfo(self.getInfo(self.pyfile.url)) + self.updateInfo(self.getInfo(self.pyfile.url)) self.checkNameSize() else: self.logDebug(_("Direct download link not found")) -- cgit v1.2.3 From bc47c7282b093eabe70d7a04bb481789e4cebf65 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:03:48 +0100 Subject: [SkipRev] Another fix --- module/plugins/hooks/SkipRev.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index d21aa0f6d..0c38ac9af 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -57,7 +57,7 @@ class SkipRev(Hook): tokeep = self.getConfig("tokeep") if tokeep: - saved = [True for link in pyfile.package().getChildren() \ + saved = [True for link in self.core.api.getPackageData(pyfile.packageid).links \ if link.name.endswith(".rev") and (link.hasStatus("finished") or link.hasStatus("downloading"))].count(True) if not saved or saved < tokeep: #: keep one rev at least in auto mode @@ -73,7 +73,7 @@ class SkipRev(Hook): if not tokeep: return - for link in pyfile.package().getChildren(): + for link in self.core.api.getPackageData(pyfile.packageid).links: if link.hasStatus("skipped") and link.name.endswith(".rev"): if tokeep > -1 or pyfile.name.endswith(".rev"): link.setStatus("queued") -- cgit v1.2.3 From 8bb189cf5495b293cf574e5049c34a64ae36ffe1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 16 Dec 2014 23:04:15 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/ExtractArchive.py | 18 +++++++++--------- module/plugins/hoster/UnrestrictLi.py | 2 +- module/plugins/internal/UnRar.py | 9 +++++---- 3 files changed, 15 insertions(+), 14 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index fc77dbdf6..895aee51f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -195,6 +195,7 @@ class ExtractArchive(Hook): if targets: self.logDebug("Targets for %s: %s" % (plugin.__name__, targets)) matched = True + for target, fid in targets: if target in processed: self.logDebug(basename(target), "skipped") @@ -206,8 +207,10 @@ class ExtractArchive(Hook): try: klass = plugin(self, target, out, fullpath, overwrite, excludefiles, renice) klass.init() - password = p.password.strip().splitlines() - new_files = self._extract(klass, fid, password, thread) + + passwords = p.password.strip().splitlines() + new_files = self._extract(klass, fid, passwords, thread) + except Exception, e: self.logError(basename(target), e) success = False @@ -256,13 +259,7 @@ class ExtractArchive(Hook): self.logInfo(basename(plugin.file), _("Password protected")) self.logDebug("Passwords", passwords) - pwlist = copy(self.getPasswords()) - # remove already supplied pws from list (only local) - for pw in passwords: - if pw in pwlist: - pwlist.remove(pw) - - for pw in passwords + pwlist: + for pw in set(passwords) + set(self.getPasswords()): try: self.logDebug("Try password", pw) if plugin.checkPassword(pw): @@ -270,6 +267,7 @@ class ExtractArchive(Hook): self.addPassword(pw) success = True break + except WrongPassword: self.logDebug("Password was wrong") @@ -297,8 +295,10 @@ class ExtractArchive(Hook): except ArchiveError, e: self.logError(basename(plugin.file), _("Archive Error"), e) + except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) + except Exception, e: if self.core.debug: print_exc() diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index d5c3ddc15..786e25a9a 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -20,7 +20,7 @@ def secondsToMidnight(gmt=0): if hasattr(td, 'total_seconds'): res = td.total_seconds() - else: + else: #@NOTE: work-around for python 2.5 and 2.6 missing timedelta.total_seconds res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 return int(res) diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index c15a4c96e..716a62613 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -22,7 +22,7 @@ def renice(pid, value): class UnRar(AbtractExtractor): __name__ = "UnRar" - __version__ = "0.19" + __version__ = "0.20" __description__ = """Rar extractor plugin""" __license__ = "GPLv3" @@ -32,7 +32,7 @@ class UnRar(AbtractExtractor): CMD = "unrar" # there are some more uncovered rar formats - re_version = re.compile(r'UNRAR ([\w .]+?) freeware') + re_version = re.compile(r'UNRAR ([\w .]+?)') re_splitfile = re.compile(r'(.*)\.part(\d+)\.rar$', re.I) re_partfiles = re.compile(r'.*\.(rar|r\d+)', re.I) re_filelist = re.compile(r'(.+)\s+(\d+)\s+(\d+)\s+') @@ -91,7 +91,7 @@ class UnRar(AbtractExtractor): out, err = p.communicate() if self.re_wrongpwd.search(err): self.passwordProtected = True - self.headerProtected = True + self.headerProtected = True return True # output only used to check if passworded files are present @@ -124,7 +124,7 @@ class UnRar(AbtractExtractor): return True - def extract(self, progress, password=None): + def extract(self, progress, password=""): command = "x" if self.fullpath else "e" p = self.call_unrar(command, self.file, self.out, password=password) @@ -156,6 +156,7 @@ class UnRar(AbtractExtractor): raise CRCError elif "CRC failed" in err: raise WrongPassword + if err.strip(): #: raise error if anything is on stderr raise ArchiveError(err.strip()) if p.returncode: -- cgit v1.2.3 From aab32f731e0b5c996004312ee8862fe30cbd6b89 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 17 Dec 2014 02:40:59 +0100 Subject: [FilerNet] Typo --- module/plugins/hoster/FilerNet.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 5a33439d2..2a38ac470 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -63,7 +63,7 @@ class FilerNet(SimpleHoster): self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response, - 'hash' : inputs['hash']})) + 'hash' : inputs['hash']}) self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) if 'location' in self.req.http.header.lower(): @@ -75,10 +75,8 @@ class FilerNet(SimpleHoster): def downloadLink(self, link): - if not link: - return - - self.download(urljoin("http://filer.net/", link), disposition=True) + if link and isinstance(link, basestring): + self.download(urljoin("http://filer.net/", link), disposition=True) getInfo = create_getInfo(FilerNet) -- cgit v1.2.3 From 57300575fa97107d172e0c9909b244c8c8ae6c12 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 17 Dec 2014 20:02:20 +0100 Subject: Extend SimpleHoster in multi-hoster plugins --- module/plugins/hoster/AlldebridCom.py | 74 ++++++++++---------- module/plugins/hoster/DebridItaliaCom.py | 37 ++++------ module/plugins/hoster/FastixRu.py | 48 ++++++------- module/plugins/hoster/FreeWayMe.py | 20 +++--- module/plugins/hoster/Keep2shareCc.py | 2 +- module/plugins/hoster/LinksnappyCom.py | 63 ++++++++--------- module/plugins/hoster/MegaDebridEu.py | 28 ++++---- module/plugins/hoster/MultishareCz.py | 33 +++------ module/plugins/hoster/MyfastfileCom.py | 44 ++++++------ module/plugins/hoster/OverLoadMe.py | 58 ++++++++-------- module/plugins/hoster/PremiumTo.py | 24 +++---- module/plugins/hoster/PremiumizeMe.py | 32 +++++---- module/plugins/hoster/RPNetBiz.py | 109 +++++++++++++++--------------- module/plugins/hoster/RealdebridCom.py | 78 ++++++++++----------- module/plugins/hoster/RehostTo.py | 20 +++--- module/plugins/hoster/SimplyPremiumCom.py | 109 ++++++++++++++---------------- module/plugins/hoster/SimplydebridCom.py | 53 +++++++-------- module/plugins/hoster/UnrestrictLi.py | 85 ++++++++++++----------- module/plugins/hoster/ZeveraCom.py | 26 +++---- 19 files changed, 442 insertions(+), 501 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index bdd8ccdff..8a4e31986 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -6,14 +6,14 @@ from random import randrange from urllib import unquote from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import parseFileSize -class AlldebridCom(Hoster): +class AlldebridCom(SimpleHoster): __name__ = "AlldebridCom" __type__ = "hoster" - __version__ = "0.34" + __version__ = "0.35" __pattern__ = r'https?://(?:[^/]*\.)?alldebrid\..*' @@ -33,55 +33,51 @@ class AlldebridCom(Hoster): def setup(self): - self.chunkLimit = 16 + self.chunkLimit = 16 self.resumeDownload = True - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid") - self.fail(_("No AllDebrid account provided")) - else: - self.logDebug("Old URL: %s" % pyfile.url) - password = self.getPassword().splitlines()[0] or "" + def handleMulti(self): + password = self.getPassword().splitlines()[0] or "" - data = json_loads(self.load("http://www.alldebrid.com/service.php", - get={'link': pyfile.url, 'json': "true", 'pw': password})) + data = json_loads(self.load("http://www.alldebrid.com/service.php", + get={'link': self.pyfile.url, 'json': "true", 'pw': password})) - self.logDebug("Json data", data) + self.logDebug("Json data", data) - if data['error']: - if data['error'] == "This link isn't available on the hoster website.": - self.offline() - else: - self.logWarning(data['error']) - self.tempOffline() + if data['error']: + if data['error'] == "This link isn't available on the hoster website.": + self.offline() else: - if pyfile.name and not pyfile.name.endswith('.tmp'): - pyfile.name = data['filename'] - pyfile.size = parseFileSize(data['filesize']) - new_url = data['link'] + self.logWarning(data['error']) + self.tempOffline() + else: + if self.pyfile.name and not self.pyfile.name.endswith('.tmp'): + self.pyfile.name = data['filename'] + self.pyfile.size = parseFileSize(data['filesize']) + self.link = data['link'] if self.getConfig("https"): - new_url = new_url.replace("http://", "https://") + self.link = self.link.replace("http://", "https://") else: - new_url = new_url.replace("https://", "http://") + self.link = self.link.replace("https://", "http://") - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) + if self.link != self.pyfile.url: + self.logDebug("New URL: %s" % self.link) - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): + if self.pyfile.name.startswith("http") or self.pyfile.name.startswith("Unknown"): #only use when name wasnt already set - pyfile.name = self.getFilename(new_url) + self.pyfile.name = self.getFilename(self.link) + + + def checkFile(self): + check = self.checkDownload({'error': "<title>An error occured while processing your request", + 'empty': re.compile(r"^$")}) - self.download(new_url, disposition=True) + if check == "error": + self.retry(wait_time=60, reason=_("An error occured while generating link")) + elif check == "empty": + self.retry(wait_time=60, reason=_("Downloaded File was empty")) - check = self.checkDownload({'error': "An error occured while processing your request", - 'empty': re.compile(r"^$")}) - if check == "error": - self.retry(wait_time=60, reason=_("An error occured while generating link")) - elif check == "empty": - self.retry(wait_time=60, reason=_("Downloaded File was empty")) +getInfo = create_getInfo(AlldebridCom) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 17342b8cd..da52c080b 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -2,14 +2,13 @@ import re -from module.plugins.Hoster import Hoster -from module.plugins.internal.SimpleHoster import replace_patterns +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class DebridItaliaCom(Hoster): +class DebridItaliaCom(SimpleHoster): __name__ = "DebridItaliaCom" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.09" __pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+' @@ -19,35 +18,25 @@ class DebridItaliaCom(Hoster): ("Walter Purcaro", "vuolter@gmail.com")] - URL_REPLACEMENTS = [(r'(/dl/\d+)$', '\1/')] - - def setup(self): self.chunkLimit = -1 self.resumeDownload = True - def process(self, pyfile): - pyfile.url = replace_patterns(pyfile.url, cls.URL_REPLACEMENTS) - - if re.match(self.__pattern__, pyfile.url): - link = pyfile.url - - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia") - self.fail(_("No DebridItalia account provided")) + def handleMulti(self): + html = self.load("http://www.debriditalia.com/api.php", + get={'generate': "on", 'link': self.pyfile.url, 'p': self.getPassword()}) - else: - html = self.load("http://www.debriditalia.com/api.php", get={'generate': "", 'link': pyfile.url}) + if "ERROR" in html: + self.fail(re.search(r'ERROR:(.*)', html).strip()) - if "ERROR" in html: - self.fail(re.search(r'ERROR:(.*)', html).strip()) + self.link = html.strip() - link = html.strip() - - self.download(link, disposition=True) + def checkFile(self): check = self.checkDownload({'empty': re.compile(r'^$')}) - if check == "empty": self.retry(5, 2 * 60, "Empty file downloaded") + + +getInfo = create_getInfo(DebridItaliaCom) diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 1e47638ea..a4e7338fe 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -6,10 +6,10 @@ from random import randrange from urllib import unquote from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class FastixRu(Hoster): +class FastixRu(SimpleHoster): __name__ = "FastixRu" __type__ = "hoster" __version__ = "0.04" @@ -32,41 +32,34 @@ class FastixRu(Hoster): def setup(self): - self.chunkLimit = 3 + self.chunkLimit = 3 self.resumeDownload = True - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix") - self.fail(_("No Fastix account provided")) - else: - self.logDebug("Old URL: %s" % pyfile.url) - api_key = self.account.getAccountData(self.user) - api_key = api_key['api'] + def handleMulti(self): + api_key = self.account.getAccountData(self.user) + api_key = api_key['api'] - page = self.load("http://fastix.ru/api_v2/", - get={'apikey': api_key, 'sub': "getdirectlink", 'link': pyfile.url}) - data = json_loads(page) + page = self.load("http://fastix.ru/api_v2/", + get={'apikey': api_key, 'sub': "getdirectlink", 'link': self.pyfile.url}) + data = json_loads(page) - self.logDebug("Json data", data) + self.logDebug("Json data", data) - if "error\":true" in page: - self.offline() - else: - new_url = data['downloadlink'] + if "error\":true" in page: + self.offline() + else: + self.link = data['downloadlink'] - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) + if self.link != self.pyfile.url: + self.logDebug("New URL: %s" % self.link) - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): + if self.pyfile.name.startswith("http") or self.pyfile.name.startswith("Unknown"): #only use when name wasnt already set - pyfile.name = self.getFilename(new_url) + self.pyfile.name = self.getFilename(self.link) - self.download(new_url, disposition=True) + def checkFile(self): check = self.checkDownload({"error": "An error occurred while processing your request", "empty": re.compile(r"^$")}) @@ -74,3 +67,6 @@ class FastixRu(Hoster): self.retry(wait_time=60, reason=_("An error occurred while generating link")) elif check == "empty": self.retry(wait_time=60, reason=_("Downloaded File was empty")) + + +getInfo = create_getInfo(FastixRu) diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py index a27dc04b8..531b49726 100644 --- a/module/plugins/hoster/FreeWayMe.py +++ b/module/plugins/hoster/FreeWayMe.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class FreeWayMe(Hoster): +class FreeWayMe(SimpleHoster): __name__ = "FreeWayMe" __type__ = "hoster" __version__ = "0.11" @@ -21,16 +21,14 @@ class FreeWayMe(Hoster): self.chunkLimit = 1 - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "FreeWayMe") - self.fail(_("No FreeWay account provided")) - - self.logDebug("Old URL: %s" % pyfile.url) - - (user, data) = self.account.selectAccount() + def handleMulti(self): + user, data = self.account.selectAccount() + self.link = True self.download( "https://www.free-way.me/load.php", - get={"multiget": 7, "url": pyfile.url, "user": user, "pw": self.account.getpw(user), "json": ""}, + get={"multiget": 7, "url": self.pyfile.url, "user": user, "pw": self.account.getpw(user), "json": ""}, disposition=True) + + +getInfo = create_getInfo(FreeWayMe) diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py index 0d06a74c7..86c28e93b 100644 --- a/module/plugins/hoster/Keep2shareCc.py +++ b/module/plugins/hoster/Keep2shareCc.py @@ -118,7 +118,7 @@ class Keep2shareCc(SimpleHoster): def downloadLink(self, link): - if not link: + if not link or not isinstance(link, basestring): return link = _isDirectLink(self, link, self.premium) diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index b8694e141..1f97fab31 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -5,10 +5,10 @@ import re from urlparse import urlsplit from module.common.json_layer import json_loads, json_dumps -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class LinksnappyCom(Hoster): +class LinksnappyCom(SimpleHoster): __name__ = "LinksnappyCom" __type__ = "hoster" __version__ = "0.02" @@ -24,48 +24,42 @@ class LinksnappyCom(Hoster): def setup(self): - self.chunkLimit = -1 + self.chunkLimit = -1 self.resumeDownload = True - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Linksnappy.com") - self.fail(_("No Linksnappy.com account provided")) - else: - self.logDebug("Old URL: %s" % pyfile.url) - host = self._get_host(pyfile.url) - json_params = json_dumps({'link': pyfile.url, - 'type': host, - 'username': self.user, - 'password': self.account.getAccountData(self.user)['password']}) - r = self.load('http://gen.linksnappy.com/genAPI.php', - post={'genLinks': json_params}) - self.logDebug("JSON data: " + r) + def handleMulti(self): + host = self._get_host(self.pyfile.url) + json_params = json_dumps({'link': self.pyfile.url, + 'type': host, + 'username': self.user, + 'password': self.account.getAccountData(self.user)['password']}) + r = self.load('http://gen.linksnappy.com/genAPI.php', + post={'genLinks': json_params}) + self.logDebug("JSON data: " + r) - j = json_loads(r)['links'][0] + j = json_loads(r)['links'][0] - if j['error']: - msg = _("Error converting the link") - self.logError(msg, j['error']) - self.fail(msg) + if j['error']: + msg = _("Error converting the link") + self.logError(msg, j['error']) + self.fail(msg) - pyfile.name = j['filename'] - new_url = j['generated'] + self.pyfile.name = j['filename'] + self.link = j['generated'] - if host in self.SINGLE_CHUNK_HOSTERS: - self.chunkLimit = 1 - else: - self.setup() + if host in self.SINGLE_CHUNK_HOSTERS: + self.chunkLimit = 1 + else: + self.setup() - if new_url != pyfile.url: - self.logDebug("New URL: " + new_url) + if self.link != self.pyfile.url: + self.logDebug("New URL: " + self.link) - self.download(new_url, disposition=True) + def checkFile(self): check = self.checkDownload({"html302": "302 Found"}) + if check == "html302": self.retry(wait_time=5, reason=_("Linksnappy returns only HTML data")) @@ -74,3 +68,6 @@ class LinksnappyCom(Hoster): def _get_host(url): host = urlsplit(url).netloc return re.search(r'[\w-]+\.\w+$', host).group(0) + + +getInfo = create_getInfo(LinksnappyCom) diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index f63a7b3c6..f6696a1ed 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -5,10 +5,10 @@ import re from urllib import unquote_plus from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class MegaDebridEu(Hoster): +class MegaDebridEu(SimpleHoster): __name__ = "MegaDebridEu" __type__ = "hoster" __version__ = "0.40" @@ -30,23 +30,16 @@ class MegaDebridEu(Hoster): return "" - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.exitOnFail("Please enter your %s account or deactivate this plugin" % "Mega-debrid.eu") - else: - if not self.connectToApi(): - self.exitOnFail("Unable to connect to Mega-debrid.eu") + def handleMulti(self): + if not self.connectToApi(): + self.exitOnFail("Unable to connect to Mega-debrid.eu") - self.logDebug("Old URL: %s" % pyfile.url) - new_url = self.debridLink(pyfile.url) - self.logDebug("New URL: " + new_url) + self.link = self.debridLink(self.pyfile.url) + self.logDebug("New URL: " + self.link) - filename = self.getFilename(new_url) + filename = self.getFilename(self.link) if filename != "": - pyfile.name = filename - self.download(new_url, disposition=True) + self.pyfile.name = filename def connectToApi(self): @@ -92,3 +85,6 @@ class MegaDebridEu(Hoster): self.resetAccount() else: self.fail(_(msg)) + + +getInfo = create_getInfo(MegaDebridEu) diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index fc866e2b1..d7ddb753c 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -27,23 +27,8 @@ class MultishareCz(SimpleHoster): OFFLINE_PATTERN = ur'

Stáhnout soubor

Požadovaný soubor neexistuje.

' - def process(self, pyfile): - msurl = re.match(self.__pattern__, pyfile.url) - if msurl: - self.fileID = msurl.group('ID') - self.html = self.load(pyfile.url, decode=True) - self.getFileInfo() - - if self.premium: - self.handlePremium() - else: - self.handleFree() - else: - self.handleOverriden() - - def handleFree(self): - self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.fileID) + self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.info['pattern']['ID']) def handlePremium(self): @@ -51,27 +36,29 @@ class MultishareCz(SimpleHoster): self.logWarning(_("Not enough credit left to download file")) self.resetAccount() - self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) - + self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.info['pattern']['ID']) - def handleOverriden(self): - if not self.premium: - self.fail(_("Only premium users can download from other hosters")) + def handleMulti(self): self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post={"link": self.pyfile.url}, decode=True) - self.getFileInfo() + + self.checkInfo() if not self.checkCredit(): self.fail(_("Not enough credit left to download file")) - url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random() * 10000 * random()) + url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random() * 10000 * random()) params = {"u_ID": self.acc_info['u_ID'], "u_hash": self.acc_info['u_hash'], "link": self.pyfile.url} + self.logDebug(url, params) + + self.link = True self.download(url, get=params) def checkCredit(self): self.acc_info = self.account.getAccountInfo(self.user, True) + self.logInfo(_("User %s has %i MB left") % (self.user, self.acc_info['trafficleft'] / 1024)) return self.pyfile.size / 1024 <= self.acc_info['trafficleft'] diff --git a/module/plugins/hoster/MyfastfileCom.py b/module/plugins/hoster/MyfastfileCom.py index a2e582bd0..947d302b5 100644 --- a/module/plugins/hoster/MyfastfileCom.py +++ b/module/plugins/hoster/MyfastfileCom.py @@ -3,10 +3,10 @@ import re from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class MyfastfileCom(Hoster): +class MyfastfileCom(SimpleHoster): __name__ = "MyfastfileCom" __type__ = "hoster" __version__ = "0.04" @@ -19,28 +19,24 @@ class MyfastfileCom(Hoster): def setup(self): - self.chunkLimit = -1 + self.chunkLimit = -1 self.resumeDownload = True - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Myfastfile.com") - self.fail(_("No Myfastfile.com account provided")) - else: - self.logDebug("Original URL: %s" % pyfile.url) - page = self.load('http://myfastfile.com/api.php', - get={'user': self.user, 'pass': self.account.getAccountData(self.user)['password'], - 'link': pyfile.url}) - self.logDebug("JSON data: " + page) - page = json_loads(page) - if page['status'] != 'ok': - self.fail(_("Unable to unrestrict link")) - new_url = page['link'] - - if new_url != pyfile.url: - self.logDebug("Unrestricted URL: " + new_url) - - self.download(new_url, disposition=True) + def handleMulti(self): + self.logDebug("Original URL: %s" % self.pyfile.url) + + page = self.load('http://myfastfile.com/api.php', + get={'user': self.user, 'pass': self.account.getAccountData(self.user)['password'], + 'link': self.pyfile.url}) + self.logDebug("JSON data: " + page) + page = json_loads(page) + if page['status'] != 'ok': + self.fail(_("Unable to unrestrict link")) + self.link = page['link'] + + if self.link != self.pyfile.url: + self.logDebug("Unrestricted URL: " + self.link) + + +getInfo = create_getInfo(MyfastfileCom) diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index bb8d84742..7f3152dfa 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -6,11 +6,11 @@ from random import randrange from urllib import unquote from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import parseFileSize -class OverLoadMe(Hoster): +class OverLoadMe(SimpleHoster): __name__ = "OverLoadMe" __type__ = "hoster" __version__ = "0.02" @@ -33,52 +33,48 @@ class OverLoadMe(Hoster): def setup(self): - self.chunkLimit = 5 + self.chunkLimit = 5 self.resumeDownload = True - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Over-Load") - self.fail(_("No Over-Load account provided")) - else: - self.logDebug("Old URL: %s" % pyfile.url) - data = self.account.getAccountData(self.user) + def handleMulti(self): + data = self.account.getAccountData(self.user) - page = self.load("https://api.over-load.me/getdownload.php", - get={"auth": data['password'], "link": pyfile.url}) - data = json_loads(page) + page = self.load("https://api.over-load.me/getdownload.php", + get={"auth": data['password'], "link": self.pyfile.url}) + data = json_loads(page) - self.logDebug("Returned Data: %s" % data) + self.logDebug("Returned Data: %s" % data) - if data['error'] == 1: - self.logWarning(data['msg']) - self.tempOffline() - else: - if pyfile.name is not None and pyfile.name.endswith('.tmp') and data['filename']: - pyfile.name = data['filename'] - pyfile.size = parseFileSize(data['filesize']) - new_url = data['downloadlink'] + if data['error'] == 1: + self.logWarning(data['msg']) + self.tempOffline() + else: + if self.pyfile.name is not None and self.pyfile.name.endswith('.tmp') and data['filename']: + self.pyfile.name = data['filename'] + self.pyfile.size = parseFileSize(data['filesize']) + self.link = data['downloadlink'] if self.getConfig("https"): - new_url = new_url.replace("http://", "https://") + self.link = self.link.replace("http://", "https://") else: - new_url = new_url.replace("https://", "http://") + self.link = self.link.replace("https://", "http://") - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) + if self.link != self.pyfile.url: + self.logDebug("New URL: %s" % self.link) - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): + if self.pyfile.name.startswith("http") or self.pyfile.name.startswith("Unknown") or self.pyfile.name.endswith('..'): # only use when name wasn't already set - pyfile.name = self.getFilename(new_url) + self.pyfile.name = self.getFilename(self.link) - self.download(new_url, disposition=True) + def checkFile(self): check = self.checkDownload( {"error": "An error occured while processing your request"}) if check == "error": # usual this download can safely be retried self.retry(wait_time=60, reason=_("An error occured while generating link.")) + + +getInfo = create_getInfo(OverLoadMe) diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 9f8037d41..35f21e7ec 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -6,11 +6,11 @@ from os import remove from os.path import exists from urllib import quote -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import fs_encode -class PremiumTo(Hoster): +class PremiumTo(SimpleHoster): __name__ = "PremiumTo" __type__ = "hoster" __version__ = "0.11" @@ -26,27 +26,24 @@ class PremiumTo(Hoster): def setup(self): self.resumeDownload = True - self.chunkLimit = 1 + self.chunkLimit = 1 - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "premium.to") - self.fail(_("No premium.to account provided")) - - self.logDebug("Old URL: %s" % pyfile.url) - + def handleMulti(self): tra = self.getTraffic() #raise timeout to 2min self.req.setOption("timeout", 120) + self.link = True self.download("http://premium.to/api/getfile.php", get={'username': self.account.username, 'password': self.account.password, - 'link' : quote(pyfile.url, "")}, + 'link' : quote(self.pyfile.url, "")}, disposition=True) + + def checkFile(self): check = self.checkDownload({"nopremium": "No premium account available"}) if check == "nopremium": @@ -65,7 +62,7 @@ class PremiumTo(Hoster): err = _('File does not exist') trb = self.getTraffic() - self.logInfo(_("Filesize: %d, Traffic used %d, traffic left %d") % (pyfile.size, tra - trb, trb)) + self.logInfo(_("Filesize: %d, Traffic used %d, traffic left %d") % (self.pyfile.size, tra - trb, trb)) if err: self.fail(err) @@ -79,3 +76,6 @@ class PremiumTo(Hoster): except: traffic = 0 return traffic + + +getInfo = create_getInfo(PremiumTo) diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py index bf00325d9..f4a778897 100644 --- a/module/plugins/hoster/PremiumizeMe.py +++ b/module/plugins/hoster/PremiumizeMe.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class PremiumizeMe(Hoster): +class PremiumizeMe(SimpleHoster): __name__ = "PremiumizeMe" __type__ = "hoster" __version__ = "0.12" @@ -16,41 +16,45 @@ class PremiumizeMe(Hoster): __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] - def process(self, pyfile): - # Check account - if not self.account or not self.account.canUse(): - self.logError(_("Please enter your %s account or deactivate this plugin") % "premiumize.me") - self.fail(_("No valid premiumize.me account provided")) - + def handleMulti(self): # In some cases hostsers do not supply us with a filename at download, so we # are going to set a fall back filename (e.g. for freakshare or xfileshare) - pyfile.name = pyfile.name.split('/').pop() # Remove everthing before last slash + self.pyfile.name = self.pyfile.name.split('/').pop() # Remove everthing before last slash # Correction for automatic assigned filename: Removing html at end if needed suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"] - temp = pyfile.name.split('.') + temp = self.pyfile.name.split('.') if temp.pop() in suffix_to_remove: - pyfile.name = ".".join(temp) + self.pyfile.name = ".".join(temp) # Get account data - (user, data) = self.account.selectAccount() + user, data = self.account.selectAccount() # Get rewritten link using the premiumize.me api v1 (see https://secure.premiumize.me/?show=api) data = json_loads(self.load("https://api.premiumize.me/pm-api/v1.php", get={'method' : "directdownloadlink", 'params[login]': user, 'params[pass]' : data['password'], - 'params[link]' : pyfile.url})) + 'params[link]' : self.pyfile.url})) # Check status and decide what to do status = data['status'] + if status == 200: - self.download(data['result']['location'], disposition=True) + self.link = data['result']['location'] + return + elif status == 400: self.fail(_("Invalid link")) + elif status == 404: self.offline() + elif status >= 500: self.tempOffline() + else: self.fail(data['statusmessage']) + + +getInfo = create_getInfo(PremiumizeMe) diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py index c4c16cf3c..3ef0d7585 100644 --- a/module/plugins/hoster/RPNetBiz.py +++ b/module/plugins/hoster/RPNetBiz.py @@ -2,11 +2,11 @@ import re -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.common.json_layer import json_loads -class RPNetBiz(Hoster): +class RPNetBiz(SimpleHoster): __name__ = "RPNetBiz" __type__ = "hoster" __version__ = "0.10" @@ -19,67 +19,64 @@ class RPNetBiz(Hoster): def setup(self): - self.chunkLimit = -1 + self.chunkLimit = -1 self.resumeDownload = True - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - link_status = {'generated': pyfile.url} - elif not self.account: - # Check account - self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") - self.fail(_("No rpnet account provided")) - else: - (user, data) = self.account.selectAccount() - - self.logDebug("Original URL: %s" % pyfile.url) - # Get the download link - res = self.load("https://premium.rpnet.biz/client_api.php", - get={"username": user, - "password": data['password'], - "action": "generate", - "links": pyfile.url}) - - self.logDebug("JSON data: %s" % res) - link_status = json_loads(res)['links'][0] # get the first link... since we only queried one - - # Check if we only have an id as a HDD link - if 'id' in link_status: - self.logDebug("Need to wait at least 30 seconds before requery") - self.setWait(30) # wait for 30 seconds + def handleMulti(self): + user, data = self.account.selectAccount() + + self.logDebug("Original URL: %s" % self.pyfile.url) + # Get the download link + res = self.load("https://premium.rpnet.biz/client_api.php", + get={"username": user, + "password": data['password'], + "action": "generate", + "links": self.pyfile.url}) + + self.logDebug("JSON data: %s" % res) + link_status = json_loads(res)['links'][0] # get the first link... since we only queried one + + # Check if we only have an id as a HDD link + if 'id' in link_status: + self.logDebug("Need to wait at least 30 seconds before requery") + self.setWait(30) # wait for 30 seconds + self.wait() + # Lets query the server again asking for the status on the link, + # we need to keep doing this until we reach 100 + max_tries = 30 + my_try = 0 + while (my_try <= max_tries): + self.logDebug("Try: %d ; Max Tries: %d" % (my_try, max_tries)) + res = self.load("https://premium.rpnet.biz/client_api.php", + get={"username": user, + "password": data['password'], + "action": "downloadInformation", + "id": link_status['id']}) + self.logDebug("JSON data hdd query: %s" % res) + download_status = json_loads(res)['download'] + + if download_status['status'] == '100': + link_status['generated'] = download_status['rpnet_link'] + self.logDebug("Successfully downloaded to rpnet HDD: %s" % link_status['generated']) + break + else: + self.logDebug("At %s%% for the file download" % download_status['status']) + + self.setWait(30) self.wait() - # Lets query the server again asking for the status on the link, - # we need to keep doing this until we reach 100 - max_tries = 30 - my_try = 0 - while (my_try <= max_tries): - self.logDebug("Try: %d ; Max Tries: %d" % (my_try, max_tries)) - res = self.load("https://premium.rpnet.biz/client_api.php", - get={"username": user, - "password": data['password'], - "action": "downloadInformation", - "id": link_status['id']}) - self.logDebug("JSON data hdd query: %s" % res) - download_status = json_loads(res)['download'] - - if download_status['status'] == '100': - link_status['generated'] = download_status['rpnet_link'] - self.logDebug("Successfully downloaded to rpnet HDD: %s" % link_status['generated']) - break - else: - self.logDebug("At %s%% for the file download" % download_status['status']) - - self.setWait(30) - self.wait() - my_try += 1 - - if my_try > max_tries: # We went over the limit! - self.fail(_("Waited for about 15 minutes for download to finish but failed")) + my_try += 1 + + if my_try > max_tries: # We went over the limit! + self.fail(_("Waited for about 15 minutes for download to finish but failed")) if 'generated' in link_status: - self.download(link_status['generated'], disposition=True) + self.link = link_status['generated'] + return elif 'error' in link_status: self.fail(link_status['error']) else: self.fail(_("Something went wrong, not supposed to enter here")) + + +getInfo = create_getInfo(RPNetBiz) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index cc6dd49c3..7feacee28 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -7,11 +7,11 @@ from urllib import quote, unquote from time import time from module.common.json_layer import json_loads -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import parseFileSize -class RealdebridCom(Hoster): +class RealdebridCom(SimpleHoster): __name__ = "RealdebridCom" __type__ = "hoster" __version__ = "0.53" @@ -34,61 +34,57 @@ class RealdebridCom(Hoster): def setup(self): - self.chunkLimit = 3 + self.chunkLimit = 3 self.resumeDownload = True - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") - self.fail(_("No Real-debrid account provided")) + def handleMulti(self): + password = self.getPassword().splitlines() + if not password: + password = "" else: - self.logDebug("Old URL: %s" % pyfile.url) - password = self.getPassword().splitlines() - if not password: - password = "" - else: - password = password[0] - - data = json_loads(self.load("https://real-debrid.com/ajax/unrestrict.php", - get={'lang' : "en", - 'link' : quote(pyfile.url, ""), - 'password': password, - 'time' : int(time() * 1000)})) - - self.logDebug("Returned Data: %s" % data) - - if data['error'] != 0: - if data['message'] == "Your file is unavailable on the hoster.": - self.offline() - else: - self.logWarning(data['message']) - self.tempOffline() + password = password[0] + + data = json_loads(self.load("https://real-debrid.com/ajax/unrestrict.php", + get={'lang' : "en", + 'link' : quote(self.pyfile.url, ""), + 'password': password, + 'time' : int(time() * 1000)})) + + self.logDebug("Returned Data: %s" % data) + + if data['error'] != 0: + if data['message'] == "Your file is unavailable on the hoster.": + self.offline() else: - if pyfile.name is not None and pyfile.name.endswith('.tmp') and data['file_name']: - pyfile.name = data['file_name'] - pyfile.size = parseFileSize(data['file_size']) - new_url = data['generated_links'][0][-1] + self.logWarning(data['message']) + self.tempOffline() + else: + if self.pyfile.name is not None and self.pyfile.name.endswith('.tmp') and data['file_name']: + self.pyfile.name = data['file_name'] + self.pyfile.size = parseFileSize(data['file_size']) + self.link = data['generated_links'][0][-1] if self.getConfig("https"): - new_url = new_url.replace("http://", "https://") + self.link = self.link.replace("http://", "https://") else: - new_url = new_url.replace("https://", "http://") + self.link = self.link.replace("https://", "http://") - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) + if self.link != self.pyfile.url: + self.logDebug("New URL: %s" % self.link) - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): + if self.pyfile.name.startswith("http") or self.pyfile.name.startswith("Unknown") or self.pyfile.name.endswith('..'): #only use when name wasnt already set - pyfile.name = self.getFilename(new_url) + self.pyfile.name = self.getFilename(self.link) - self.download(new_url, disposition=True) + def checkFile(self): check = self.checkDownload( {"error": "An error occured while processing your request"}) if check == "error": #usual this download can safely be retried self.retry(wait_time=60, reason=_("An error occured while generating link")) + + +getInfo = create_getInfo(RealdebridCom) diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index 7cde01025..067dd8dbe 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -2,10 +2,10 @@ from urllib import quote, unquote -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class RehostTo(Hoster): +class RehostTo(SimpleHoster): __name__ = "RehostTo" __type__ = "hoster" __version__ = "0.13" @@ -22,23 +22,21 @@ class RehostTo(Hoster): def setup(self): - self.chunkLimit = 1 + self.chunkLimit = 1 self.resumeDownload = True - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "rehost.to") - self.fail(_("No rehost.to account provided")) - + def handleMulti(self): data = self.account.getAccountInfo(self.user) long_ses = data['long_ses'] - self.logDebug("Rehost.to: Old URL: %s" % pyfile.url) - #raise timeout to 2min self.req.setOption("timeout", 120) + self.link = True self.download("http://rehost.to/process_download.php", - get={'user': "cookie", 'pass': long_ses, 'dl': quote(pyfile.url, "")}, + get={'user': "cookie", 'pass': long_ses, 'dl': quote(self.pyfile.url, "")}, disposition=True) + + +getInfo = create_getInfo(RehostTo) diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py index bc37f45c8..c7eed0680 100644 --- a/module/plugins/hoster/SimplyPremiumCom.py +++ b/module/plugins/hoster/SimplyPremiumCom.py @@ -4,11 +4,11 @@ import re from datetime import datetime, timedelta -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.hoster.UnrestrictLi import secondsToMidnight -class SimplyPremiumCom(Hoster): +class SimplyPremiumCom(SimpleHoster): __name__ = "SimplyPremiumCom" __type__ = "hoster" __version__ = "0.03" @@ -21,62 +21,57 @@ class SimplyPremiumCom(Hoster): def setup(self): - self.chunkLimit = 16 + self.chunkLimit = 16 self.resumeDownload = False - def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url - elif not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Simply-Premium.com") - self.fail(_("No Simply-Premium.com account provided")) + def handleMulti(self): + for i in xrange(5): + page = self.load("http://www.simply-premium.com/premium.php", get={'info': "", 'link': self.pyfile.url}) + self.logDebug("JSON data: " + page) + if page != '': + break else: - self.logDebug("Old URL: %s" % pyfile.url) - for i in xrange(5): - page = self.load("http://www.simply-premium.com/premium.php", get={'info': "", 'link': pyfile.url}) - self.logDebug("JSON data: " + page) - if page != '': - break - else: - self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) - self.retry(5, 60, "Unable to get API data") - - if '0' in page or ( - "You are not allowed to download from this host" in page and self.premium): - self.account.relogin(self.user) - self.retry() - elif "NOTFOUND" in page: - self.offline() - elif "downloadlimit" in page: - self.logWarning(_("Reached maximum connctions")) - self.retry(5, 60, "Reached maximum connctions") - elif "trafficlimit" in page: - self.logWarning(_("Reached daily limit for this host")) - self.retry(wait_time=secondsToMidnight(gmt=2), "Daily limit for this host reached") - elif "hostererror" in page: - self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) - self.retry(5, 60, "Hoster is temporarily unavailable") - #page = json_loads(page) - #new_url = page.keys()[0] - #self.api_data = page[new_url] - - try: - self.pyfile.name = re.search(r'([^<]+)', page).group(1) - except AttributeError: - self.pyfile.name = "" - - try: - self.pyfile.size = re.search(r'(\d+)', page).group(1) - except AttributeError: - self.pyfile.size = 0 - - try: - new_url = re.search(r'([^<]+)', page).group(1) - except AttributeError: - new_url = 'http://www.simply-premium.com/premium.php?link=' + pyfile.url - - if new_url != pyfile.url: - self.logDebug("New URL: " + new_url) - - self.download(new_url, disposition=True) + self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) + self.retry(5, 60, "Unable to get API data") + + if '0' in page or ( + "You are not allowed to download from this host" in page and self.premium): + self.account.relogin(self.user) + self.retry() + + elif "NOTFOUND" in page: + self.offline() + + elif "downloadlimit" in page: + self.logWarning(_("Reached maximum connctions")) + self.retry(5, 60, "Reached maximum connctions") + + elif "trafficlimit" in page: + self.logWarning(_("Reached daily limit for this host")) + self.retry(wait_time=secondsToMidnight(gmt=2), "Daily limit for this host reached") + + elif "hostererror" in page: + self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) + self.retry(5, 60, "Hoster is temporarily unavailable") + + try: + self.pyfile.name = re.search(r'([^<]+)', page).group(1) + except AttributeError: + self.pyfile.name = "" + + try: + self.pyfile.size = re.search(r'(\d+)', page).group(1) + except AttributeError: + self.pyfile.size = 0 + + try: + self.link = re.search(r'([^<]+)', page).group(1) + except AttributeError: + self.link = 'http://www.simply-premium.com/premium.php?link=' + self.pyfile.url + + if self.link != self.pyfile.url: + self.logDebug("New URL: " + self.link) + + +getInfo = create_getInfo(SimplyPremiumCom) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 0fe4ae0f8..6f3ecfc42 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -2,10 +2,10 @@ import re -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class SimplydebridCom(Hoster): +class SimplydebridCom(SimpleHoster): __name__ = "SimplydebridCom" __type__ = "hoster" __version__ = "0.10" @@ -23,42 +23,39 @@ class SimplydebridCom(Hoster): self.chunkLimit = 1 - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "simply-debrid.com") - self.fail(_("No simply-debrid.com account provided")) + def handleMulti(self): + #fix the links for simply-debrid.com! + self.link = self.pyfile.url + self.link = self.link.replace("clz.to", "cloudzer.net/file") + self.link = self.link.replace("http://share-online", "http://www.share-online") + self.link = self.link.replace("ul.to", "uploaded.net/file") + self.link = self.link.replace("uploaded.com", "uploaded.net") + self.link = self.link.replace("filerio.com", "filerio.in") + self.link = self.link.replace("lumfile.com", "lumfile.se") - self.logDebug("Old URL: %s" % pyfile.url) + if('fileparadox' in self.link): + self.link = self.link.replace("http://", "https://") - #fix the links for simply-debrid.com! - new_url = pyfile.url - new_url = new_url.replace("clz.to", "cloudzer.net/file") - new_url = new_url.replace("http://share-online", "http://www.share-online") - new_url = new_url.replace("ul.to", "uploaded.net/file") - new_url = new_url.replace("uploaded.com", "uploaded.net") - new_url = new_url.replace("filerio.com", "filerio.in") - new_url = new_url.replace("lumfile.com", "lumfile.se") - if('fileparadox' in new_url): - new_url = new_url.replace("http://", "https://") - - if re.match(self.__pattern__, new_url): - new_url = new_url - - self.logDebug("New URL: %s" % new_url) - - if not re.match(self.__pattern__, new_url): - page = self.load("http://simply-debrid.com/api.php", get={'dl': new_url}) # +'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + if re.match(self.__pattern__, self.link): + self.link = self.link + + self.logDebug("New URL: %s" % self.link) + + if not re.match(self.__pattern__, self.link): + page = self.load("http://simply-debrid.com/api.php", get={'dl': self.link}) # +'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): self.fail(_("Unable to unrestrict link")) - new_url = page + self.link = page self.setWait(5) self.wait() - self.logDebug("Unrestricted URL: " + new_url) - self.download(new_url, disposition=True) + def checkFile(self): check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": " Date: Wed, 17 Dec 2014 20:03:05 +0100 Subject: [DebridItaliaCom] Fix hook getHoster --- module/plugins/hooks/DebridItaliaCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index b7f0ef1c7..43e910a4b 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), @@ -23,5 +23,4 @@ class DebridItaliaCom(MultiHoster): def getHoster(self): - html = getURL("http://www.debriditalia.com/status.php") - return re.findall(r'title="(.+?)"> \1 Date: Wed, 17 Dec 2014 21:47:39 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (2) --- module/plugins/hoster/DebridItaliaCom.py | 2 +- module/plugins/hoster/FastixRu.py | 2 +- module/plugins/hoster/FreeWayMe.py | 2 +- module/plugins/hoster/LinksnappyCom.py | 2 +- module/plugins/hoster/MegaDebridEu.py | 2 +- module/plugins/hoster/MultishareCz.py | 2 +- module/plugins/hoster/MyfastfileCom.py | 2 +- module/plugins/hoster/OverLoadMe.py | 2 +- module/plugins/hoster/PremiumTo.py | 2 +- module/plugins/hoster/PremiumizeMe.py | 2 +- module/plugins/hoster/RPNetBiz.py | 2 +- module/plugins/hoster/RealdebridCom.py | 2 +- module/plugins/hoster/RehostTo.py | 2 +- module/plugins/hoster/SimplyPremiumCom.py | 2 +- module/plugins/hoster/SimplydebridCom.py | 2 +- module/plugins/hoster/UnrestrictLi.py | 2 +- module/plugins/hoster/ZeveraCom.py | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index da52c080b..28c49091b 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DebridItaliaCom(SimpleHoster): __name__ = "DebridItaliaCom" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.08" __pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+' diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index a4e7338fe..379ac1cd4 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastixRu(SimpleHoster): __name__ = "FastixRu" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P\w{24})' diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py index 531b49726..307ab7811 100644 --- a/module/plugins/hoster/FreeWayMe.py +++ b/module/plugins/hoster/FreeWayMe.py @@ -6,7 +6,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FreeWayMe(SimpleHoster): __name__ = "FreeWayMe" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'https://(?:www\.)?free-way\.me/.*' diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index 1f97fab31..878e4222b 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LinksnappyCom(SimpleHoster): __name__ = "LinksnappyCom" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'https?://(?:[^/]*\.)?linksnappy\.com' diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index f6696a1ed..a6a42a884 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MegaDebridEu(SimpleHoster): __name__ = "MegaDebridEu" __type__ = "hoster" - __version__ = "0.40" + __version__ = "0.41" __pattern__ = r'^https?://(?:w{3}\d+\.mega-debrid\.eu|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/download/file/[^/]+/.+$' diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index d7ddb753c..62acab84c 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MultishareCz(SimpleHoster): __name__ = "MultishareCz" __type__ = "hoster" - __version__ = "0.35" + __version__ = "0.36" __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P\d+).*' diff --git a/module/plugins/hoster/MyfastfileCom.py b/module/plugins/hoster/MyfastfileCom.py index 947d302b5..f009a83b5 100644 --- a/module/plugins/hoster/MyfastfileCom.py +++ b/module/plugins/hoster/MyfastfileCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MyfastfileCom(SimpleHoster): __name__ = "MyfastfileCom" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/' diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index 7f3152dfa..bccccf615 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -13,7 +13,7 @@ from module.utils import parseFileSize class OverLoadMe(SimpleHoster): __name__ = "OverLoadMe" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'https?://.*overload\.me.*' diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 35f21e7ec..c946fbc7e 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -13,7 +13,7 @@ from module.utils import fs_encode class PremiumTo(SimpleHoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py index f4a778897..76a283b09 100644 --- a/module/plugins/hoster/PremiumizeMe.py +++ b/module/plugins/hoster/PremiumizeMe.py @@ -7,7 +7,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class PremiumizeMe(SimpleHoster): __name__ = "PremiumizeMe" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'^unmatchable$' #: Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py index 3ef0d7585..901c7ee77 100644 --- a/module/plugins/hoster/RPNetBiz.py +++ b/module/plugins/hoster/RPNetBiz.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class RPNetBiz(SimpleHoster): __name__ = "RPNetBiz" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __description__ = """RPNet.biz hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 7feacee28..1c1347b4e 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -14,7 +14,7 @@ from module.utils import parseFileSize class RealdebridCom(SimpleHoster): __name__ = "RealdebridCom" __type__ = "hoster" - __version__ = "0.53" + __version__ = "0.54" __pattern__ = r'https?://(?:[^/]*\.)?real-debrid\..*' diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index 067dd8dbe..4f978cdce 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class RehostTo(SimpleHoster): __name__ = "RehostTo" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'https?://.*rehost\.to\..*' diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py index c7eed0680..e381fb29f 100644 --- a/module/plugins/hoster/SimplyPremiumCom.py +++ b/module/plugins/hoster/SimplyPremiumCom.py @@ -11,7 +11,7 @@ from module.plugins.hoster.UnrestrictLi import secondsToMidnight class SimplyPremiumCom(SimpleHoster): __name__ = "SimplyPremiumCom" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'https?://.*(simply-premium)\.com' diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 6f3ecfc42..196cdfd4b 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SimplydebridCom(SimpleHoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*' diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index d0a03d7ec..fcdbbd284 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -29,7 +29,7 @@ def secondsToMidnight(gmt=0): class UnrestrictLi(SimpleHoster): __name__ = "UnrestrictLi" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li' diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index cc55c6955..d8c2ffe7a 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ZeveraCom(SimpleHoster): __name__ = "ZeveraCom" __type__ = "hoster" - __version__ = "0.21" + __version__ = "0.22" __pattern__ = r'http://(?:www\.)?zevera\.com/.*' -- cgit v1.2.3 From 69616099c133fdc783abad44c2a0916acba4b6d1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 22:38:24 +0100 Subject: [SimpleHoster] Fix filesize recognition --- module/plugins/internal/SimpleHoster.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 86d9b4c9a..ad140423c 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -154,7 +154,7 @@ def _isDirectLink(self, url, resumable=True): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "0.74" + __version__ = "0.75" __pattern__ = r'^unmatchable$' @@ -300,7 +300,7 @@ class SimpleHoster(Hoster): cls.FILE_NAME_REPLACEMENTS if hasattr(cls, "FILE_NAME_REPLACEMENTS") else cls.NAME_REPLACEMENTS) #@TODO: Remove FILE_NAME_REPLACEMENTS check in 0.4.10 if 'S' in info['pattern']: - size = replace_patterns(info['pattern']['S'] + info['pattern']['U'] if 'U' in info else info['pattern']['S'], + size = replace_patterns(info['pattern']['S'] + info['pattern']['U'] if 'U' in info['pattern'] else info['pattern']['S'], cls.FILE_SIZE_REPLACEMENTS if hasattr(cls, "FILE_SIZE_REPLACEMENTS") else cls.SIZE_REPLACEMENTS) #@TODO: Remove FILE_SIZE_REPLACEMENTS check in 0.4.10 info['size'] = parseFileSize(size) @@ -361,6 +361,7 @@ class SimpleHoster(Hoster): if self.multihost: self.logDebug("Looking for leeched download link...") + self.logDebug("File url: %s" % self.pyfile.url) self.handleMulti() elif self.directDL: @@ -404,10 +405,8 @@ class SimpleHoster(Hoster): def downloadLink(self, link): - if not link: - return - - self.download(link, disposition=True) + if link and isinstance(link, basestring): + self.download(link, disposition=True) def checkFile(self): -- cgit v1.2.3 From 0860e09f5ff16ee3f097f6f9d444f277a38abd72 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 23:03:46 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (3) --- module/plugins/hoster/AlldebridCom.py | 3 +++ module/plugins/hoster/DebridItaliaCom.py | 3 +++ module/plugins/hoster/FastixRu.py | 3 +++ module/plugins/hoster/FreeWayMe.py | 3 +++ module/plugins/hoster/LinksnappyCom.py | 2 ++ module/plugins/hoster/MegaDebridEu.py | 2 ++ module/plugins/hoster/MyfastfileCom.py | 3 +++ module/plugins/hoster/OverLoadMe.py | 3 +++ module/plugins/hoster/PremiumTo.py | 3 +++ module/plugins/hoster/PremiumizeMe.py | 3 +++ module/plugins/hoster/RPNetBiz.py | 3 +++ module/plugins/hoster/RealdebridCom.py | 3 +++ module/plugins/hoster/RehostTo.py | 3 +++ module/plugins/hoster/SimplyPremiumCom.py | 3 +++ module/plugins/hoster/SimplydebridCom.py | 3 +++ module/plugins/hoster/UnrestrictLi.py | 3 +++ module/plugins/hoster/ZeveraCom.py | 3 +++ module/plugins/internal/MultiHoster.py | 41 +++++++++++++++++-------------- module/plugins/internal/SimpleHoster.py | 2 +- 19 files changed, 73 insertions(+), 19 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 8a4e31986..abcb1e5b1 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -22,6 +22,9 @@ class AlldebridCom(SimpleHoster): __authors__ = [("Andy Voigt", "spamsales@online.de")] + MULTI_HOSTER = True + + def getFilename(self, url): try: name = unquote(url.rsplit("/", 1)[1]) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 28c49091b..f9f4ce06d 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -18,6 +18,9 @@ class DebridItaliaCom(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] + MULTI_HOSTER = True + + def setup(self): self.chunkLimit = -1 self.resumeDownload = True diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 379ac1cd4..56d1e911a 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -21,6 +21,9 @@ class FastixRu(SimpleHoster): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] + MULTI_HOSTER = True + + def getFilename(self, url): try: name = unquote(url.rsplit("/", 1)[1]) diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py index 307ab7811..9c7344f95 100644 --- a/module/plugins/hoster/FreeWayMe.py +++ b/module/plugins/hoster/FreeWayMe.py @@ -15,6 +15,9 @@ class FreeWayMe(SimpleHoster): __authors__ = [("Nicolas Giese", "james@free-way.me")] + MULTI_HOSTER = True + + def setup(self): self.resumeDownload = False self.multiDL = self.premium diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index 878e4222b..c7bce407e 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -20,6 +20,8 @@ class LinksnappyCom(SimpleHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] + MULTI_HOSTER = True + SINGLE_CHUNK_HOSTERS = ('easybytez.com') diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index a6a42a884..8feab4b24 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -20,6 +20,8 @@ class MegaDebridEu(SimpleHoster): __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] + MULTI_HOSTER = True + API_URL = "https://www.mega-debrid.eu/api.php" diff --git a/module/plugins/hoster/MyfastfileCom.py b/module/plugins/hoster/MyfastfileCom.py index f009a83b5..2b9200d4b 100644 --- a/module/plugins/hoster/MyfastfileCom.py +++ b/module/plugins/hoster/MyfastfileCom.py @@ -18,6 +18,9 @@ class MyfastfileCom(SimpleHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] + MULTI_HOSTER = True + + def setup(self): self.chunkLimit = -1 self.resumeDownload = True diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index bccccf615..815313dd1 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -22,6 +22,9 @@ class OverLoadMe(SimpleHoster): __authors__ = [("marley", "marley@over-load.me")] + MULTI_HOSTER = True + + def getFilename(self, url): try: name = unquote(url.rsplit("/", 1)[1]) diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index c946fbc7e..6c94b3fa9 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -24,6 +24,9 @@ class PremiumTo(SimpleHoster): ("stickell", "l.stickell@yahoo.it")] + MULTI_HOSTER = True + + def setup(self): self.resumeDownload = True self.chunkLimit = 1 diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py index 76a283b09..b3da7dca1 100644 --- a/module/plugins/hoster/PremiumizeMe.py +++ b/module/plugins/hoster/PremiumizeMe.py @@ -16,6 +16,9 @@ class PremiumizeMe(SimpleHoster): __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] + MULTI_HOSTER = True + + def handleMulti(self): # In some cases hostsers do not supply us with a filename at download, so we # are going to set a fall back filename (e.g. for freakshare or xfileshare) diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py index 901c7ee77..a7bc3ea71 100644 --- a/module/plugins/hoster/RPNetBiz.py +++ b/module/plugins/hoster/RPNetBiz.py @@ -18,6 +18,9 @@ class RPNetBiz(SimpleHoster): __authors__ = [("Dman", "dmanugm@gmail.com")] + MULTI_HOSTER = True + + def setup(self): self.chunkLimit = -1 self.resumeDownload = True diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 1c1347b4e..4fa42242a 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -23,6 +23,9 @@ class RealdebridCom(SimpleHoster): __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] + MULTI_HOSTER = True + + def getFilename(self, url): try: name = unquote(url.rsplit("/", 1)[1]) diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index 4f978cdce..dbd943d37 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -17,6 +17,9 @@ class RehostTo(SimpleHoster): __authors__ = [("RaNaN", "RaNaN@pyload.org")] + MULTI_HOSTER = True + + def getFilename(self, url): return unquote(url.rsplit("/", 1)[1]) diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py index e381fb29f..9857f514a 100644 --- a/module/plugins/hoster/SimplyPremiumCom.py +++ b/module/plugins/hoster/SimplyPremiumCom.py @@ -20,6 +20,9 @@ class SimplyPremiumCom(SimpleHoster): __authors__ = [("EvolutionClip", "evolutionclip@live.de")] + MULTI_HOSTER = True + + def setup(self): self.chunkLimit = 16 self.resumeDownload = False diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 196cdfd4b..1b8ff11b2 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -17,6 +17,9 @@ class SimplydebridCom(SimpleHoster): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] + MULTI_HOSTER = True + + def setup(self): self.resumeDownload = True self.multiDL = True diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index fcdbbd284..911061f24 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -38,6 +38,9 @@ class UnrestrictLi(SimpleHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] + MULTI_HOSTER = True + + def setup(self): self.chunkLimit = 16 self.resumeDownload = True diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index d8c2ffe7a..8effea20b 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -15,6 +15,9 @@ class ZeveraCom(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + MULTI_HOSTER = True + + def setup(self): self.resumeDownload = True self.multiDL = True diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index 6d10d17d9..0bcb79817 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -9,7 +9,7 @@ from module.utils import remove_chars class MultiHoster(Hook): __name__ = "MultiHoster" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Generic MultiHoster plugin""" __license__ = "GPLv3" @@ -18,19 +18,22 @@ class MultiHoster(Hook): interval = 12 * 60 * 60 #: reload hosters every 12h - HOSTER_REPLACEMENTS = [("1fichier.com", "onefichier.com"), - ("2shared.com", "twoshared.com"), - ("4shared.com", "fourshared.com"), - ("cloudnator.com", "shragle.com"), - ("easy-share.com", "crocko.com"), - ("freakshare.net", "freakshare.com"), - ("hellshare.com", "hellshare.cz"), - ("ifile.it", "filecloud.io"), - ("putlocker.com", "firedrive.com"), - ("share-rapid.cz", "multishare.cz"), - ("sharerapid.cz", "multishare.cz"), - ("ul.to", "uploaded.to"), - ("uploaded.net", "uploaded.to")] + HOSTER_REPLACEMENTS = [("1fichier.com" , "onefichier.com"), + ("2shared.com" , "twoshared.com" ), + ("4shared.com" , "fourshared.com"), + ("cloudnator.com" , "shragle.com" ), + ("easy-share.com" , "crocko.com" ), + ("fileparadox.com", "fileparadox.in"), + ("freakshare.net" , "freakshare.com"), + ("hellshare.com" , "hellshare.cz" ), + ("ifile.it" , "filecloud.io" ), + ("nowdownload.ch" , "nowdownload.sx"), + ("nowvideo.co" , "nowvideo.sx" ), + ("putlocker.com" , "firedrive.com" ), + ("share-rapid.cz" , "multishare.cz" ), + ("sharerapid.cz" , "multishare.cz" ), + ("ul.to" , "uploaded.to" ), + ("uploaded.net" , "uploaded.to" )] HOSTER_EXCLUDED = [] @@ -133,12 +136,12 @@ class MultiHoster(Hook): def overridePlugins(self): - pluginMap = dict((name.lower(), name) for name in self.core.pluginManager.hosterPlugins.keys()) + pluginMap = dict((name.lower(), name) for name in self.core.pluginManager.hosterPlugins.iterkeys()) accountList = [name.lower() for name, data in self.core.accountManager.accounts.iteritems() if data] excludedList = [] for hoster in self.getHosterCached(): - name = remove_chars(hoster.lower(), "-.") + name = remove_chars(hoster, "-.") if name in accountList: excludedList.append(hoster) @@ -166,10 +169,12 @@ class MultiHoster(Hook): self.logInfo(_("The following hosters were not overwritten - account exists"), ", ".join(sorted(excludedList))) if self.new_supported: - self.logDebug("New Hosters", ", ".join(sorted(self.new_supported))) + hosters = sorted(self.new_supported) + + self.logDebug("New Hosters", ", ".join(hosters)) # create new regexp - regexp = r'.*(%s).*' % "|".join([x.replace(".", "\.") for x in self.new_supported]) + regexp = r'.*(%s).*' % "|".join([x.replace(".", "\.") for x in hosters]) if hasattr(klass, "__pattern__") and isinstance(klass.__pattern__, basestring) and '://' in klass.__pattern__: regexp = r'%s|%s' % (klass.__pattern__, regexp) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index ad140423c..2ff60d6ea 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -361,7 +361,7 @@ class SimpleHoster(Hoster): if self.multihost: self.logDebug("Looking for leeched download link...") - self.logDebug("File url: %s" % self.pyfile.url) + self.logDebug("File url: %s" % pyfile.url) self.handleMulti() elif self.directDL: -- cgit v1.2.3 From d799ef7a401149591b747e18197ce54017f96f1b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 23:47:33 +0100 Subject: [LinestorageCom] Added hoster plugin --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- module/plugins/hoster/LinestorageCom.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 module/plugins/hoster/LinestorageCom.py (limited to 'module/plugins') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index e9b1b454e..10de43cc0 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.26" + __version__ = "0.27" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), @@ -30,7 +30,7 @@ class XFileSharingPro(Hook): HOSTER_LIST = [#WORKING HOSTERS: "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", diff --git a/module/plugins/hoster/LinestorageCom.py b/module/plugins/hoster/LinestorageCom.py new file mode 100644 index 000000000..a3caacc0c --- /dev/null +++ b/module/plugins/hoster/LinestorageCom.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo + + +class LinestorageCom(XFSHoster): + __name__ = "LinestorageCom" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?linestorage\.com/\w{12}' + + __description__ = """Linestorage.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + HOSTER_DOMAIN = "linestorage.com" + + +getInfo = create_getInfo(LinestorageCom) -- cgit v1.2.3 From ad2808a5eb6903875036c00b5195e8b7651379f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 23:48:23 +0100 Subject: [XFSHoster] Improve NAME_PATTERN & SIZE_PATTERN --- module/plugins/internal/XFSHoster.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index bb4baa274..622f34ea9 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -16,7 +16,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.28" + __version__ = "0.29" __pattern__ = r'^unmatchable$' @@ -35,8 +35,8 @@ class XFSHoster(SimpleHoster): CHECK_DIRECT_LINK = None MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy... - NAME_PATTERN = r'(>Filename:|name="fname" value="|)(?P.+?)(\s*<|")' - SIZE_PATTERN = r'(>Size:|>File:.*>|\s*\(|)(?P[\d.,]+)\s*(?P[\w^_]+)' + NAME_PATTERN = r'(Filename[ ]*:[ ]*()?|name="fname"[ ]+value="|<[\w^_]+ class="(file)?name">)\s*(?P.+?)(\s*<|")' + SIZE_PATTERN = r'(Size[ ]*:[ ]*()?|File:.*>|\s*\(|<[\w^_]+ class="size">)\s*(?P[\d.,]+)\s*(?P[\w^_]+)' OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' -- cgit v1.2.3 From f26faa7a68f645f8664874f4ff361caf8503d651 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 23:49:18 +0100 Subject: Update plugins after XFSHoster changes --- module/plugins/hoster/CramitIn.py | 1 + module/plugins/hoster/FileParadoxIn.py | 2 -- module/plugins/hoster/HundredEightyUploadCom.py | 3 --- module/plugins/hoster/JunocloudMe.py | 4 +--- module/plugins/hoster/LomafileCom.py | 3 +-- module/plugins/hoster/MovReelCom.py | 3 --- module/plugins/hoster/NosuploadCom.py | 1 + module/plugins/hoster/NovafileCom.py | 4 ++-- module/plugins/hoster/RapidfileshareNet.py | 2 +- module/plugins/hoster/RarefileNet.py | 3 --- module/plugins/hoster/RyushareCom.py | 3 +-- module/plugins/hoster/SafesharingEu.py | 2 -- module/plugins/hoster/SendmywayCom.py | 5 +---- module/plugins/hoster/UpleaCom.py | 1 + module/plugins/hoster/UptoboxCom.py | 2 +- 15 files changed, 11 insertions(+), 28 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/CramitIn.py b/module/plugins/hoster/CramitIn.py index 4f1ad1ff1..f444718bc 100644 --- a/module/plugins/hoster/CramitIn.py +++ b/module/plugins/hoster/CramitIn.py @@ -18,6 +18,7 @@ class CramitIn(XFSHoster): HOSTER_DOMAIN = "cramit.in" INFO_PATTERN = r'\s*(?P.*?).*?\s*\((?P.*?)\)' + LINK_PATTERN = r'href="(http://cramit\.in/file_download/.*?)"' diff --git a/module/plugins/hoster/FileParadoxIn.py b/module/plugins/hoster/FileParadoxIn.py index 7ed0e9b7a..0b5b57e22 100644 --- a/module/plugins/hoster/FileParadoxIn.py +++ b/module/plugins/hoster/FileParadoxIn.py @@ -19,7 +19,5 @@ class FileParadoxIn(XFSHoster): HOSTER_DOMAIN = "fileparadox.in" - SIZE_PATTERN = r'\s*\(\s*(?P[^)]+)\s*\)' - getInfo = create_getInfo(FileParadoxIn) diff --git a/module/plugins/hoster/HundredEightyUploadCom.py b/module/plugins/hoster/HundredEightyUploadCom.py index 48e0c3d8c..317a49caf 100644 --- a/module/plugins/hoster/HundredEightyUploadCom.py +++ b/module/plugins/hoster/HundredEightyUploadCom.py @@ -20,8 +20,5 @@ class HundredEightyUploadCom(XFSHoster): HOSTER_DOMAIN = "180upload.com" - NAME_PATTERN = r'Filename:(?P.+)-->' - SIZE_PATTERN = r'Size:(?P[\d.,]+) (?P[\w^_]+)\s*' - getInfo = create_getInfo(HundredEightyUploadCom) diff --git a/module/plugins/hoster/JunocloudMe.py b/module/plugins/hoster/JunocloudMe.py index ffea77315..56d6588fa 100644 --- a/module/plugins/hoster/JunocloudMe.py +++ b/module/plugins/hoster/JunocloudMe.py @@ -19,9 +19,7 @@ class JunocloudMe(XFSHoster): URL_REPLACEMENTS = [(r'//(www\.)?junocloud', "//dl3.junocloud")] - SIZE_PATTERN = r'

Size: (?P[\d.,]+) (?P[\w^_]+)

' - - OFFLINE_PATTERN = r'>No such file with this filename<' + OFFLINE_PATTERN = r'>No such file with this filename<' TEMP_OFFLINE_PATTERN = r'The page may have been renamed, removed or be temporarily unavailable.<' diff --git a/module/plugins/hoster/LomafileCom.py b/module/plugins/hoster/LomafileCom.py index a7ce39d37..0abc8487d 100644 --- a/module/plugins/hoster/LomafileCom.py +++ b/module/plugins/hoster/LomafileCom.py @@ -19,9 +19,8 @@ class LomafileCom(XFSHoster): HOSTER_DOMAIN = "lomafile.com" NAME_PATTERN = r'' - SIZE_PATTERN = r'Size:(?P[\d.,]+) (?P[\w^_]+)' - OFFLINE_PATTERN = r'>(No such file|Software error:<)' + OFFLINE_PATTERN = r'>(No such file|Software error:<)' TEMP_OFFLINE_PATTERN = r'The page may have been renamed, removed or be temporarily unavailable.<' CAPTCHA_PATTERN = r'(http://lomafile\.com/captchas/[^"\']+)' diff --git a/module/plugins/hoster/MovReelCom.py b/module/plugins/hoster/MovReelCom.py index cd1626f6f..9bb63701c 100644 --- a/module/plugins/hoster/MovReelCom.py +++ b/module/plugins/hoster/MovReelCom.py @@ -17,9 +17,6 @@ class MovReelCom(XFSHoster): HOSTER_DOMAIN = "movreel.com" - NAME_PATTERN = r'Filename: (?P.+?)<' - SIZE_PATTERN = r'Size: (?P[\d.,]+) (?P[\w^_]+)' - LINK_PATTERN = r'Download Link' diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py index b2255ca54..8a03d7090 100644 --- a/module/plugins/hoster/NosuploadCom.py +++ b/module/plugins/hoster/NosuploadCom.py @@ -21,6 +21,7 @@ class NosuploadCom(XFSHoster): SIZE_PATTERN = r'

Size: (?P[\d.,]+) (?P[\w^_]+)

' LINK_PATTERN = r'
Download' + WAIT_PATTERN = r'Please wait.*?>(\d+)
' diff --git a/module/plugins/hoster/NovafileCom.py b/module/plugins/hoster/NovafileCom.py index 5c4dfddca..9754ceed1 100644 --- a/module/plugins/hoster/NovafileCom.py +++ b/module/plugins/hoster/NovafileCom.py @@ -22,10 +22,10 @@ class NovafileCom(XFSHoster): HOSTER_DOMAIN = "novafile.com" - SIZE_PATTERN = r'
(?P.+?)
' ERROR_PATTERN = r'class="alert[^"]*alert-separate"[^>]*>\s*(?:

)?(.*?)\s*Please wait ]*>(\d+) seconds

' + LINK_PATTERN = r'Download File' - WAIT_PATTERN = r'

Please wait ]*>(\d+) seconds

' getInfo = create_getInfo(NovafileCom) diff --git a/module/plugins/hoster/RapidfileshareNet.py b/module/plugins/hoster/RapidfileshareNet.py index ae53411c3..14d62ee74 100644 --- a/module/plugins/hoster/RapidfileshareNet.py +++ b/module/plugins/hoster/RapidfileshareNet.py @@ -20,7 +20,7 @@ class RapidfileshareNet(XFSHoster): NAME_PATTERN = r'' SIZE_PATTERN = r'>http://www.rapidfileshare.net/\w+? \((?P[\d.,]+) (?P[\w^_]+)\)' - OFFLINE_PATTERN = r'>No such file with this filename' + OFFLINE_PATTERN = r'>No such file with this filename' TEMP_OFFLINE_PATTERN = r'The page may have been renamed, removed or be temporarily unavailable.<' diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py index 987028c8f..e847c7cf3 100644 --- a/module/plugins/hoster/RarefileNet.py +++ b/module/plugins/hoster/RarefileNet.py @@ -19,9 +19,6 @@ class RarefileNet(XFSHoster): HOSTER_DOMAIN = "rarefile.net" - NAME_PATTERN = r'(?P.+?)<' - SIZE_PATTERN = r'>Size : (?P[\d.,]+) (?P[\w^_]+)' - LINK_PATTERN = r'(?P=link)' diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index d2e4489a6..b01613abb 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -25,9 +25,8 @@ class RyushareCom(XFSHoster): HOSTER_DOMAIN = "ryushare.com" - SIZE_PATTERN = r'You have requested [^<]+ \((?P[\d.,]+) (?P[\w^_]+)' - WAIT_PATTERN = r'You have to wait ((?P\d+) hour[s]?, )?((?P\d+) minute[s], )?(?P\d+) second[s]' + LINK_PATTERN = r'Click here to download<' diff --git a/module/plugins/hoster/SafesharingEu.py b/module/plugins/hoster/SafesharingEu.py index f0936b9e8..bb6e0f646 100644 --- a/module/plugins/hoster/SafesharingEu.py +++ b/module/plugins/hoster/SafesharingEu.py @@ -17,8 +17,6 @@ class SafesharingEu(XFSHoster): HOSTER_DOMAIN = "safesharing.eu" - WAIT_PATTERN = r'You have to wait (\d+) minutes' - ERROR_PATTERN = r'(?:
)(.+?)(?:
)' diff --git a/module/plugins/hoster/SendmywayCom.py b/module/plugins/hoster/SendmywayCom.py index 4254922fc..637098b88 100644 --- a/module/plugins/hoster/SendmywayCom.py +++ b/module/plugins/hoster/SendmywayCom.py @@ -10,15 +10,12 @@ class SendmywayCom(XFSHoster): __pattern__ = r'http://(?:www\.)?sendmyway\.com/\w{12}' - __description__ = """SendMyWay hoster plugin""" + __description__ = """SendMyWay.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] HOSTER_DOMAIN = "sendmyway.com" - NAME_PATTERN = r'

<.*?>\s*(?P.+)' - SIZE_PATTERN = r'\((?P\d+) bytes\)' - getInfo = create_getInfo(SendmywayCom) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index c9b32c196..7ae46ef38 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -27,6 +27,7 @@ class UpleaCom(XFSHoster): OFFLINE_PATTERN = r'>You followed an invalid or expired link' LINK_PATTERN = r'"(http?://\w+\.uplea\.com/anonym/.*?)"' + WAIT_PATTERN = r'timeText:([\d.]+),' STEP_PATTERN = r'' diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index 3c3fa45b0..21d781f55 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -17,7 +17,7 @@ class UptoboxCom(XFSHoster): HOSTER_DOMAIN = "uptobox.com" - INFO_PATTERN = r'"para_title">(?P.+) \((?P[\d.,]+) (?P[\w^_]+)\)' + INFO_PATTERN = r'"para_title">(?P.+) \((?P[\d.,]+) (?P[\w^_]+)\)' OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)' LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' -- cgit v1.2.3 From c8f03124db975ddb9917036ba1f907dea2dea353 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 00:02:12 +0100 Subject: [DebridItaliaCom] Fix hoster plugin typo --- module/plugins/hoster/DebridItaliaCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index f9f4ce06d..6a86ba4e4 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DebridItaliaCom(SimpleHoster): __name__ = "DebridItaliaCom" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+' @@ -30,8 +30,8 @@ class DebridItaliaCom(SimpleHoster): html = self.load("http://www.debriditalia.com/api.php", get={'generate': "on", 'link': self.pyfile.url, 'p': self.getPassword()}) - if "ERROR" in html: - self.fail(re.search(r'ERROR:(.*)', html).strip()) + if "ERROR:" in html: + self.fail(re.search(r'ERROR:(.*)', html).group(1).strip()) self.link = html.strip() -- cgit v1.2.3 From 977bf7dd0e3550e77c221be1321ed52d408dd34b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 15:01:50 +0100 Subject: [UploadedTo] Fix trafficleft recognition --- module/plugins/accounts/UploadedTo.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 6cb09e44b..947ac2b9e 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -9,16 +9,16 @@ from module.plugins.Account import Account class UploadedTo(Account): __name__ = "UploadedTo" __type__ = "account" - __version__ = "0.27" + __version__ = "0.28" __description__ = """Uploaded.to account plugin""" __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] PREMIUM_PATTERN = r'Premium' - VALID_UNTIL_PATTERN = r'Duration:\s*([^<]+)' - TRAFFIC_LEFT_PATTERN = r'([^<]+)' + VALID_UNTIL_PATTERN = r'Duration:\s*(.+?)<' + TRAFFIC_LEFT_PATTERN = r'(?P[\d.,]+) (?P[\w^_]+)' def loadAccountInfo(self, user, req): @@ -32,20 +32,28 @@ class UploadedTo(Account): m = re.search(self.VALID_UNTIL_PATTERN, html, re.M) if m: - expiredate = m.group(1).strip() + expiredate = m.group(1).lower().strip() if expiredate == "unlimited": validuntil = -1 else: - m = re.findall(r'(\d+) (Week|weeks|day|hour)', expiredate) + m = re.findall(r'(\d+) (week|day|hour)', expiredate) if m: validuntil = time() for n, u in m: - validuntil += int(n) * 60 * 60 * {'Week': 168, 'weeks': 168, 'day': 24, 'hour': 1}[u] + validuntil += int(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: - trafficleft = self.parseTraffic(m.group(1).replace('.', '')) + traffic = m.groupdict() + size = traffic['S'].replace('.', '') + unit = traffic['U'].lower() + + if unit.startswith('t'): #@NOTE: Remove in 0.4.10 + trafficleft = float(size.replace(',', '.')) / 1024 + trafficleft *= 1 << 40 + else: + trafficleft = self.parseTraffic(size + unit) return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} -- cgit v1.2.3 From fb65d5354c3cc80c3f48c3a2745b8dc01105edfd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:02:29 +0100 Subject: Update account plugins --- module/plugins/accounts/AlldebridCom.py | 18 +++++++-------- module/plugins/accounts/BitshareCom.py | 9 ++++---- module/plugins/accounts/CzshareCom.py | 9 ++++---- module/plugins/accounts/DebridItaliaCom.py | 4 ++-- module/plugins/accounts/DepositfilesCom.py | 4 ++-- module/plugins/accounts/FastixRu.py | 10 ++++----- module/plugins/accounts/FilecloudIo.py | 4 ++-- module/plugins/accounts/FilerNet.py | 8 ++++--- module/plugins/accounts/FilesMailRu.py | 4 ++-- module/plugins/accounts/FileserveCom.py | 10 ++++----- module/plugins/accounts/FreakshareCom.py | 34 ++++++++++++++++++----------- module/plugins/accounts/FreeWayMe.py | 6 ++--- module/plugins/accounts/FshareVn.py | 4 ++-- module/plugins/accounts/HellshareCz.py | 4 ++-- module/plugins/accounts/LinksnappyCom.py | 4 ++-- module/plugins/accounts/MultishareCz.py | 4 ++-- module/plugins/accounts/MyfastfileCom.py | 4 ++-- module/plugins/accounts/NetloadIn.py | 8 +++---- module/plugins/accounts/OboomCom.py | 12 +++++----- module/plugins/accounts/OverLoadMe.py | 4 ++-- module/plugins/accounts/PremiumTo.py | 7 +++--- module/plugins/accounts/PremiumizeMe.py | 4 ++-- module/plugins/accounts/RPNetBiz.py | 4 ++-- module/plugins/accounts/RapidgatorNet.py | 4 ++-- module/plugins/accounts/RealdebridCom.py | 14 ++++++------ module/plugins/accounts/RehostTo.py | 26 ++++++++++++---------- module/plugins/accounts/ShareonlineBiz.py | 4 ++-- module/plugins/accounts/SimplyPremiumCom.py | 18 ++++++++------- module/plugins/accounts/StahnuTo.py | 6 ++--- module/plugins/accounts/UlozTo.py | 4 ++-- module/plugins/accounts/UnrestrictLi.py | 4 ++-- module/plugins/accounts/UploadedTo.py | 8 +++---- module/plugins/accounts/UploadheroCom.py | 10 ++++----- module/plugins/accounts/ZeveraCom.py | 4 ++-- 34 files changed, 149 insertions(+), 132 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 1fb5e4b54..8fb841a39 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -23,8 +23,8 @@ class AlldebridCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://www.alldebrid.com/account/") - soup = BeautifulSoup(page) + html = req.load("http://www.alldebrid.com/account/") + soup = BeautifulSoup(html) #Try to parse expiration date directly from the control panel page (better accuracy) try: time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string @@ -36,10 +36,10 @@ class AlldebridCom(Account): #Get expiration date from API except: data = self.getAccountData(user) - page = req.load("http://www.alldebrid.com/api.php", + html = req.load("http://www.alldebrid.com/api.php", get={'action': "info_user", 'login': user, 'pw': data['password']}) - self.logDebug(page) - xml = dom.parseString(page) + self.logDebug(html) + xml = dom.parseString(html) exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 account_info = {"validuntil": exp_time, "trafficleft": -1} return account_info @@ -47,13 +47,13 @@ class AlldebridCom(Account): def login(self, user, data, req): urlparams = urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']}) - page = req.load("http://www.alldebrid.com/register/?%s" % urlparams) + html = req.load("http://www.alldebrid.com/register/?%s" % urlparams) - if "This login doesn't exist" in page: + if "This login doesn't exist" in html: self.wrongPassword() - if "The password is not valid" in page: + if "The password is not valid" in html: self.wrongPassword() - if "Invalid captcha" in page: + if "Invalid captcha" in html: self.wrongPassword() diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index 8da3764ff..960ff6c3c 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -14,19 +14,20 @@ class BitshareCom(Account): def loadAccountInfo(self, user, req): - page = req.load("http://bitshare.com/mysettings.html") + html = req.load("http://bitshare.com/mysettings.html") - if "\"http://bitshare.com/myupgrade.html\">Free" in page: + if "\"http://bitshare.com/myupgrade.html\">Free" in html: return {"validuntil": -1, "trafficleft": -1, "premium": False} - if not '' in page: + if not '' in html: self.logWarning(_("Activate direct Download in your Bitshare Account")) return {"validuntil": -1, "trafficleft": -1, "premium": True} def login(self, user, data, req): - page = req.load("http://bitshare.com/login.html", + html = req.load("http://bitshare.com/login.html", post={"user": user, "password": data['password'], "submit": "Login"}, cookies=True) + if "login" in req.lastEffectiveURL: self.wrongPassword() diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index 844ec9999..414883228 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class CzshareCom(Account): __name__ = "CzshareCom" __type__ = "account" - __version__ = "0.14" + __version__ = "0.15" __description__ = """Czshare.com account plugin, now Sdilej.cz""" __license__ = "GPLv3" @@ -27,10 +27,9 @@ class CzshareCom(Account): if m is None: return {"validuntil": 0, "trafficleft": 0} else: - credits = float(m.group(1).replace(' ', '').replace(',', '.')) - credits = credits * 1024 ** {'KiB': 0, 'MiB': 1, 'GiB': 2}[m.group(2)] - validuntil = mktime(strptime(m.group(3), '%d.%m.%y %H:%M')) - return {"validuntil": validuntil, "trafficleft": credits} + trafficleft = self.parseTraffic(m.group(1).replace(' ', '').replace(',', '.')) + m.group(2)] + validuntil = mktime(strptime(m.group(3), '%d.%m.%y %H:%M')) + return {"validuntil": validuntil, "trafficleft": trafficleft} def login(self, user, data, req): diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index e9d4964cc..878153fbf 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class DebridItaliaCom(Account): __name__ = "DebridItaliaCom" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Debriditalia.com account plugin""" __license__ = "GPLv3" @@ -28,7 +28,7 @@ class DebridItaliaCom(Account): if 'Account premium not activated' not in html: m = re.search(self.WALID_UNTIL_PATTERN, html) if m: - validuntil = int(mktime(strptime(m.group(1), "%d/%m/%Y %H:%M"))) + validuntil = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")) info = {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError(_("Unable to retrieve account information")) diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index 1cfb96e84..ec23f7a51 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class DepositfilesCom(Account): __name__ = "DepositfilesCom" __type__ = "account" - __version__ = "0.30" + __version__ = "0.31" __description__ = """Depositfiles.com account plugin""" __license__ = "GPLv3" @@ -23,7 +23,7 @@ class DepositfilesCom(Account): html = req.load("https://dfiles.eu/de/gold/") validuntil = re.search(r"Sie haben Gold Zugang bis: (.*?)", html).group(1) - validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S"))) + validuntil = mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S")) return {"validuntil": validuntil, "trafficleft": -1} diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index ced49125a..d33d611c9 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -16,9 +16,9 @@ class FastixRu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) + html = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) - points = page['points'] + points = html['points'] kb = float(points) * 1024 ** 2 / 1000 if points > 0: @@ -29,10 +29,10 @@ class FastixRu(Account): def login(self, user, data, req): - page = req.load("http://fastix.ru/api_v2/", + html = req.load("http://fastix.ru/api_v2/", get={'sub': "get_apikey", 'email': user, 'password': data['password']}) - api = json_loads(page) + api = json_loads(html) api = api['apikey'] data['api'] = api - if "error_code" in page: + if "error_code" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index c001d4513..d20f756f3 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FilecloudIo(Account): __name__ = "FilecloudIo" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """FilecloudIo account plugin""" __license__ = "GPLv3" @@ -36,7 +36,7 @@ class FilecloudIo(Account): rep = json_loads(rep) if rep['is_premium'] == 1: - return {"validuntil": int(rep['premium_until']), "trafficleft": -1} + return {"validuntil": float(rep['premium_until']), "trafficleft": -1} else: return {"premium": False} diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index cb913a27e..a845e7ba4 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class FilerNet(Account): __name__ = "FilerNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Filer.net account plugin""" __license__ = "GPLv3" @@ -29,12 +29,14 @@ class FilerNet(Account): if re.search(self.FREE_PATTERN, html): return {"premium": False, "validuntil": None, "trafficleft": None} - until = re.search(self.WALID_UNTIL_PATTERN, html) + until = re.search(self.WALID_UNTIL_PATTERN, html) traffic = re.search(self.TRAFFIC_PATTERN, html) + if until and traffic: - validuntil = int(time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S"))) + validuntil = time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S")) trafficleft = self.parseTraffic(traffic.group(1)) return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} + else: self.logError(_("Unable to retrieve account information")) return {"premium": False, "validuntil": None, "trafficleft": None} diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index dcec22644..f91f4d5ba 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -20,9 +20,9 @@ class FilesMailRu(Account): def login(self, user, data, req): user, domain = user.split("@") - page = req.load("http://swa.mail.ru/cgi-bin/auth", None, + html = req.load("http://swa.mail.ru/cgi-bin/auth", None, {"Domain": domain, "Login": user, "Password": data['password'], "Page": "http://files.mail.ru/"}, cookies=True) - if "Неверное имя пользователя или пароль" in page: # @TODO seems not to work + if "Неверное имя пользователя или пароль" in html: # @TODO seems not to work self.wrongPassword() diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 6f23f4b43..1cf2a3a3c 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -19,9 +19,9 @@ class FileserveCom(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], + html = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], "submit": "Submit+Query"}) - res = json_loads(page) + res = json_loads(html) if res['type'] == "premium": validuntil = mktime(strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) @@ -31,14 +31,14 @@ class FileserveCom(Account): def login(self, user, data, req): - page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], + html = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'], "submit": "Submit+Query"}) - res = json_loads(page) + res = json_loads(html) if not res['type']: self.wrongPassword() - #login at fileserv page + #login at fileserv html req.load("http://www.fileserve.com/login.php", post={"loginUserName": user, "loginUserPassword": data['password'], "autoLogin": "checked", "loginFormSubmit": "Login"}) diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 27e1e3a0a..576d835e2 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class FreakshareCom(Account): __name__ = "FreakshareCom" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Freakshare.com account plugin""" __license__ = "GPLv3" @@ -18,26 +18,34 @@ class FreakshareCom(Account): def loadAccountInfo(self, user, req): - page = req.load("http://freakshare.com/") + premium = False + validuntil = None + trafficleft = None - validuntil = r'ltig bis:\s*([\d.:-]+)' - validuntil = re.search(validuntil, page, re.M) - validuntil = validuntil.group(1).strip() - validuntil = mktime(strptime(validuntil, "%d.%m.%Y - %H:%M")) + html = req.load("http://freakshare.com/") - traffic = r'Traffic verbleibend:\s*([^<]+)' - traffic = re.search(traffic, page, re.M) - traffic = traffic.group(1).strip() - traffic = self.parseTraffic(traffic) + try: + m = re.search(r'ltig bis:\s*([\d.:-]+)', html, re.M) + validuntil = mktime(strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) - return {"validuntil": validuntil, "trafficleft": traffic} + except Exception: + pass + + try: + m = re.search(r'Traffic verbleibend:\s*([^<]+)', html, re.M) + trafficleft = self.parseTraffic(m.group(1)) + + except Exception: + pass + + return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft} def login(self, user, data, req): req.load("http://freakshare.com/index.php?language=EN") - page = req.load("http://freakshare.com/login.html", None, + html = req.load("http://freakshare.com/login.html", None, {"submit": "Login", "user": user, "pass": data['password']}, cookies=True) - if ">Wrong Username or Password" in page: + if ">Wrong Username or Password" in html: self.wrongPassword() diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index cfba1ba06..3b9841630 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" @@ -22,11 +22,11 @@ class FreeWayMe(Account): account_info = {"validuntil": -1, "premium": False} if status['premium'] == "Free": - account_info['trafficleft'] = int(status['guthaben']) * 1024 + account_info['trafficleft'] = self.parseTraffic(status['guthaben'] + "MB") elif status['premium'] == "Spender": account_info['trafficleft'] = -1 elif status['premium'] == "Flatrate": - account_info = {"validuntil": int(status['Flatrate']), + account_info = {"validuntil": float(status['Flatrate']), "trafficleft": -1, "premium": True} diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index d1b05209c..2da45aac6 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class FshareVn(Account): __name__ = "FshareVn" __type__ = "account" - __version__ = "0.07" + __version__ = "0.08" __description__ = """Fshare.vn account plugin""" __license__ = "GPLv3" @@ -60,4 +60,4 @@ class FshareVn(Account): def getTrafficLeft(self): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - return float(m.group(1)) * 1024 ** {'k': 0, 'K': 0, 'M': 1, 'G': 2}[m.group(2)] if m else 0 + return self.parseTraffic(m.group(1) + m.group(2)) if m else 0 diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index 685740a5c..dff2fe394 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class HellshareCz(Account): __name__ = "HellshareCz" __type__ = "account" - __version__ = "0.14" + __version__ = "0.15" __description__ = """Hellshare.cz account plugin""" __license__ = "GPLv3" @@ -41,7 +41,7 @@ class HellshareCz(Account): trafficleft = -1 else: #Traffic-based account - trafficleft = int(credit) * 1024 + trafficleft = self.parseTraffic(credit + "MB") validuntil = -1 except Exception, e: self.logError(_("Unable to parse credit info"), e) diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 9fcdac9c7..19986157b 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class LinksnappyCom(Account): __name__ = "LinksnappyCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Linksnappy.com account plugin""" __license__ = "GPLv3" @@ -37,7 +37,7 @@ class LinksnappyCom(Account): if 'trafficleft' not in j['return'] or isinstance(j['return']['trafficleft'], str): trafficleft = -1 else: - trafficleft = int(j['return']['trafficleft']) * 1024 + trafficleft = self.parseTraffic(float(j['return']['trafficleft'] + "MB") return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index 9eb0b50b2..878413007 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class MultishareCz(Account): __name__ = "MultishareCz" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Multishare.cz account plugin""" __license__ = "GPLv3" @@ -24,7 +24,7 @@ class MultishareCz(Account): html = req.load("http://www.multishare.cz/profil/", decode=True) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - trafficleft = self.parseTraffic(m.group('S'), m.group('U')) if m else 0 + trafficleft = self.parseTraffic(m.group('S') + m.group('U')) if m else 0 self.premium = True if trafficleft else False html = req.load("http://www.multishare.cz/", decode=True) diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 65bb33854..36923470e 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class MyfastfileCom(Account): __name__ = "MyfastfileCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Myfastfile.com account plugin""" __license__ = "GPLv3" @@ -18,7 +18,7 @@ class MyfastfileCom(Account): def loadAccountInfo(self, user, req): if 'days_left' in self.json_data: - validuntil = int(time() + self.json_data['days_left'] * 24 * 60 * 60) + validuntil = time() + self.json_data['days_left'] * 24 * 60 * 60 return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError(_("Unable to get account information")) diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index 6565e6899..15bad6966 100755 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -18,9 +18,9 @@ class NetloadIn(Account): def loadAccountInfo(self, user, req): - page = req.load("http://netload.in/index.php", get={'id': 2, 'lang': "de"}) + html = req.load("http://netload.in/index.php", get={'id': 2, 'lang': "de"}) left = r'>(\d+) (Tag|Tage), (\d+) Stunden<' - left = re.search(left, page) + left = re.search(left, html) if left: validuntil = time() + int(left.group(1)) * 24 * 60 * 60 + int(left.group(3)) * 60 * 60 trafficleft = -1 @@ -33,8 +33,8 @@ class NetloadIn(Account): def login(self, user, data, req): - page = req.load("http://netload.in/index.php", None, + html = req.load("http://netload.in/index.php", None, {"txtuser": user, "txtpass": data['password'], "txtcheck": "login", "txtlogin": "Login"}, cookies=True) - if "password or it might be invalid!" in page: + if "password or it might be invalid!" in html: self.wrongPassword() diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 9bb45224c..4d90e1b25 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -11,7 +11,7 @@ from module.plugins.Account import Account class OboomCom(Account): __name__ = "OboomCom" __type__ = "account" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Oboom.com account plugin""" __license__ = "GPLv3" @@ -42,19 +42,19 @@ class OboomCom(Account): if userData['premium_unix'] == "null": validUntil = -1 else: - validUntil = int(userData['premium_unix']) + validUntil = float(userData['premium_unix']) traffic = userData['traffic'] - trafficLeft = traffic['current'] - maxTraffic = traffic['max'] + trafficLeft = traffic['current'] / 1024 #@TODO: Remove `/ 1024` in 0.4.10 + maxTraffic = traffic['max'] / 1024 #@TODO: Remove `/ 1024` in 0.4.10 session = accountData['session'] return {'premium' : premium, 'validuntil' : validUntil, - 'trafficleft': trafficLeft / 1024, #@TODO: Remove / 1024 in 0.4.10 - 'maxtraffic' : maxTraffic / 1024, #@TODO: Remove / 1024 in 0.4.10 + 'trafficleft': trafficLeft, + 'maxtraffic' : maxTraffic, 'session' : session} diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index 7df4c9aef..fb9732986 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -16,8 +16,8 @@ class OverLoadMe(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip() - data = json_loads(page) + html = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip() + data = json_loads(html) # Check for premium if data['membership'] == "Free": diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index c1a8c661a..efc64706b 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class PremiumTo(Account): __name__ = "PremiumTo" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Premium.to account plugin""" __license__ = "GPLv3" @@ -18,9 +18,10 @@ class PremiumTo(Account): def loadAccountInfo(self, user, req): api_r = req.load("http://premium.to/api/straffic.php", get={'username': self.username, 'password': self.password}) - traffic = sum(map(int, api_r.split(';'))) - return {"trafficleft": int(traffic) / 1024, "validuntil": -1} #@TODO: Remove / 1024 in 0.4.10 + trafficleft = float(sum(map(int, api_r.split(';')))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 + + return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1} def login(self, user, data, req): diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index 6603165e0..c1abde309 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -8,7 +8,7 @@ from module.common.json_layer import json_loads class PremiumizeMe(Account): __name__ = "PremiumizeMe" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Premiumize.me account plugin""" __license__ = "GPLv3" @@ -22,7 +22,7 @@ class PremiumizeMe(Account): # Parse account info account_info = {"validuntil": float(status['result']['expires']), - "trafficleft": max(0, status['result']['trafficleft_bytes'])} + "trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)} #@TODO: Remove `/ 1024` in 0.4.10 if status['result']['type'] == 'free': account_info['premium'] = False diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 8bd358084..813453c03 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.10" + __version__ = "0.11" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" @@ -20,7 +20,7 @@ class RPNetBiz(Account): try: if res['accountInfo']['isPremium']: # Parse account info. Change the trafficleft later to support per host info. - account_info = {"validuntil": int(res['accountInfo']['premiumExpiry']), + account_info = {"validuntil": float(res['accountInfo']['premiumExpiry']), "trafficleft": -1, "premium": True} else: account_info = {"validuntil": None, "trafficleft": None, "premium": False} diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 9a0edbfa4..2899d5a68 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Rapidgator.net account plugin""" __license__ = "GPLv3" @@ -31,7 +31,7 @@ class RapidgatorNet(Account): self.scheduleRefresh(user, json['response']['reset_in']) return {"validuntil": json['response']['expire_date'], - "trafficleft": int(json['response']['traffic_left']), + "trafficleft": float(json['response']['traffic_left']) / 1024, #@TODO: Remove `/ 1024` in 0.4.10 "premium": True} else: self.logError(json['response_details']) diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index eeba34665..48b17df5f 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class RealdebridCom(Account): __name__ = "RealdebridCom" __type__ = "account" - __version__ = "0.43" + __version__ = "0.44" __description__ = """Real-Debrid.com account plugin""" __license__ = "GPLv3" @@ -18,9 +18,9 @@ class RealdebridCom(Account): def loadAccountInfo(self, user, req): if self.pin_code: return {"premium": False} - page = req.load("https://real-debrid.com/api/account.php") - xml = dom.parseString(page) - account_info = {"validuntil": int(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), + html = req.load("https://real-debrid.com/api/account.php") + xml = dom.parseString(html) + account_info = {"validuntil": float(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue), "trafficleft": -1} return account_info @@ -28,9 +28,9 @@ class RealdebridCom(Account): def login(self, user, data, req): self.pin_code = False - page = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data['password']}) - if "Your login informations are incorrect" in page: + html = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data['password']}) + if "Your login informations are incorrect" in html: self.wrongPassword() - elif "PIN Code required" in page: + elif "PIN Code required" in html: self.logWarning(_("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com")) self.pin_code = True diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index eec7d8731..00a45dedd 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class RehostTo(Account): __name__ = "RehostTo" __type__ = "account" - __version__ = "0.10" + __version__ = "0.11" __description__ = """Rehost.to account plugin""" __license__ = "GPLv3" @@ -15,27 +15,31 @@ class RehostTo(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://rehost.to/api.php", + html = req.load("http://rehost.to/api.php", get={'cmd': "login", 'user': user, 'pass': data['password']}) - data = [x.split("=") for x in page.split(",")] + data = [x.split("=") for x in html.split(",")] ses = data[0][1] long_ses = data[1][1] - page = req.load("http://rehost.to/api.php", + html = req.load("http://rehost.to/api.php", get={'cmd': "get_premium_credits", 'long_ses': long_ses}) - traffic, valid = page.split(",") - account_info = {"trafficleft": int(traffic) * 1024, - "validuntil": int(valid), - "long_ses": long_ses, - "ses": ses} + traffic, valid = html.split(",") + + trafficleft = self.parseTraffic(traffic + "MB") + validuntil = float(valid) + + account_info = {"trafficleft": trafficleft, + "validuntil" : validuntil, + "long_ses" : long_ses, + "ses" : ses} return account_info def login(self, user, data, req): - page = req.load("http://rehost.to/api.php", + html = req.load("http://rehost.to/api.php", get={'cmd': "login", 'user': user, 'pass': data['password']}) - if "Login failed." in page: + if "Login failed." in html: self.wrongPassword() diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 976d2ff14..596be9b7c 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" __type__ = "account" - __version__ = "0.24" + __version__ = "0.25" __description__ = """Share-online.biz account plugin""" __license__ = "GPLv3" @@ -34,7 +34,7 @@ class ShareonlineBiz(Account): if "a" in info and info['a'].lower() != "not_available": req.cj.setCookie("share-online.biz", "a", info['a']) - return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1, + return {"validuntil": float(info['expire_date']) if "expire_date" in info else -1, "trafficleft": -1, "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False} diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 979ce73aa..465757457 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -7,7 +7,7 @@ from module.plugins.Account import Account class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Simply-Premium.com account plugin""" __license__ = "GPLv3" @@ -15,6 +15,9 @@ class SimplyPremiumCom(Account): def loadAccountInfo(self, user, req): + validuntil = -1 + trafficleft = None + json_data = req.load('http://www.simply-premium.com/api/user.php?format=json') self.logDebug("JSON data: " + json_data) json_data = json_loads(json_data) @@ -22,14 +25,13 @@ class SimplyPremiumCom(Account): if 'vip' in json_data['result'] and json_data['result']['vip'] == 0: return {"premium": False} - #Time package - validuntil = float(json_data['result']['timeend']) - #Traffic package - # {"trafficleft": int(traffic), "validuntil": -1} - #trafficleft = int(json_data['result']['traffic']) + if 'timeend' in json_data['result'] and json_data['result']['timeend']: + validuntil = float(json_data['result']['timeend']) + + if 'traffic' in json_data['result'] and json_data['result']['traffic']: + trafficleft = float(json_data['result']['traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10 - #return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} - return {"premium": True, "validuntil": validuntil} + return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} def login(self, user, data, req): diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py index 44884f835..2b08c67cd 100644 --- a/module/plugins/accounts/StahnuTo.py +++ b/module/plugins/accounts/StahnuTo.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class StahnuTo(Account): __name__ = "StahnuTo" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """StahnuTo account plugin""" __license__ = "GPLv3" @@ -19,9 +19,9 @@ class StahnuTo(Account): html = req.load("http://www.stahnu.to/") m = re.search(r'>VIP: (\d+.*)<', html) - trafficleft = self.parseTraffic(m.group(1)) * 1024 if m else 0 + trafficleft = self.parseTraffic(m.group(1)) if m else 0 - return {"premium": trafficleft > (512 * 1024), "trafficleft": trafficleft, "validuntil": -1} + return {"premium": trafficleft > 512, "trafficleft": trafficleft, "validuntil": -1} def login(self, user, data, req): diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 63adb6aa8..53cf54e7d 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class UlozTo(Account): __name__ = "UlozTo" __type__ = "account" - __version__ = "0.07" + __version__ = "0.08" __description__ = """Uloz.to account plugin""" __license__ = "GPLv3" @@ -29,7 +29,7 @@ class UlozTo(Account): req.cj.setCookie("ulozto.net", "ULOSESSID", self.phpsessid) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - trafficleft = int(float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if m else 0 + trafficleft = float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048 if m else 0 self.premium = True if trafficleft else False return {"validuntil": -1, "trafficleft": trafficleft} diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index e43d6bbd7..f5db3f888 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class UnrestrictLi(Account): __name__ = "UnrestrictLi" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Unrestrict.li account plugin""" __license__ = "GPLv3" @@ -23,7 +23,7 @@ class UnrestrictLi(Account): return {"premium": False} validuntil = json_data['result']['expires'] - trafficleft = int(json_data['result']['traffic']) + trafficleft = float(json_data['result']['traffic'] / 1024) #@TODO: Remove `/ 1024` in 0.4.10 return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 947ac2b9e..c09726799 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -9,7 +9,7 @@ from module.plugins.Account import Account class UploadedTo(Account): __name__ = "UploadedTo" __type__ = "account" - __version__ = "0.28" + __version__ = "0.29" __description__ = """Uploaded.to account plugin""" __license__ = "GPLv3" @@ -41,7 +41,7 @@ class UploadedTo(Account): if m: validuntil = time() for n, u in m: - validuntil += int(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] + validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: @@ -61,8 +61,8 @@ class UploadedTo(Account): def login(self, user, data, req): req.cj.setCookie("uploaded.net", "lang", "en") - page = req.load("http://uploaded.net/io/login", + html = req.load("http://uploaded.net/io/login", post={'id': user, 'pw': data['password'], '_': ""}) - if "User and password do not match" in page: + if "User and password do not match" in html: self.wrongPassword() diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 63d823e69..1e30b3771 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -21,10 +21,10 @@ class UploadheroCom(Account): premium_pattern = re.compile('Il vous reste (\d+) jours premium') data = self.getAccountData(user) - page = req.load("http://uploadhero.co/my-account") + html = req.load("http://uploadhero.co/my-account") - if premium_pattern.search(page): - end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(page).group(1))) + if premium_pattern.search(html): + end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(html).group(1))) end_date = time.mktime(future.timetuple()) account_info = {"validuntil": end_date, "trafficleft": -1, "premium": True} else: @@ -34,8 +34,8 @@ class UploadheroCom(Account): def login(self, user, data, req): - page = req.load("http://uploadhero.co/lib/connexion.php", + html = req.load("http://uploadhero.co/lib/connexion.php", post={"pseudo_login": user, "password_login": data['password']}) - if "mot de passe invalide" in page: + if "mot de passe invalide" in html: self.wrongPassword() diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index dbec6984d..e8e3431e3 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class ZeveraCom(Account): __name__ = "ZeveraCom" __type__ = "account" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Zevera.com account plugin""" __license__ = "GPLv3" @@ -21,7 +21,7 @@ class ZeveraCom(Account): account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} else: account_info = { - "trafficleft": int(data['availabletodaytraffic']) * 1024, + "trafficleft": float(data['availabletodaytraffic']) * 1024, "validuntil": mktime(strptime(data['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")), "premium": True } -- cgit v1.2.3 From 4e9c8f7ab1269966a9eac9e1b6363f5458f9f970 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:07:21 +0100 Subject: Update checkFile routine in some hoster plugins --- module/plugins/hoster/AlldebridCom.py | 11 ++++------- module/plugins/hoster/DebridItaliaCom.py | 8 +------- module/plugins/hoster/FastixRu.py | 9 +++------ module/plugins/hoster/FastshareCz.py | 4 +++- module/plugins/hoster/FileSharkPl.py | 4 +++- module/plugins/hoster/LinksnappyCom.py | 4 +++- module/plugins/hoster/OverLoadMe.py | 4 +++- module/plugins/hoster/PremiumTo.py | 14 ++++++-------- module/plugins/hoster/RealdebridCom.py | 4 +++- module/plugins/hoster/ShareonlineBiz.py | 11 ++++------- module/plugins/hoster/SimplydebridCom.py | 4 +++- module/plugins/hoster/UploadableCh.py | 4 +++- module/plugins/hoster/ZeveraCom.py | 6 +++--- module/plugins/internal/MultiHoster.py | 2 +- module/plugins/internal/SimpleHoster.py | 20 ++++++++++++++++---- 15 files changed, 59 insertions(+), 50 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index abcb1e5b1..ff909b596 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -13,7 +13,7 @@ from module.utils import parseFileSize class AlldebridCom(SimpleHoster): __name__ = "AlldebridCom" __type__ = "hoster" - __version__ = "0.35" + __version__ = "0.36" __pattern__ = r'https?://(?:[^/]*\.)?alldebrid\..*' @@ -73,14 +73,11 @@ class AlldebridCom(SimpleHoster): self.pyfile.name = self.getFilename(self.link) - def checkFile(self): - check = self.checkDownload({'error': "An error occured while processing your request", - 'empty': re.compile(r"^$")}) + def AlldebridCom(self): + super(AlldebridCom, self).checkFile() - if check == "error": + if self.checkDownload({'error': "An error occured while processing your request"}) is "error": self.retry(wait_time=60, reason=_("An error occured while generating link")) - elif check == "empty": - self.retry(wait_time=60, reason=_("Downloaded File was empty")) getInfo = create_getInfo(AlldebridCom) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 6a86ba4e4..ae7051572 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DebridItaliaCom(SimpleHoster): __name__ = "DebridItaliaCom" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+' @@ -36,10 +36,4 @@ class DebridItaliaCom(SimpleHoster): self.link = html.strip() - def checkFile(self): - check = self.checkDownload({'empty': re.compile(r'^$')}) - if check == "empty": - self.retry(5, 2 * 60, "Empty file downloaded") - - getInfo = create_getInfo(DebridItaliaCom) diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 56d1e911a..8778d770e 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastixRu(SimpleHoster): __name__ = "FastixRu" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P\w{24})' @@ -63,13 +63,10 @@ class FastixRu(SimpleHoster): def checkFile(self): - check = self.checkDownload({"error": "An error occurred while processing your request", - "empty": re.compile(r"^$")}) + super(FastixRu, self).checkFile() - if check == "error": + if self.checkDownload({"error": "An error occurred while processing your request"}) is "error": self.retry(wait_time=60, reason=_("An error occurred while generating link")) - elif check == "empty": - self.retry(wait_time=60, reason=_("Downloaded File was empty")) getInfo = create_getInfo(FastixRu) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 5e2057aa5..31437c6e7 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" - __version__ = "0.25" + __version__ = "0.26" __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+' @@ -58,6 +58,8 @@ class FastshareCz(SimpleHoster): def checkFile(self): + super(FastshareCz, self).checkFile() + check = self.checkDownload({ 'paralell_dl' : re.compile(r"FastShare.cz|', res)[-1] - jseval = self.js.eval("document = { write: function(e) { return e; } }; %s" % jscode) - dlLink = re.search(r'http://linksave\.in/dl-\w+', jseval).group(0) - self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) - - res = self.load(dlLink) - link = unescape(re.search(r'", self.load("http://1kh.de/l/" + id)).group(1)) - self.urls.append(new_link) diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 709083b51..a56a0a44c 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -14,7 +14,7 @@ from module.plugins.internal.CaptchaService import SolveMedia class SafelinkingNet(Crypter): __name__ = "SafelinkingNet" __type__ = "crypter" - __version__ = "0.11" + __version__ = "0.13" __pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -42,6 +42,8 @@ class SafelinkingNet(Crypter): else: postData = {"post-protect": "1"} + self.html = self.load(url) + if "link-password" in self.html: postData['link-password'] = self.getPassword() diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 10e4d8c83..5ad9f7678 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -30,21 +30,26 @@ class XFileSharingProFolder(XFSCrypter): self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern'] - self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group(1).lower() - self.HOSTER_NAME = "".join([str.capitalize() for str in self.HOSTER_DOMAIN.split('.')]) + self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower() + self.HOSTER_NAME = "".join([part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.']) + + if self.HOSTER_NAME[0].isdigit(): + self.HOSTER_NAME = '_' + self.HOSTER_NAME account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) if account and account.canUse(): self.account = account + elif self.account: self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN + else: return self.user, data = self.account.selectAccount() - self.req = self.account.getAccountRequest(self.user) - self.premium = self.account.isPremium(self.user) + self.req = self.account.getAccountRequest(self.user) + self.premium = self.account.isPremium(self.user) getInfo = create_getInfo(XFileSharingProFolder) diff --git a/module/plugins/crypter/_1KhDe.py b/module/plugins/crypter/_1KhDe.py new file mode 100644 index 000000000..c8ac3020c --- /dev/null +++ b/module/plugins/crypter/_1KhDe.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +import re + +from module.unescape import unescape +from module.plugins.Crypter import Crypter + + +class _1KhDe(Crypter): + __name__ = "1KhDe" + __type__ = "crypter" + __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?1kh\.de/f/' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] + + __description__ = """1kh.de decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("spoob", "spoob@pyload.org")] + + + def __init__(self, parent): + Crypter.__init__(self, parent) + self.parent = parent + + + def file_exists(self): + """ returns True or False + """ + return True + + + def proceed(self, url, location): + url = self.parent.url + self.html = self.load(url) + link_ids = re.findall(r"", self.load("http://1kh.de/l/" + id)).group(1)) + self.urls.append(new_link) diff --git a/module/plugins/crypter/_4ChanOrg.py b/module/plugins/crypter/_4ChanOrg.py new file mode 100644 index 000000000..a5e815639 --- /dev/null +++ b/module/plugins/crypter/_4ChanOrg.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# +# Based on 4chandl by Roland Beermann (https://gist.github.com/enkore/3492599) + +import re + +from module.plugins.Crypter import Crypter + + +class _4ChanOrg(Crypter): + __name__ = "4ChanOrg" + __type__ = "crypter" + __version__ = "0.31" + + __pattern__ = r'http://(?:www\.)?boards\.4chan\.org/\w+/res/(\d+)' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] + + __description__ = """4chan.org folder decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [] + + + def decrypt(self, pyfile): + pagehtml = self.load(pyfile.url) + images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml)) + self.urls = ["http://" + image for image in images] -- cgit v1.2.3 From e977be3c78ea9d976e9b2338244b214a4b3a5199 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Jan 2015 23:40:17 +0100 Subject: "New Year" Update: hook plugins --- module/plugins/hooks/AlldebridCom.py | 17 +++++++------ module/plugins/hooks/CaptchaBrotherhood.py | 8 +++--- module/plugins/hooks/DeathByCaptcha.py | 14 +++++------ module/plugins/hooks/DebridItaliaCom.py | 15 +++++++----- module/plugins/hooks/EasybytezCom.py | 13 +++++++--- module/plugins/hooks/FastixRu.py | 12 ++++++--- module/plugins/hooks/FreeWayMe.py | 13 ++++++---- module/plugins/hooks/LinkdecrypterCom.py | 9 ++++--- module/plugins/hooks/LinksnappyCom.py | 15 +++++++----- module/plugins/hooks/MegaDebridEu.py | 12 ++++++--- module/plugins/hooks/MultihostersCom.py | 30 ++++++++++------------- module/plugins/hooks/MultishareCz.py | 13 +++++++--- module/plugins/hooks/MyfastfileCom.py | 15 +++++++----- module/plugins/hooks/NoPremiumPl.py | 33 +++++++++++++------------ module/plugins/hooks/OverLoadMe.py | 17 +++++++------ module/plugins/hooks/PremiumTo.py | 11 ++++++--- module/plugins/hooks/PremiumizeMe.py | 15 +++++++----- module/plugins/hooks/PutdriveCom.py | 18 ++++++++++++++ module/plugins/hooks/RPNetBiz.py | 15 +++++++----- module/plugins/hooks/RapideoPl.py | 33 +++++++++++++------------ module/plugins/hooks/RealdebridCom.py | 17 +++++++------ module/plugins/hooks/RehostTo.py | 15 +++++++----- module/plugins/hooks/SimplyPremiumCom.py | 16 ++++++------ module/plugins/hooks/SimplydebridCom.py | 11 ++++++--- module/plugins/hooks/SmoozedCom.py | 39 +++++++++--------------------- module/plugins/hooks/UnrestrictLi.py | 19 ++++++++------- module/plugins/hooks/XFileSharingPro.py | 21 ++++++++-------- module/plugins/hooks/ZeveraCom.py | 20 +++++++++------ 28 files changed, 280 insertions(+), 206 deletions(-) create mode 100644 module/plugins/hooks/PutdriveCom.py (limited to 'module/plugins') diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index e1f63c31b..dddd97c0c 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -6,13 +6,16 @@ from module.plugins.internal.MultiHook import MultiHook class AlldebridCom(MultiHook): __name__ = "AlldebridCom" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" - __config__ = [("https", "bool", "Enable HTTPS", False), - ("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 ), + ("ssl" , "bool" , "Use HTTPS" , True )] __description__ = """Alldebrid.com hook plugin""" __license__ = "GPLv3" @@ -20,7 +23,7 @@ class AlldebridCom(MultiHook): def getHosters(self): - https = "https" if self.getConfig("https") else "http" + https = "https" if self.getConfig("ssl") else "http" page = self.getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 9a9f05b29..3c08f5e36 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -38,7 +38,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("username", "str", "Username", ""), ("force", "bool", "Force CT even if client is connected", False), @@ -118,14 +118,14 @@ class CaptchaBrotherhood(Hook): for _i in xrange(15): sleep(5) - res = self.get_api("askCaptchaResult", ticket) + res = self.api_response("askCaptchaResult", ticket) if res.startswith("OK-answered"): return ticket, res[12:] raise CaptchaBrotherhoodException("No solution received in time") - def get_api(self, api, ticket): + def api_response(self, api, ticket): res = getURL("%s%s.aspx" % (self.API_URL, api), get={"username": self.getConfig("username"), "password": self.getConfig("passkey"), @@ -160,7 +160,7 @@ class CaptchaBrotherhood(Hook): def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - res = self.get_api("complainCaptcha", task.data['ticket']) + res = self.api_response("complainCaptcha", task.data['ticket']) @threaded diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 98412c218..050b6fe15 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -51,7 +51,7 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), @@ -75,7 +75,7 @@ class DeathByCaptcha(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def call_api(self, api="captcha", post=False, multipart=False): + def api_response(self, api="captcha", post=False, multipart=False): req = getRequest() req.c.setopt(HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.core.version]) @@ -117,7 +117,7 @@ class DeathByCaptcha(Hook): def getCredits(self): - res = self.call_api("user", True) + res = self.api_response("user", True) if 'is_banned' in res and res['is_banned']: raise DeathByCaptchaException('banned') @@ -128,7 +128,7 @@ class DeathByCaptcha(Hook): def getStatus(self): - res = self.call_api("status", False) + res = self.api_response("status", False) if 'is_service_overloaded' in res and res['is_service_overloaded']: raise DeathByCaptchaException('service-overload') @@ -145,7 +145,7 @@ class DeathByCaptcha(Hook): data = f.read() data = "base64:" + b64encode(data) - res = self.call_api("captcha", {"captchafile": data}, multipart) + res = self.api_response("captcha", {"captchafile": data}, multipart) if "captcha" not in res: raise DeathByCaptchaException(res) @@ -153,7 +153,7 @@ class DeathByCaptcha(Hook): for _i in xrange(24): sleep(5) - res = self.call_api("captcha/%d" % ticket, False) + res = self.api_response("captcha/%d" % ticket, False) if res['text'] and res['is_correct']: break else: @@ -200,7 +200,7 @@ class DeathByCaptcha(Hook): def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: try: - res = self.call_api("captcha/%d/report" % task.data['ticket'], True) + res = self.api_response("captcha/%d/report" % task.data['ticket'], True) except DeathByCaptchaException, e: self.logError(e.getDesc()) diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py index d18be5384..719f3dd3a 100644 --- a/module/plugins/hooks/DebridItaliaCom.py +++ b/module/plugins/hooks/DebridItaliaCom.py @@ -8,12 +8,15 @@ from module.plugins.internal.MultiHook import MultiHook class DebridItaliaCom(MultiHook): __name__ = "DebridItaliaCom" __type__ = "hook" - __version__ = "0.11" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __version__ = "0.12" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Debriditalia.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 1606c9f30..c460de7b7 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -8,10 +8,15 @@ from module.plugins.internal.MultiHook import MultiHook class EasybytezCom(MultiHook): __name__ = "EasybytezCom" __type__ = "hook" - __version__ = "0.06" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", "")] + __version__ = "0.07" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """EasyBytez.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py index a4b423fb7..25126fbd3 100644 --- a/module/plugins/hooks/FastixRu.py +++ b/module/plugins/hooks/FastixRu.py @@ -7,11 +7,15 @@ from module.plugins.internal.MultiHook import MultiHook class FastixRu(MultiHook): __name__ = "FastixRu" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Fastix.ru hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 6cbea3417..6fec037d8 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -6,12 +6,15 @@ from module.plugins.internal.MultiHook import MultiHook class FreeWayMe(MultiHook): __name__ = "FreeWayMe" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """FreeWay.me hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 8592efd3d..d4924a687 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -8,11 +8,12 @@ from module.plugins.internal.MultiHook import MultiHook class LinkdecrypterCom(MultiHook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "1.00" + __version__ = "1.01" - __config__ = [("mode" , "all;listed;unlisted", "Use for crypters (if supported)" , "all"), - ("pluginlist" , "str" , "Crypter list (comma separated)" , "" ), - ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py index a1c4b90f7..5eb0c7f6d 100644 --- a/module/plugins/hooks/LinksnappyCom.py +++ b/module/plugins/hooks/LinksnappyCom.py @@ -7,12 +7,15 @@ from module.plugins.internal.MultiHook import MultiHook class LinksnappyCom(MultiHook): __name__ = "LinksnappyCom" __type__ = "hook" - __version__ = "0.03" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __version__ = "0.04" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Linksnappy.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 5fb7e1ea6..f67fa7ac0 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -7,11 +7,17 @@ from module.plugins.internal.MultiHook import MultiHook class MegaDebridEu(MultiHook): __name__ = "MegaDebridEu" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" - __config__ = [("revertfailed", "bool", "Revert to standard download if download fails", False)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - __description__ = """mega-debrid.eu hook plugin""" + __description__ = """Mega-debrid.eu hook plugin""" __license__ = "GPLv3" __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] diff --git a/module/plugins/hooks/MultihostersCom.py b/module/plugins/hooks/MultihostersCom.py index 5ada3aa56..bf88cfae7 100644 --- a/module/plugins/hooks/MultihostersCom.py +++ b/module/plugins/hooks/MultihostersCom.py @@ -1,22 +1,18 @@ # -*- coding: utf-8 -*- -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster +from module.plugins.hooks.ZeveraCom import ZeveraCom -class MultihostersCom(MultiHoster): - __name__ = "MultihostersCom" - __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", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Multihosters.com hook plugin""" - __author_name__ = "tjeh" - __author_mail__ = "tjeh@gmx.net" +class MultihostersCom(ZeveraCom): + __name__ = "MultihostersCom" + __type__ = "hook" + __version__ = "0.02" + + __config__ = [("mode" , "all;listed;unlisted", "Use for plugins (if supported)" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed", "bool" , "Revert to standard download if download fails", False), + ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] - def getHoster(self): - page = getURL("http://www.multihosters.com/jDownloader.ashx?cmd=gethosters") - return [x.strip() for x in page.split(",")] \ No newline at end of file + __description__ = """Multihosters.com hook plugin""" + __license__ = "GPLv3" + __authors__ = [("tjeh", "tjeh@gmx.net")] diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index 2dadf5dc1..8349e0de8 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -8,10 +8,15 @@ from module.plugins.internal.MultiHook import MultiHook class MultishareCz(MultiHook): __name__ = "MultishareCz" __type__ = "hook" - __version__ = "0.06" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", "uloz.to")] + __version__ = "0.07" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """MultiShare.cz hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index 2fda0d3bf..86408cb6d 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -7,12 +7,15 @@ from module.plugins.internal.MultiHook import MultiHook class MyfastfileCom(MultiHook): __name__ = "MyfastfileCom" __type__ = "hook" - __version__ = "0.04" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __version__ = "0.05" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Myfastfile.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/NoPremiumPl.py b/module/plugins/hooks/NoPremiumPl.py index 2347fc58a..1727bec70 100644 --- a/module/plugins/hooks/NoPremiumPl.py +++ b/module/plugins/hooks/NoPremiumPl.py @@ -1,28 +1,31 @@ # -*- coding: utf-8 -*- +from module.common.json_layer import json_loads from module.plugins.internal.MultiHook import MultiHook -from module.common.json_layer import json_loads as loads class NoPremiumPl(MultiHook): - __name__ = "NoPremiumPl" - __version__ = "0.02" - __type__ = "hook" + __name__ = "NoPremiumPl" + __type__ = "hook" + __version__ = "0.03" - __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)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + + __description__ = """NoPremium.pl hook plugin""" + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@nopremium.pl")] - __description__ = "NoPremium.pl hook" - __license__ = "GPLv3" - __authors__ = [("goddie", "dev@nopremium.pl")] def getHosters(self): - hostings = loads(self.getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) + hostings = json_loads(self.getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] - self.logDebug(hostings_domains) - return hostings_domains + self.logDebug(hostings_domains) + return hostings_domains diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index eb3da319a..1872f8ccb 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -6,13 +6,16 @@ from module.plugins.internal.MultiHook import MultiHook class OverLoadMe(MultiHook): __name__ = "OverLoadMe" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" - __config__ = [("https", "bool", "Enable HTTPS", True), - ("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 12)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 ), + ("ssl" , "bool" , "Use HTTPS" , True )] __description__ = """Over-Load.me hook plugin""" __license__ = "GPLv3" @@ -20,7 +23,7 @@ class OverLoadMe(MultiHook): def getHosters(self): - https = "https" if self.getConfig("https") else "http" + https = "https" if self.getConfig("ssl") else "http" page = self.getURL(https + "://api.over-load.me/hoster.php", get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() self.logDebug("Hosterlist", page) diff --git a/module/plugins/hooks/PremiumTo.py b/module/plugins/hooks/PremiumTo.py index a4203c8bb..844ecc89d 100644 --- a/module/plugins/hooks/PremiumTo.py +++ b/module/plugins/hooks/PremiumTo.py @@ -6,10 +6,15 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumTo(MultiHook): __name__ = "PremiumTo" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" - __config__ = [("mode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", "")] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Premium.to hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index d334ddd25..293fcf339 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -7,12 +7,15 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumizeMe(MultiHook): __name__ = "PremiumizeMe" __type__ = "hook" - __version__ = "0.16" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __version__ = "0.17" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Premiumize.me hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/PutdriveCom.py b/module/plugins/hooks/PutdriveCom.py new file mode 100644 index 000000000..f665dabee --- /dev/null +++ b/module/plugins/hooks/PutdriveCom.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from module.plugins.hooks.ZeveraCom import ZeveraCom + + +class PutdriveCom(ZeveraCom): + __name__ = "PutdriveCom" + __type__ = "hook" + __version__ = "0.01" + + __config__ = [("mode" , "all;listed;unlisted", "Use for plugins (if supported)" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed", "bool" , "Revert to standard download if download fails", False), + ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] + + __description__ = """Putdrive.com hook plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 9c88e6c01..0768bd6cd 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -7,12 +7,15 @@ from module.plugins.internal.MultiHook import MultiHook class RPNetBiz(MultiHook): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.13" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __version__ = "0.14" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """RPNet.biz hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index 9eb454897..b605eca17 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -1,28 +1,31 @@ # -*- coding: utf-8 -*- +from module.common.json_layer import json_loads from module.plugins.internal.MultiHook import MultiHook -from module.common.json_layer import json_loads as loads class RapideoPl(MultiHook): - __name__ = "RapideoPl" - __version__ = "0.02" - __type__ = "hook" + __name__ = "RapideoPl" + __type__ = "hook" + __version__ = "0.03" - __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)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + + __description__ = """Rapideo.pl hook plugin""" + __license__ = "GPLv3" + __authors__ = [("goddie", "dev@rapideo.pl")] - __description__ = "Rapideo.pl hook" - __license__ = "GPLv3" - __authors__ = [("goddie", "dev@rapideo.pl")] def getHosters(self): - hostings = loads(self.getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) + hostings = json_loads(self.getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] - self.logDebug(hostings_domains) - return hostings_domains + self.logDebug(hostings_domains) + return hostings_domains diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index bac18e6c3..cff97c2f9 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -6,13 +6,16 @@ from module.plugins.internal.MultiHook import MultiHook class RealdebridCom(MultiHook): __name__ = "RealdebridCom" __type__ = "hook" - __version__ = "0.45" + __version__ = "0.46" - __config__ = [("https", "bool", "Enable HTTPS", False), - ("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 ), + ("ssl" , "bool" , "Use HTTPS" , True )] __description__ = """Real-Debrid.com hook plugin""" __license__ = "GPLv3" @@ -20,7 +23,7 @@ class RealdebridCom(MultiHook): def getHosters(self): - https = "https" if self.getConfig("https") else "http" + https = "https" if self.getConfig("ssl") else "http" page = self.getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 527770eb6..81cb26f2f 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -6,12 +6,15 @@ from module.plugins.internal.MultiHook import MultiHook class RehostTo(MultiHook): __name__ = "RehostTo" __type__ = "hook" - __version__ = "0.46" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __version__ = "0.47" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Rehost.to hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py index 5f2d2a42c..843a3aa82 100644 --- a/module/plugins/hooks/SimplyPremiumCom.py +++ b/module/plugins/hooks/SimplyPremiumCom.py @@ -7,13 +7,15 @@ from module.plugins.internal.MultiHook import MultiHook class SimplyPremiumCom(MultiHook): __name__ = "SimplyPremiumCom" __type__ = "hook" - __version__ = "0.04" - - __config__ = [("activated", "bool", "Activated", "False"), - ("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", "False"), - ("interval", "int", "Reload interval in hours (0 to disable)", "24")] + __version__ = "0.05" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Simply-Premium.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py index 13c957294..10c613fb5 100644 --- a/module/plugins/hooks/SimplydebridCom.py +++ b/module/plugins/hooks/SimplydebridCom.py @@ -6,10 +6,15 @@ from module.plugins.internal.MultiHook import MultiHook class SimplydebridCom(MultiHook): __name__ = "SimplydebridCom" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", "")] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Simply-Debrid.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/SmoozedCom.py b/module/plugins/hooks/SmoozedCom.py index 0aff36c0f..4e706c959 100644 --- a/module/plugins/hooks/SmoozedCom.py +++ b/module/plugins/hooks/SmoozedCom.py @@ -6,38 +6,21 @@ from module.plugins.internal.MultiHook import MultiHook class SmoozedCom(MultiHook): __name__ = "SmoozedCom" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Smoozed.com hook plugin""" __license__ = "GPLv3" - __authors__ = [] + __authors__ = [("", "")] def getHosters(self): - # If no accounts are available there will be no hosters available - if not self.account or not self.account.canUse(): - return [] - - # Get account data - (user, data) = self.account.selectAccount() - account_info = self.account.getAccountInfo(user, True) - - # Return hoster list - return account_info["hoster"] - - - def coreReady(self): - # Get account plugin and check if there is a valid account available - self.account = self.core.accountManager.getAccountPlugin("SmoozedCom") - if not self.account.canUse(): - self.account = None - self.logError(_("Please add a valid premiumize.me account first and restart pyLoad")) - return - - # Run the overwriten core ready which actually enables the multihook hook - return MultiHook.coreReady(self) + user, data = self.account.selectAccount() + return self.account.getAccountData(user)["hosters"] diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py index e481e8449..cb5abb26e 100644 --- a/module/plugins/hooks/UnrestrictLi.py +++ b/module/plugins/hooks/UnrestrictLi.py @@ -7,13 +7,16 @@ from module.plugins.internal.MultiHook import MultiHook class UnrestrictLi(MultiHook): __name__ = "UnrestrictLi" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24), - ("history", "bool", "Delete History", False)] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 ), + ("history" , "bool" , "Delete History" , False)] __description__ = """Unrestrict.li hook plugin""" __license__ = "GPLv3" @@ -24,6 +27,4 @@ class UnrestrictLi(MultiHook): json_data = self.getURL("http://unrestrict.li/api/jdownloader/hosts.php", get={'format': "json"}) json_data = json_loads(json_data) - host_list = [element['host'] for element in json_data['result']] - - return host_list + return [element['host'] for element in json_data['result']] diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 79e373ad3..73cb0b0eb 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.28" + __version__ = "0.29" __config__ = [("activated" , "bool", "Activated" , True ), ("use_hoster_list" , "bool", "Load listed hosters only" , False), @@ -23,14 +23,15 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w+'), - 'crypter': (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + regexp = {'hoster' : (r'https?://(?:www\.)?(?P[\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', + r'https?://(?:[^/]+\.)?(?P%s)/(?:embed-)?\w+'), + 'crypter': (r'https?://(?:www\.)?(?P[\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(?P%s)/(?:user|folder)s?/\w+')} HOSTER_BUILTIN = [#WORKING HOSTERS: - "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "ravishare.com", "salefiles.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "180upload.com", "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", + "fileparadox.in", "filevice.com", "hostingbulk.com", "linestorage.com", "ravishare.com", "salefiles.com", + "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", @@ -82,7 +83,7 @@ class XFileSharingPro(Hook): len_match_list = len(plugin_list) self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, type, - "" if len_match_list is 1 else "s", + "" if len_match_list == 1 else "s", match_list.replace('|', ', '))) pattern = self.regexp[type][1] % match_list.replace('.', '\.') @@ -109,7 +110,7 @@ class XFileSharingPro(Hook): def unloadHoster(self, hoster): hdict = self.core.pluginManager.hosterPlugins[hoster] - if "new_name" in hdict and hdict['new_name'] is "XFileSharingPro": + if "new_name" in hdict and hdict['new_name'] == "XFileSharingPro": if "module" in hdict: del hdict['module'] @@ -123,7 +124,7 @@ class XFileSharingPro(Hook): # def downloadFailed(self, pyfile): - # if pyfile.pluginname is "BasePlugin" \ + # if pyfile.pluginname == "BasePlugin" \ # and pyfile.hasStatus("failed") \ # and not self.getConfig("use_hoster_list") \ # and self.unloadHoster("BasePlugin"): diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py index 51f759b1c..215ec3673 100644 --- a/module/plugins/hooks/ZeveraCom.py +++ b/module/plugins/hooks/ZeveraCom.py @@ -6,16 +6,22 @@ from module.plugins.internal.MultiHook import MultiHook class ZeveraCom(MultiHook): __name__ = "ZeveraCom" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", "")] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - __description__ = """Real-Debrid.com hook plugin""" + __description__ = """Zevera.com hook plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] def getHosters(self): - page = self.getURL("http://www.zevera.com/jDownloader.ashx", get={'cmd': "gethosters"}) - return [x.strip() for x in page.replace("\"", "").split(",")] + html = self.account.api_response(pyreq.getHTTPRequest(timeout=120), cmd="gethosters") + return [x.strip() for x in html.split(",")] -- cgit v1.2.3 From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/AlldebridCom.py | 26 ++--- module/plugins/hoster/BasePlugin.py | 11 ++- module/plugins/hoster/BezvadataCz.py | 4 +- module/plugins/hoster/BitshareCom.py | 9 +- module/plugins/hoster/CatShareNet.py | 10 +- module/plugins/hoster/CloudzillaTo.py | 8 +- module/plugins/hoster/CrockoCom.py | 10 +- module/plugins/hoster/CzshareCom.py | 34 ++++--- module/plugins/hoster/DataHu.py | 12 +-- module/plugins/hoster/DataportCz.py | 10 +- module/plugins/hoster/DateiTo.py | 4 +- module/plugins/hoster/DebridItaliaCom.py | 10 +- module/plugins/hoster/DepositfilesCom.py | 20 ++-- module/plugins/hoster/DevhostSt.py | 17 +--- module/plugins/hoster/DlFreeFr.py | 6 +- module/plugins/hoster/DropboxCom.py | 10 +- module/plugins/hoster/EdiskCz.py | 6 +- module/plugins/hoster/EuroshareEu.py | 30 +++--- module/plugins/hoster/ExtabitCom.py | 12 +-- module/plugins/hoster/FastixRu.py | 20 ++-- module/plugins/hoster/FastshareCz.py | 16 +-- module/plugins/hoster/FileParadoxIn.py | 23 ----- module/plugins/hoster/FileSharkPl.py | 12 +-- module/plugins/hoster/FileStoreTo.py | 6 +- module/plugins/hoster/FilecloudIo.py | 37 +++---- module/plugins/hoster/FilefactoryCom.py | 31 +++--- module/plugins/hoster/FilepostCom.py | 4 +- module/plugins/hoster/FilepupNet.py | 12 +-- module/plugins/hoster/FilerNet.py | 8 +- module/plugins/hoster/FilesMailRu.py | 5 +- module/plugins/hoster/FileserveCom.py | 15 ++- module/plugins/hoster/FourSharedCom.py | 61 ------------ module/plugins/hoster/FreakshareCom.py | 12 ++- module/plugins/hoster/FreeWayMe.py | 10 +- module/plugins/hoster/FshareVn.py | 46 +++------ module/plugins/hoster/Ftp.py | 4 +- module/plugins/hoster/GigapetaCom.py | 6 +- module/plugins/hoster/GooIm.py | 8 +- module/plugins/hoster/HellshareCz.py | 37 +++---- module/plugins/hoster/HundredEightyUploadCom.py | 24 ----- module/plugins/hoster/IfileIt.py | 55 +---------- module/plugins/hoster/IfolderRu.py | 24 ++--- module/plugins/hoster/JumbofilesCom.py | 14 ++- module/plugins/hoster/KingfilesNet.py | 20 ++-- module/plugins/hoster/LetitbitNet.py | 30 ++++-- module/plugins/hoster/LinestorageCom.py | 21 ---- module/plugins/hoster/LinksnappyCom.py | 23 ++--- module/plugins/hoster/LoadTo.py | 20 +--- module/plugins/hoster/LuckyShareNet.py | 7 +- module/plugins/hoster/MediafireCom.py | 8 +- module/plugins/hoster/MegaDebridEu.py | 14 +-- module/plugins/hoster/MegaRapidCz.py | 18 ++-- module/plugins/hoster/MegacrypterCom.py | 13 +-- module/plugins/hoster/MegasharesCom.py | 6 +- module/plugins/hoster/MultihostersCom.py | 44 ++------- module/plugins/hoster/MultishareCz.py | 10 +- module/plugins/hoster/MyfastfileCom.py | 12 +-- module/plugins/hoster/NarodRu.py | 16 ++- module/plugins/hoster/NetloadIn.py | 6 +- module/plugins/hoster/NitroflareCom.py | 123 +++++++++++------------- module/plugins/hoster/NoPremiumPl.py | 118 +++++++++++------------ module/plugins/hoster/NowDownloadSx.py | 8 +- module/plugins/hoster/NowVideoSx.py | 4 +- module/plugins/hoster/OneFichierCom.py | 60 ------------ module/plugins/hoster/OverLoadMe.py | 29 +++--- module/plugins/hoster/PremiumTo.py | 19 ++-- module/plugins/hoster/PremiumizeMe.py | 14 +-- module/plugins/hoster/PromptfileCom.py | 12 +-- module/plugins/hoster/PutdriveCom.py | 15 +++ module/plugins/hoster/QuickshareCz.py | 13 ++- module/plugins/hoster/RPNetBiz.py | 12 +-- module/plugins/hoster/RapideoPl.py | 116 +++++++++++----------- module/plugins/hoster/RapidfileshareNet.py | 6 +- module/plugins/hoster/RapidgatorNet.py | 23 ++--- module/plugins/hoster/RapiduNet.py | 8 +- module/plugins/hoster/RealdebridCom.py | 29 +++--- module/plugins/hoster/RehostTo.py | 12 +-- module/plugins/hoster/RemixshareCom.py | 10 +- module/plugins/hoster/SendmywayCom.py | 21 ---- module/plugins/hoster/SendspaceCom.py | 10 +- module/plugins/hoster/ShareonlineBiz.py | 36 +++---- module/plugins/hoster/ShareplaceCom.py | 4 +- module/plugins/hoster/SimplyPremiumCom.py | 6 +- module/plugins/hoster/SimplydebridCom.py | 16 ++- module/plugins/hoster/SmoozedCom.py | 57 +++++------ module/plugins/hoster/SpeedyshareCom.py | 12 +-- module/plugins/hoster/TurbobitNet.py | 14 ++- module/plugins/hoster/TusfilesNet.py | 15 ++- module/plugins/hoster/TwoSharedCom.py | 41 -------- module/plugins/hoster/UlozTo.py | 39 +++----- module/plugins/hoster/UloziskoSk.py | 23 +++-- module/plugins/hoster/UnibytesCom.py | 14 ++- module/plugins/hoster/UnrestrictLi.py | 10 +- module/plugins/hoster/UpleaCom.py | 6 +- module/plugins/hoster/UploadableCh.py | 22 ++--- module/plugins/hoster/UploadheroCom.py | 19 ++-- module/plugins/hoster/UploadingCom.py | 27 +++--- module/plugins/hoster/UpstoreNet.py | 12 +-- module/plugins/hoster/VeohCom.py | 7 +- module/plugins/hoster/VimeoCom.py | 9 +- module/plugins/hoster/WebshareCz.py | 11 +-- module/plugins/hoster/WrzucTo.py | 8 +- module/plugins/hoster/XFileSharingPro.py | 19 ++-- module/plugins/hoster/YibaishiwuCom.py | 14 ++- module/plugins/hoster/YourfilesTo.py | 4 +- module/plugins/hoster/ZeveraCom.py | 35 ++++--- module/plugins/hoster/ZippyshareCom.py | 17 ++-- module/plugins/hoster/_1FichierCom.py | 60 ++++++++++++ module/plugins/hoster/_2SharedCom.py | 32 ++++++ module/plugins/hoster/_4SharedCom.py | 62 ++++++++++++ 110 files changed, 1030 insertions(+), 1290 deletions(-) delete mode 100644 module/plugins/hoster/FileParadoxIn.py delete mode 100644 module/plugins/hoster/FourSharedCom.py delete mode 100644 module/plugins/hoster/HundredEightyUploadCom.py delete mode 100644 module/plugins/hoster/LinestorageCom.py delete mode 100644 module/plugins/hoster/OneFichierCom.py create mode 100644 module/plugins/hoster/PutdriveCom.py delete mode 100644 module/plugins/hoster/SendmywayCom.py delete mode 100644 module/plugins/hoster/TwoSharedCom.py create mode 100644 module/plugins/hoster/_1FichierCom.py create mode 100644 module/plugins/hoster/_2SharedCom.py create mode 100644 module/plugins/hoster/_4SharedCom.py (limited to 'module/plugins') diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 751ff415c..4db32da5d 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -13,11 +13,11 @@ from module.utils import parseFileSize class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" __type__ = "hoster" - __version__ = "0.42" + __version__ = "0.43" __pattern__ = r'https?://(?:www\.|s\d+\.)?alldebrid\.com/dl/[\w^_]+' - __description__ = """Alldebrid.com hoster plugin""" + __description__ = """Alldebrid.com multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("Andy Voigt", "spamsales@online.de")] @@ -38,11 +38,11 @@ class AlldebridCom(MultiHoster): self.chunkLimit = 16 - def handlePremium(self): + def handlePremium(self, pyfile): password = self.getPassword() data = json_loads(self.load("http://www.alldebrid.com/service.php", - get={'link': self.pyfile.url, 'json': "true", 'pw': password})) + get={'link': pyfile.url, 'json': "true", 'pw': password})) self.logDebug("Json data", data) @@ -53,9 +53,9 @@ class AlldebridCom(MultiHoster): self.logWarning(data['error']) self.tempOffline() else: - if self.pyfile.name and not self.pyfile.name.endswith('.tmp'): - self.pyfile.name = data['filename'] - self.pyfile.size = parseFileSize(data['filesize']) + if pyfile.name and not pyfile.name.endswith('.tmp'): + pyfile.name = data['filename'] + pyfile.size = parseFileSize(data['filesize']) self.link = data['link'] if self.getConfig("https"): @@ -63,19 +63,19 @@ class AlldebridCom(MultiHoster): else: self.link = self.link.replace("https://", "http://") - if self.link != self.pyfile.url: + if self.link != pyfile.url: self.logDebug("New URL: %s" % self.link) - if self.pyfile.name.startswith("http") or self.pyfile.name.startswith("Unknown"): + if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set - self.pyfile.name = self.getFilename(self.link) + pyfile.name = self.getFilename(self.link) def checkFile(self): - super(AlldebridCom, self).checkFile() - - if self.checkDownload({'error': "An error occured while processing your request"}) is "error": + if self.checkDownload({'error': "An error occured while processing your request"}) == "error": self.retry(wait_time=60, reason=_("An error occured while generating link")) + return super(AlldebridCom, self).checkFile() + getInfo = create_getInfo(AlldebridCom) diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index d0d8e7cc8..32ba7094a 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.26" + __version__ = "0.27" __pattern__ = r'^unmatchable$' @@ -58,7 +58,7 @@ class BasePlugin(Hoster): if server in servers: self.logDebug("Logging on to %s" % server) - self.req.addAuth(account.accounts[server]['password']) + self.req.addAuth(account.getAccountData(server)['password']) else: pwd = self.getPassword() if ':' in pwd: @@ -72,8 +72,11 @@ class BasePlugin(Hoster): else: self.fail(_("No file downloaded")) #@TODO: Move to hoster class in 0.4.10 - if self.checkDownload({'empty': re.compile(r"^$")}) is "empty": #@TODO: Move to hoster in 0.4.10 - self.fail(_("Empty file")) + check = self.checkDownload('empty file': re.compile(r'\A\Z'), + 'html file' : re.compile(r'\A\s*)?\d{3}(\Z|\s+)')}): + if check: + self.fail(check.capitalize()) def downloadFile(self, pyfile): diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 9ca4b4b1a..8d56f1ff6 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" - __version__ = "0.25" + __version__ = "0.26" __pattern__ = r'http://(?:www\.)?bezvadata\.cz/stahnout/.+' @@ -27,7 +27,7 @@ class BezvadataCz(SimpleHoster): self.multiDL = True - def handleFree(self): + def handleFree(self, pyfile): #download button m = re.search(r'\w+)(?(1)/(?P.+?)\.html)' @@ -73,12 +73,7 @@ class BitshareCom(SimpleHoster): # This may either download our file or forward us to an error page self.download(self.getDownloadUrl()) - check = self.checkDownload({"404": ">404 Not Found<", "Error": ">Error occured<"}) - - if check == "404": - self.retry(3, 60, 'Error 404') - - elif check == "error": + if self.checkDownload({"error": ">Error occured<"}): self.retry(5, 5 * 60, "Bitshare host : Error occured") diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 949a021dd..f2ddd64a0 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' @@ -27,7 +27,7 @@ class CatShareNet(SimpleHoster): IP_BLOCKED_PATTERN = ur'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<' SECONDS_PATTERN = 'var\scount\s=\s(\d+);' - LINK_PATTERN = r'

' + LINK_FREE_PATTERN = r'' def setup(self): @@ -42,7 +42,7 @@ class CatShareNet(SimpleHoster): return super(CatShareNet, self).getFileInfo() - def handleFree(self): + def handleFree(self, pyfile): m = re.search(self.SECONDS_PATTERN, self.html) if m: wait_time = int(m.group(1)) @@ -51,11 +51,11 @@ class CatShareNet(SimpleHoster): recaptcha = ReCaptcha(self) challenge, response = recaptcha.challenge() - self.html = self.load(self.pyfile.url, + self.html = self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) - m = re.search(self.LINK_PATTERN, self.html) + m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: self.invalidCaptcha() self.retry(reason=_("Wrong captcha entered")) diff --git a/module/plugins/hoster/CloudzillaTo.py b/module/plugins/hoster/CloudzillaTo.py index d8b5e8b5d..58b1ac0dd 100644 --- a/module/plugins/hoster/CloudzillaTo.py +++ b/module/plugins/hoster/CloudzillaTo.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class CloudzillaTo(SimpleHoster): __name__ = "CloudzillaTo" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'http://(?:www\.)?cloudzilla\.to/share/file/(?P[\w^_]+)' @@ -32,7 +32,7 @@ class CloudzillaTo(SimpleHoster): self.retry(reason="Wrong password") - def handleFree(self): + def handleFree(self, pyfile): self.html = self.load("http://www.cloudzilla.to/generateticket/", post={'file_id': self.info['pattern']['ID'], 'key': self.getPassword()}) @@ -54,8 +54,8 @@ class CloudzillaTo(SimpleHoster): 'ticket_id': ticket['ticket_id']} - def handlePremium(self): - return self.handleFree() + def handlePremium(self, pyfile): + return self.handleFree(pyfile) getInfo = create_getInfo(CloudzillaTo) diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index e5f94800b..31d0eec95 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class CrockoCom(SimpleHoster): __name__ = "CrockoCom" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'http://(?:www\.)?(crocko|easy-share)\.com/\w+' @@ -30,7 +30,7 @@ class CrockoCom(SimpleHoster): NAME_REPLACEMENTS = [(r'<[^>]*>', '')] - def handleFree(self): + def handleFree(self, pyfile): if "You need Premium membership to download this file." in self.html: self.fail(_("You need Premium membership to download this file")) @@ -55,11 +55,7 @@ class CrockoCom(SimpleHoster): inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge() self.download(action, post=inputs) - check = self.checkDownload({ - "captcha_err": recaptcha.KEY_AJAX_PATTERN - }) - - if check == "captcha_err": + if self.checkDownload({"captcha": recaptcha.KEY_AJAX_PATTERN}): self.invalidCaptcha() else: break diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index aa381d712..fb9e7f457 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -12,7 +12,7 @@ from module.utils import parseFileSize class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" - __version__ = "0.96" + __version__ = "0.97" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/(\d+/|download\.php\?).+' @@ -63,7 +63,7 @@ class CzshareCom(SimpleHoster): return True - def handlePremium(self): + def handlePremium(self, pyfile): # parse download link try: form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.S).group(1) @@ -77,12 +77,14 @@ class CzshareCom(SimpleHoster): self.checkDownloadedFile() - def handleFree(self): + def handleFree(self, pyfile): # get free url m = re.search(self.FREE_URL_PATTERN, self.html) if m is None: self.error(_("FREE_URL_PATTERN not found")) + parsed_url = "http://sdilej.cz" + m.group(1) + self.logDebug("PARSED_URL:" + parsed_url) # get download ticket and parse html @@ -93,7 +95,8 @@ class CzshareCom(SimpleHoster): try: form = re.search(self.FREE_FORM_PATTERN, self.html, re.S).group(1) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - self.pyfile.size = int(inputs['size']) + pyfile.size = int(inputs['size']) + except Exception, e: self.logError(e) self.error(_("Form")) @@ -103,10 +106,13 @@ class CzshareCom(SimpleHoster): for _i in xrange(5): inputs['captchastring2'] = self.decryptCaptcha(captcha_url) self.html = self.load(parsed_url, cookies=True, post=inputs, decode=True) + if u"
  • Zadaný ověřovací kód nesouhlasí!
  • " in self.html: self.invalidCaptcha() + elif re.search(self.MULTIDL_PATTERN, self.html): self.longWait(5 * 60, 12) + else: self.correctCaptcha() break @@ -118,6 +124,7 @@ class CzshareCom(SimpleHoster): # download the file, destination is determined by pyLoad self.logDebug("WAIT URL", self.req.lastEffectiveURL) + m = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL) if m is None: self.error(_("Download URL not found")) @@ -132,19 +139,22 @@ class CzshareCom(SimpleHoster): def checkDownloadedFile(self): # check download check = self.checkDownload({ - "temp_offline": re.compile(r"^Soubor je do.*asn.* nedostupn.*$"), - "credit": re.compile(r"^Nem.*te dostate.*n.* kredit.$"), - "multi_dl": re.compile(self.MULTIDL_PATTERN), - "captcha_err": "
  • Zadaný ověřovací kód nesouhlasí!
  • " + "temp offline" : re.compile(r"^Soubor je do.*asn.* nedostupn.*$"), + "credit" : re.compile(r"^Nem.*te dostate.*n.* kredit.$"), + "multi-dl" : re.compile(self.MULTIDL_PATTERN), + "captcha" : "
  • Zadaný ověřovací kód nesouhlasí!
  • " }) - if check == "temp_offline": + if check == "temp offline": self.fail(_("File not available - try later")) - if check == "credit": + + elif check == "credit": self.resetAccount() - elif check == "multi_dl": + + elif check == "multi-dl": self.longWait(5 * 60, 12) - elif check == "captcha_err": + + elif check == "captcha": self.invalidCaptcha() self.retry() diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py index 437fea7cd..f4b0692a8 100644 --- a/module/plugins/hoster/DataHu.py +++ b/module/plugins/hoster/DataHu.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DataHu(SimpleHoster): __name__ = "DataHu" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'http://(?:www\.)?data\.hu/get/\w+' @@ -23,7 +23,7 @@ class DataHu(SimpleHoster): INFO_PATTERN = ur'(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se' OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik' - LINK_PATTERN = r'
    ' + LINK_FREE_PATTERN = r'
    ' def setup(self): @@ -31,12 +31,4 @@ class DataHu(SimpleHoster): self.multiDL = self.premium - def handleFree(self): - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.error(_("LINK_PATTERN not found")) - - self.download(m.group(1), disposition=True) - - getInfo = create_getInfo(DataHu) diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 8e74f5553..266199616 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -6,7 +6,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" - __version__ = "0.40" + __version__ = "0.41" __pattern__ = r'http://(?:www\.)?dataport\.cz/file/(.+)' @@ -23,7 +23,7 @@ class DataportCz(SimpleHoster): FREE_SLOTS_PATTERN = ur'Počet volných slotů: (\d+)
    ' - def handleFree(self): + def handleFree(self, pyfile): captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"} for _i in xrange(60): @@ -40,14 +40,16 @@ class DataportCz(SimpleHoster): self.html = self.download("http://www.dataport.cz%s" % action, post=inputs) check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', - "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) + "slot" : 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) if check == "captcha": self.error(_("invalid captcha")) + elif check == "slot": self.logDebug("No free slots - wait 60s and retry") self.wait(60, False) - self.html = self.load(self.pyfile.url, decode=True) + self.html = self.load(pyfile.url, decode=True) continue + else: break diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index e4bff8458..99b86e000 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DateiTo(SimpleHoster): __name__ = "DateiTo" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' @@ -28,7 +28,7 @@ class DateiTo(SimpleHoster): DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' - def handleFree(self): + def handleFree(self, pyfile): url = 'http://datei.to/ajax/download.php' data = {'P': 'I', 'ID': self.info['pattern']['ID']} recaptcha = ReCaptcha(self) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 11b6da918..8cda56c0c 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -8,11 +8,11 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" __type__ = "hoster" - __version__ = "0.16" + __version__ = "0.17" __pattern__ = r'https?://(?:www\.|s\d+\.)?debriditalia\.com/dl/\d+' - __description__ = """Debriditalia.com hoster plugin""" + __description__ = """Debriditalia.com multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it"), ("Walter Purcaro", "vuolter@gmail.com")] @@ -21,9 +21,9 @@ class DebridItaliaCom(MultiHoster): URL_REPLACEMENTS = [("https://", "http://")] - def handlePremium(self): + def handlePremium(self, pyfile): self.html = self.load("http://www.debriditalia.com/api.php", - get={'generate': "on", 'link': self.pyfile.url, 'p': self.getPassword()}) + get={'generate': "on", 'link': pyfile.url, 'p': self.getPassword()}) if "ERROR:" not in self.html: self.link = self.html.strip() @@ -32,7 +32,7 @@ class DebridItaliaCom(MultiHoster): self.html = self.load("http://debriditalia.com/linkgen2.php", post={'xjxfun' : "convertiLink", - 'xjxargs[]': "S" % self.pyfile.url, + 'xjxargs[]': "S" % pyfile.url, 'xjxargs[]': "S%s" % self.getPassword()}) try: self.link = re.search(r'
    \w+)' @@ -32,14 +32,12 @@ class DepositfilesCom(SimpleHoster): COOKIES = [("dfiles.eu", "lang_current", "en")] - FREE_LINK_PATTERN = r'' in self.html: self.logWarning(_("Download limit reached")) self.retry(25, 60 * 60, "Download limit reached") @@ -109,8 +107,8 @@ class DepositfilesCom(SimpleHoster): self.account.relogin(self.user) self.retry() else: - link = re.search(self.PREMIUM_LINK_PATTERN, self.html) - mirror = re.search(self.PREMIUM_MIRROR_PATTERN, self.html) + link = re.search(self.LINK_PREMIUM_PATTERN, self.html) + mirror = re.search(self.LINK_MIRROR_PATTERN, self.html) if link: dlink = link.group(1) elif mirror: diff --git a/module/plugins/hoster/DevhostSt.py b/module/plugins/hoster/DevhostSt.py index 85e36edb3..2a8734655 100644 --- a/module/plugins/hoster/DevhostSt.py +++ b/module/plugins/hoster/DevhostSt.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DevhostSt(SimpleHoster): __name__ = "DevhostSt" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?d-h\.st/(?!users/)\w{3}' @@ -24,7 +24,7 @@ class DevhostSt(SimpleHoster): SIZE_PATTERN = r'>Size: (?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>File Not Found<' - LINK_PATTERN = r'id="downloadfile" href="(.+?)"' + LINK_FREE_PATTERN = r'id="downloadfile" href="(.+?)"' def setup(self): @@ -32,17 +32,4 @@ class DevhostSt(SimpleHoster): self.chunkLimit = 1 - def handleFree(self): - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.error(_("Download link not found")) - - dl_url = m.group(1) - self.download(dl_url, disposition=True) - - check = self.checkDownload({'html': re.compile("html")}) - if check == "html": - self.error(_("Downloaded file is an html page")) - - getInfo = create_getInfo(DevhostSt) diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index 793c81b1c..ec40b64ce 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -36,7 +36,7 @@ class CustomBrowser(Browser): class DlFreeFr(SimpleHoster): __name__ = "DlFreeFr" __type__ = "hoster" - __version__ = "0.26" + __version__ = "0.27" __pattern__ = r'http://(?:www\.)?dl\.free\.fr/(\w+|getfile\.pl\?file=/\w+)' @@ -78,7 +78,7 @@ class DlFreeFr(SimpleHoster): if content_type and content_type.startswith("text/html"): # Undirect acces to requested file, with a web page providing it (captcha) self.html = self.load(valid_url) - self.handleFree() + self.handleFree(pyfile) else: # Direct access to requested file for users using free.fr as Internet Service Provider. self.download(valid_url, disposition=True) @@ -88,7 +88,7 @@ class DlFreeFr(SimpleHoster): self.fail(_("Invalid return code: ") + str(headers.get('code'))) - def handleFree(self): + def handleFree(self, pyfile): action, inputs = self.parseHtmlForm('action="getfile.pl"') adyoulike = AdYouLike(self) diff --git a/module/plugins/hoster/DropboxCom.py b/module/plugins/hoster/DropboxCom.py index 658974d13..a8ef5b4bc 100644 --- a/module/plugins/hoster/DropboxCom.py +++ b/module/plugins/hoster/DropboxCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DropboxCom(SimpleHoster): __name__ = "DropboxCom" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'https?://(?:www\.)?dropbox\.com/.+' @@ -31,12 +31,8 @@ class DropboxCom(SimpleHoster): self.resumeDownload = True - def handleFree(self): - self.download(self.pyfile.url, get={'dl': "1"}) - - check = self.checkDownload({'html': re.compile("html")}) - if check == "html": - self.error(_("Downloaded file is an html page")) + def handleFree(self, pyfile): + self.download(pyfile.url, get={'dl': "1"}) getInfo = create_getInfo(DropboxCom) diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py index eb9338871..f8ccc972e 100644 --- a/module/plugins/hoster/EdiskCz.py +++ b/module/plugins/hoster/EdiskCz.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EdiskCz(SimpleHoster): __name__ = "EdiskCz" __type__ = "hoster" - __version__ = "0.22" + __version__ = "0.23" __pattern__ = r'http://(?:www\.)?edisk\.(cz|sk|eu)/(stahni|sk/stahni|en/download)/.+' @@ -21,7 +21,7 @@ class EdiskCz(SimpleHoster): OFFLINE_PATTERN = r'

    This file does not exist due to one of the following: