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/hoster/NoPremiumPl.py | 132 +++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 module/plugins/hoster/NoPremiumPl.py (limited to 'module/plugins/hoster') 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/hoster/RapideoPl.py | 132 +++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 module/plugins/hoster/RapideoPl.py (limited to 'module/plugins/hoster') 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 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/hoster/NoPremiumPl.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'module/plugins/hoster') 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/hoster/RapideoPl.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'module/plugins/hoster') 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/hoster/RapideoPl.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'module/plugins/hoster') 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/hoster/NoPremiumPl.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hoster') 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/hoster/NoPremiumPl.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'module/plugins/hoster') 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/hoster/NoPremiumPl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster') 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/hoster/NoPremiumPl.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'module/plugins/hoster') 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 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/hoster') 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 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/hoster') 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/hoster/RapideoPl.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster') 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/hoster/RapideoPl.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'module/plugins/hoster') 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 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/hoster') 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/hoster/NoPremiumPl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster') 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/hoster') 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/hoster/MultihostersCom.py | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 module/plugins/hoster/MultihostersCom.py (limited to 'module/plugins/hoster') 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 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/hoster') 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/hoster') 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/hoster/NoPremiumPl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') 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/hoster/RapideoPl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') 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/hoster') 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 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/hoster') 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/hoster') 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 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/hoster/BasePlugin.py | 3 +++ module/plugins/hoster/DodanePl.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster') 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): -- 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/hoster/FastshareCz.py | 5 ++--- module/plugins/hoster/FileSharkPl.py | 4 +--- module/plugins/hoster/FilerNet.py | 15 +++++++-------- module/plugins/hoster/Keep2shareCc.py | 25 +++++++++++-------------- 4 files changed, 21 insertions(+), 28 deletions(-) (limited to 'module/plugins/hoster') 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 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster') 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) -- 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/hoster/SendspaceCom.py | 9 +++++---- module/plugins/hoster/TusfilesNet.py | 4 ++-- module/plugins/hoster/ZippyshareCom.py | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster') 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/hoster/FilerNet.py | 22 +++++++++++++--------- module/plugins/hoster/SendspaceCom.py | 4 ++-- module/plugins/hoster/ShareonlineBiz.py | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster') 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 -- 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/hoster') 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/hoster') 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/hoster') 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/hoster') 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 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/hoster/UnrestrictLi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') 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) -- 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/hoster') 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/hoster') 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 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/hoster') 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 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 +++ 17 files changed, 49 insertions(+) (limited to 'module/plugins/hoster') 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 -- 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/hoster/LinestorageCom.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 module/plugins/hoster/LinestorageCom.py (limited to 'module/plugins/hoster') 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 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/hoster') 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/hoster') 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 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 +++--- 13 files changed, 42 insertions(+), 45 deletions(-) (limited to 'module/plugins/hoster') 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|