From 9868e698db21da5997ecd410887728d20cd9a661 Mon Sep 17 00:00:00 2001 From: EvolutionClip Date: Fri, 5 Jun 2015 22:49:37 +0200 Subject: Create HighWayMe.py --- module/plugins/hoster/HighWayMe.py | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 module/plugins/hoster/HighWayMe.py (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py new file mode 100644 index 000000000..7e8f8a165 --- /dev/null +++ b/module/plugins/hoster/HighWayMe.py @@ -0,0 +1,76 @@ ++# -*- coding: utf-8 -*- ++ ++import re ++ ++from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo ++from module.plugins.internal.SimpleHoster import secondsToMidnight ++ ++ ++class HighWayMe(MultiHoster): ++ __name__ = "HighWayMe" ++ __type__ = "hoster" ++ __version__ = "0.08" ++ ++ __pattern__ = r'https?://.+high-way\.my' ++ __config__ = [("use_premium", "bool", "Use premium account if available", True)] ++ ++ __description__ = """High-Way.Me multi-hoster plugin""" ++ __license__ = "GPLv3" ++ __authors__ = [("EvolutionClip", "evolutionclip@live.de")] ++ ++ ++ def setup(self): ++ self.chunkLimit = 4 ++ ++ ++ def checkErrors(self): ++ if '0' in self.html or ( ++ "You are not allowed to download from this host" in self.html and self.premium): ++ self.account.relogin(self.user) ++ self.retry() ++ ++ elif "9" in self.html: ++ self.offline() ++ ++ elif "downloadlimit" in self.html: ++ self.logWarning(_("Reached maximum connctions")) ++ self.retry(5, 60, _("Reached maximum connctions")) ++ ++ elif "trafficlimit" in self.html: ++ self.logWarning(_("Reached daily limit")) ++ self.retry(wait_time=secondsToMidnight(gmt=2), reason="Daily limit for this host reached") ++ ++ elif "8" in self.html: ++ self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) ++ self.retry(5, 60, _("Hoster is temporarily unavailable")) ++ ++ ++ def handlePremium(self, pyfile): ++ for i in xrange(5): ++ self.html = self.load("https://high-way.me/load.php", get={'link': self.pyfile.url}) ++ ++ if self.html: ++ self.logDebug("JSON data: " + self.html) ++ break ++ else: ++ self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) ++ self.retry(5, 60, _("Unable to get API data")) ++ ++ self.checkErrors() ++ ++ try: ++ self.pyfile.name = re.search(r'([^<]+)', self.html).group(1) ++ ++ except AttributeError: ++ self.pyfile.name = "" ++ ++ try: ++ self.pyfile.size = re.search(r'(\d+)', self.html).group(1) ++ ++ except AttributeError: ++ self.pyfile.size = 0 ++ ++ self.link = re.search(r'([^<]+)', self.html).group(1) ++ ++ ++getInfo = create_getInfo(HighWayMe) -- cgit v1.2.3 From ba0d4da7d7944167be120c5a1a87ad2fad9a4226 Mon Sep 17 00:00:00 2001 From: EvolutionClip Date: Fri, 5 Jun 2015 22:56:34 +0200 Subject: Added Comment Line 27: Is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. --- module/plugins/hoster/HighWayMe.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index 7e8f8a165..e7b3fd739 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -24,8 +24,7 @@ + + + def checkErrors(self): -+ if '0' in self.html or ( -+ "You are not allowed to download from this host" in self.html and self.premium): ++ if '0' in self.html: #This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. + self.account.relogin(self.user) + self.retry() + -- cgit v1.2.3 From b81d202ab0eeb692a85ee4dda946810fb9886f59 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Jun 2015 03:33:26 +0200 Subject: [HighWayMe] Cleanup --- module/plugins/hoster/HighWayMe.py | 151 +++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 75 deletions(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index e7b3fd739..eacf7a47e 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -1,75 +1,76 @@ -+# -*- coding: utf-8 -*- -+ -+import re -+ -+from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -+from module.plugins.internal.SimpleHoster import secondsToMidnight -+ -+ -+class HighWayMe(MultiHoster): -+ __name__ = "HighWayMe" -+ __type__ = "hoster" -+ __version__ = "0.08" -+ -+ __pattern__ = r'https?://.+high-way\.my' -+ __config__ = [("use_premium", "bool", "Use premium account if available", True)] -+ -+ __description__ = """High-Way.Me multi-hoster plugin""" -+ __license__ = "GPLv3" -+ __authors__ = [("EvolutionClip", "evolutionclip@live.de")] -+ -+ -+ def setup(self): -+ self.chunkLimit = 4 -+ -+ -+ def checkErrors(self): -+ if '0' in self.html: #This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. -+ self.account.relogin(self.user) -+ self.retry() -+ -+ elif "9" in self.html: -+ self.offline() -+ -+ elif "downloadlimit" in self.html: -+ self.logWarning(_("Reached maximum connctions")) -+ self.retry(5, 60, _("Reached maximum connctions")) -+ -+ elif "trafficlimit" in self.html: -+ self.logWarning(_("Reached daily limit")) -+ self.retry(wait_time=secondsToMidnight(gmt=2), reason="Daily limit for this host reached") -+ -+ elif "8" in self.html: -+ self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) -+ self.retry(5, 60, _("Hoster is temporarily unavailable")) -+ -+ -+ def handlePremium(self, pyfile): -+ for i in xrange(5): -+ self.html = self.load("https://high-way.me/load.php", get={'link': self.pyfile.url}) -+ -+ if self.html: -+ self.logDebug("JSON data: " + self.html) -+ break -+ else: -+ self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) -+ self.retry(5, 60, _("Unable to get API data")) -+ -+ self.checkErrors() -+ -+ try: -+ self.pyfile.name = re.search(r'([^<]+)', self.html).group(1) -+ -+ except AttributeError: -+ self.pyfile.name = "" -+ -+ try: -+ self.pyfile.size = re.search(r'(\d+)', self.html).group(1) -+ -+ except AttributeError: -+ self.pyfile.size = 0 -+ -+ self.link = re.search(r'([^<]+)', self.html).group(1) -+ -+ -+getInfo = create_getInfo(HighWayMe) +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo +from module.plugins.internal.SimpleHoster import secondsToMidnight + + +class HighWayMe(MultiHoster): + __name__ = "HighWayMe" + __type__ = "hoster" + __version__ = "0.09" + + __pattern__ = r'https?://.+high-way\.my' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] + + __description__ = """High-Way.me multi-hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("EvolutionClip", "evolutionclip@live.de")] + + + def setup(self): + self.chunkLimit = 4 + + + def checkErrors(self): + if '0' in self.html: #@NOTE: This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. + self.account.relogin(self.user) + self.retry() + + elif "9" in self.html: + self.offline() + + elif "downloadlimit" in self.html: + self.logWarning(_("Reached maximum connctions")) + self.retry(5, 60, _("Reached maximum connctions")) + + elif "trafficlimit" in self.html: + self.logWarning(_("Reached daily limit")) + self.retry(wait_time=secondsToMidnight(gmt=2), reason="Daily limit for this host reached") + + elif "8" in self.html: + self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) + self.retry(5, 60, _("Hoster is temporarily unavailable")) + + + def handlePremium(self, pyfile): + for _i in xrange(5): + self.html = self.load("https://high-way.me/load.php", + get={'link': self.pyfile.url}) + + if self.html: + self.logDebug("JSON data: " + self.html) + break + else: + self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) + self.retry(5, 60, _("Unable to get API data")) + + self.checkErrors() + + try: + self.pyfile.name = re.search(r'([^<]+)', self.html).group(1) + + except AttributeError: + self.pyfile.name = "" + + try: + self.pyfile.size = re.search(r'(\d+)', self.html).group(1) + + except AttributeError: + self.pyfile.size = 0 + + self.link = re.search(r'([^<]+)', self.html).group(1) + + +getInfo = create_getInfo(HighWayMe) -- cgit v1.2.3 From f0b7d1ef2b2e6068062996e01e9684628cdabb35 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 10 Jun 2015 10:40:43 +0200 Subject: Update plugins (2) --- module/plugins/hoster/HighWayMe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index eacf7a47e..837eb1ff3 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import secondsToMidnight class HighWayMe(MultiHoster): __name__ = "HighWayMe" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'https?://.+high-way\.my' __config__ = [("use_premium", "bool", "Use premium account if available", True)] -- cgit v1.2.3 From dd6fa1acf4bda63b909aa0377163349113167ce7 Mon Sep 17 00:00:00 2001 From: EvolutionClip Date: Thu, 11 Jun 2015 22:16:16 +0200 Subject: Improved Login Check --- module/plugins/hoster/HighWayMe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index e7b3fd739..a80ad6a0e 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -9,7 +9,7 @@ +class HighWayMe(MultiHoster): + __name__ = "HighWayMe" + __type__ = "hoster" -+ __version__ = "0.08" ++ __version__ = "0.09" + + __pattern__ = r'https?://.+high-way\.my' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -24,7 +24,7 @@ + + + def checkErrors(self): -+ if '0' in self.html: #This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. ++ if self.html.get('code') == 302: #This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. + self.account.relogin(self.user) + self.retry() + -- cgit v1.2.3 From dd609f533d2524d37aec5b71d741a6bdb3b95f81 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 24 Jun 2015 00:32:03 +0300 Subject: Update HighWayMe.py --- module/plugins/hoster/HighWayMe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index 9c79f8dc4..9f39c21e8 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import secondsToMidnight class HighWayMe(MultiHoster): __name__ = "HighWayMe" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'https?://.+high-way\.my' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -24,7 +24,7 @@ class HighWayMe(MultiHoster): def checkErrors(self): - if self.html.get('code') == 302:: #@NOTE: This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. + if self.html.get('code') == 302: #@NOTE: This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. self.account.relogin(self.user) self.retry() -- cgit v1.2.3 From d99d6eddb6af637580bb6fc72013f913077525d6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 11:23:08 +0200 Subject: Spare fixes --- module/plugins/hoster/HighWayMe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index 9f39c21e8..dc7a9fc12 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -24,7 +24,7 @@ class HighWayMe(MultiHoster): def checkErrors(self): - if self.html.get('code') == 302: #@NOTE: This is not working. It should by if 302 Moved Temporarily then ... But I don't now how to implement it. + if self.html.get('code') == 302: #@NOTE: This is not working. It should by if 302 Moved Temporarily then... But I don't now how to implement it. self.account.relogin(self.user) self.retry() -- cgit v1.2.3 From e4fb45b22d36595839e8f638a3f0a4669dba3e8d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 21 Jun 2015 08:50:26 +0200 Subject: Spare code cosmetics (4) --- module/plugins/hoster/HighWayMe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index dc7a9fc12..a33a1137b 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -12,7 +12,8 @@ class HighWayMe(MultiHoster): __version__ = "0.12" __pattern__ = r'https?://.+high-way\.my' - __config__ = [("use_premium", "bool", "Use premium account if available", True)] + __config__ = [("use_premium" , "bool", "Use premium account if available" , True), + ("revertfailed", "bool", "Revert to standard download if fails", True)] __description__ = """High-Way.me multi-hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hoster/HighWayMe.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index a33a1137b..e51970c71 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -3,13 +3,13 @@ import re from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -from module.plugins.internal.SimpleHoster import secondsToMidnight +from module.plugins.internal.SimpleHoster import seconds_to_midnight class HighWayMe(MultiHoster): __name__ = "HighWayMe" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'https?://.+high-way\.my' __config__ = [("use_premium" , "bool", "Use premium account if available" , True), @@ -21,10 +21,10 @@ class HighWayMe(MultiHoster): def setup(self): - self.chunkLimit = 4 + self.chunk_limit = 4 - def checkErrors(self): + def check_errors(self): if self.html.get('code') == 302: #@NOTE: This is not working. It should by if 302 Moved Temporarily then... But I don't now how to implement it. self.account.relogin(self.user) self.retry() @@ -33,31 +33,31 @@ class HighWayMe(MultiHoster): self.offline() elif "downloadlimit" in self.html: - self.logWarning(_("Reached maximum connctions")) + self.log_warning(_("Reached maximum connctions")) self.retry(5, 60, _("Reached maximum connctions")) elif "trafficlimit" in self.html: - self.logWarning(_("Reached daily limit")) - self.retry(wait_time=secondsToMidnight(gmt=2), reason="Daily limit for this host reached") + self.log_warning(_("Reached daily limit")) + self.retry(wait_time=seconds_to_midnight(gmt=2), reason="Daily limit for this host reached") elif "8" in self.html: - self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) + self.log_warning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) self.retry(5, 60, _("Hoster is temporarily unavailable")) - def handlePremium(self, pyfile): + def handle_premium(self, pyfile): for _i in xrange(5): self.html = self.load("https://high-way.me/load.php", get={'link': self.pyfile.url}) if self.html: - self.logDebug("JSON data: " + self.html) + self.log_debug("JSON data: " + self.html) break else: - self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) + self.log_info(_("Unable to get API data, waiting 1 minute and retry")) self.retry(5, 60, _("Unable to get API data")) - self.checkErrors() + self.check_errors() try: self.pyfile.name = re.search(r'([^<]+)', self.html).group(1) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hoster/HighWayMe.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index e51970c71..991bc0134 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -10,6 +10,7 @@ class HighWayMe(MultiHoster): __name__ = "HighWayMe" __type__ = "hoster" __version__ = "0.13" + __status__ = "stable" __pattern__ = r'https?://.+high-way\.my' __config__ = [("use_premium" , "bool", "Use premium account if available" , True), -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hoster/HighWayMe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/HighWayMe.py') diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index 991bc0134..119ddb70e 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -10,7 +10,7 @@ class HighWayMe(MultiHoster): __name__ = "HighWayMe" __type__ = "hoster" __version__ = "0.13" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'https?://.+high-way\.my' __config__ = [("use_premium" , "bool", "Use premium account if available" , True), -- cgit v1.2.3