From a64c0d41a27da58dc004f97bc934c8b3018a1de9 Mon Sep 17 00:00:00 2001 From: stickell Date: Fri, 12 Sep 2014 17:54:39 +0200 Subject: [Premium4Me] Renamed to PremiumTo + partial rewrite + special traffic support --- module/plugins/hoster/PremiumTo.py | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 module/plugins/hoster/PremiumTo.py (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py new file mode 100644 index 000000000..3ab7e34ac --- /dev/null +++ b/module/plugins/hoster/PremiumTo.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +from os import remove +from os.path import exists +from urllib import quote + +from module.plugins.Hoster import Hoster +from module.utils import fs_encode + + +class PremiumTo(Hoster): + __name__ = "PremiumTo" + __type__ = "hoster" + __version__ = "0.09" + __pattern__ = r'https?://(?:www\.)?premium.to/.*' + __description__ = """Premium.to hoster plugin""" + __author_name__ = ("RaNaN", "zoidberg", "stickell") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + + def setup(self): + self.resumeDownload = True + 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) + + tra = self.getTraffic() + + #raise timeout to 2min + self.req.setOption("timeout", 120) + + self.download( + "http://premium.to/api/getfile.php", + get={"username": self.account.username, "password": self.account.password, "link": quote(pyfile.url, "")}, + disposition=True) + + check = self.checkDownload({"nopremium": "No premium account available"}) + + if check == "nopremium": + self.retry(60, 5 * 60, "No premium account available") + + err = '' + if self.req.http.code == '420': + # Custom error code send - fail + lastDownload = fs_encode(self.lastDownload) + + if exists(lastDownload): + f = open(lastDownload, "rb") + err = f.read(256).strip() + f.close() + remove(lastDownload) + else: + err = 'File does not exist' + + trb = self.getTraffic() + self.logInfo("Filesize: %d, Traffic used %d, traffic left %d" % (pyfile.size, tra - trb, trb)) + + if err: + self.fail(err) + + def getTraffic(self): + try: + api_r = self.load("http://premium.to/api/straffic.php", + get={'username': self.account.username, 'password': self.account.password}) + traffic = sum(map(int, api_r.split(';'))) + except: + traffic = 0 + return traffic -- cgit v1.2.3 From 7257e2ec613a1dc8dee249d68b81a0b61e2d281c Mon Sep 17 00:00:00 2001 From: stickell Date: Wed, 17 Sep 2014 18:26:23 +0200 Subject: [PremiumTo] fixed issue with get parameter on download --- module/plugins/hoster/PremiumTo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 3ab7e34ac..92bec9295 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -11,7 +11,7 @@ from module.utils import fs_encode class PremiumTo(Hoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?premium.to/.*' __description__ = """Premium.to hoster plugin""" __author_name__ = ("RaNaN", "zoidberg", "stickell") @@ -34,8 +34,7 @@ class PremiumTo(Hoster): self.req.setOption("timeout", 120) self.download( - "http://premium.to/api/getfile.php", - get={"username": self.account.username, "password": self.account.password, "link": quote(pyfile.url, "")}, + "http://premium.to/api/getfile.php?username=%s&password=%s&link=%s" % (self.account.username, self.account.password, quote(pyfile.url, "")), disposition=True) check = self.checkDownload({"nopremium": "No premium account available"}) -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/PremiumTo.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 92bec9295..fd75e51e3 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -12,10 +12,14 @@ class PremiumTo(Hoster): __name__ = "PremiumTo" __type__ = "hoster" __version__ = "0.10" + __pattern__ = r'https?://(?:www\.)?premium.to/.*' + __description__ = """Premium.to hoster plugin""" - __author_name__ = ("RaNaN", "zoidberg", "stickell") - __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] + def setup(self): self.resumeDownload = True -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/PremiumTo.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index fd75e51e3..e78fdfd4f 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -16,6 +16,7 @@ class PremiumTo(Hoster): __pattern__ = r'https?://(?:www\.)?premium.to/.*' __description__ = """Premium.to hoster plugin""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("zoidberg", "zoidberg@mujmail.cz"), ("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/hoster/PremiumTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index e78fdfd4f..ed96f315b 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -13,7 +13,7 @@ class PremiumTo(Hoster): __type__ = "hoster" __version__ = "0.10" - __pattern__ = r'https?://(?:www\.)?premium.to/.*' + __pattern__ = r'https?://(?:www\.)?premium\.to/.*' __description__ = """Premium.to hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/PremiumTo.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index ed96f315b..8595304c4 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -26,6 +26,7 @@ class PremiumTo(Hoster): self.resumeDownload = True self.chunkLimit = 1 + def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "premium.to") @@ -66,6 +67,7 @@ class PremiumTo(Hoster): if err: self.fail(err) + def getTraffic(self): try: api_r = self.load("http://premium.to/api/straffic.php", -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/PremiumTo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 8595304c4..e3f9b9dc2 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -30,7 +30,7 @@ class PremiumTo(Hoster): 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.fail(_("No premium.to account provided")) self.logDebug("Old URL: %s" % pyfile.url) @@ -59,10 +59,10 @@ class PremiumTo(Hoster): f.close() remove(lastDownload) else: - err = 'File does not exist' + 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") % (pyfile.size, tra - trb, trb)) if err: self.fail(err) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/PremiumTo.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index e3f9b9dc2..183182689 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -9,17 +9,17 @@ from module.utils import fs_encode class PremiumTo(Hoster): - __name__ = "PremiumTo" - __type__ = "hoster" + __name__ = "PremiumTo" + __type__ = "hoster" __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' __description__ = """Premium.to hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] def setup(self): -- cgit v1.2.3 From bd8259220ab4d56ab419b7b32045b08cc9b0a7c8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 9 Nov 2014 03:08:19 +0100 Subject: Use with statement instead open method when accessing fod + handle i/o error --- module/plugins/hoster/PremiumTo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 183182689..beab4391e 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -54,9 +54,8 @@ class PremiumTo(Hoster): lastDownload = fs_encode(self.lastDownload) if exists(lastDownload): - f = open(lastDownload, "rb") - err = f.read(256).strip() - f.close() + with open(lastDownload, "rb") as f: + err = f.read(256).strip() remove(lastDownload) else: err = _('File does not exist') -- cgit v1.2.3 From 52664e6fe8dd99fc9bb78ea8cf158c17705b6ded Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 5 Dec 2014 19:18:11 +0100 Subject: Fix with statement on old env like python 2.5 (2) --- module/plugins/hoster/PremiumTo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index beab4391e..b4fe327db 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + from os import remove from os.path import exists from urllib import quote @@ -11,7 +13,7 @@ from module.utils import fs_encode class PremiumTo(Hoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hoster/PremiumTo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index b4fe327db..9f8037d41 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -41,9 +41,11 @@ class PremiumTo(Hoster): #raise timeout to 2min self.req.setOption("timeout", 120) - self.download( - "http://premium.to/api/getfile.php?username=%s&password=%s&link=%s" % (self.account.username, self.account.password, quote(pyfile.url, "")), - disposition=True) + self.download("http://premium.to/api/getfile.php", + get={'username': self.account.username, + 'password': self.account.password, + 'link' : quote(pyfile.url, "")}, + disposition=True) check = self.checkDownload({"nopremium": "No premium account available"}) -- cgit v1.2.3 From 57300575fa97107d172e0c9909b244c8c8ae6c12 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 20:02:20 +0100 Subject: Extend SimpleHoster in multi-hoster plugins --- module/plugins/hoster/PremiumTo.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') 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) -- cgit v1.2.3 From 46f748a94ea5ab62ab0839ff0ce01e12e3eac688 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 21:47:39 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (2) --- module/plugins/hoster/PremiumTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/PremiumTo.py') 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/.*' -- 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/PremiumTo.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/plugins/hoster/PremiumTo.py') 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 -- 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/PremiumTo.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 6c94b3fa9..cb880d6c1 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.12" + __version__ = "0.13" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' @@ -47,6 +47,8 @@ class PremiumTo(SimpleHoster): def checkFile(self): + super(PremiumTo, self).checkFile() + check = self.checkDownload({"nopremium": "No premium account available"}) if check == "nopremium": @@ -56,13 +58,9 @@ class PremiumTo(SimpleHoster): if self.req.http.code == '420': # Custom error code send - fail lastDownload = fs_encode(self.lastDownload) - - if exists(lastDownload): - with open(lastDownload, "rb") as f: - err = f.read(256).strip() - remove(lastDownload) - else: - err = _('File does not exist') + with open(lastDownload, "rb") as f: + err = f.read(256).strip() + remove(lastDownload) trb = self.getTraffic() self.logInfo(_("Filesize: %d, Traffic used %d, traffic left %d") % (self.pyfile.size, tra - trb, trb)) -- cgit v1.2.3 From 87203e996fb42c172b15e29f0e394d5b328d9ac2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 23 Dec 2014 13:20:53 +0100 Subject: New plugin: MultiHoster --- module/plugins/hoster/PremiumTo.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index cb880d6c1..d593cec3e 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -6,14 +6,14 @@ from os import remove from os.path import exists from urllib import quote -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo from module.utils import fs_encode -class PremiumTo(SimpleHoster): +class PremiumTo(MultiHoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' @@ -24,9 +24,6 @@ class PremiumTo(SimpleHoster): ("stickell", "l.stickell@yahoo.it")] - MULTI_HOSTER = True - - def setup(self): self.resumeDownload = True self.chunkLimit = 1 -- cgit v1.2.3 From a4786e340993bbfc5d2bf971c9bec18863d3dd80 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 23 Dec 2014 19:29:15 +0100 Subject: [MultiHoster] Update --- module/plugins/hoster/PremiumTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index d593cec3e..b6194ef73 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(MultiHoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' @@ -29,7 +29,7 @@ class PremiumTo(MultiHoster): self.chunkLimit = 1 - def handleMulti(self): + def handlePremium(self): tra = self.getTraffic() #raise timeout to 2min -- cgit v1.2.3 From ff42cec46274b0f2019272424c1a57ec4b413507 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Dec 2014 17:58:54 +0100 Subject: [PremiumTo] Fixup --- module/plugins/hoster/PremiumTo.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index b6194ef73..fd5853f45 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(MultiHoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' @@ -30,8 +30,6 @@ class PremiumTo(MultiHoster): def handlePremium(self): - tra = self.getTraffic() - #raise timeout to 2min self.req.setOption("timeout", 120) @@ -59,21 +57,8 @@ class PremiumTo(MultiHoster): err = f.read(256).strip() remove(lastDownload) - trb = self.getTraffic() - self.logInfo(_("Filesize: %d, Traffic used %d, traffic left %d") % (self.pyfile.size, tra - trb, trb)) - if err: self.fail(err) - def getTraffic(self): - try: - api_r = self.load("http://premium.to/api/straffic.php", - get={'username': self.account.username, 'password': self.account.password}) - traffic = sum(map(int, api_r.split(';'))) - except: - traffic = 0 - return traffic - - getInfo = create_getInfo(PremiumTo) -- cgit v1.2.3 From cdb06469a640c1875229903a2dbdfa8be469b5bc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:52:30 +0100 Subject: Improve a lot of plugin __pattern__ --- module/plugins/hoster/PremiumTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/PremiumTo.py') diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index fd5853f45..fa4caad5a 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -15,7 +15,7 @@ class PremiumTo(MultiHoster): __type__ = "hoster" __version__ = "0.16" - __pattern__ = r'https?://(?:www\.)?premium\.to/.*' + __pattern__ = r'https?://(?:www\.)?premium\.to/.+' __description__ = """Premium.to hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3