summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/PremiumTo.py (renamed from module/plugins/hoster/Premium4Me.py)20
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/hoster/Premium4Me.py b/module/plugins/hoster/PremiumTo.py
index ea841338a..3ab7e34ac 100644
--- a/module/plugins/hoster/Premium4Me.py
+++ b/module/plugins/hoster/PremiumTo.py
@@ -8,18 +8,15 @@ from module.plugins.Hoster import Hoster
from module.utils import fs_encode
-class Premium4Me(Hoster):
- __name__ = "Premium4Me"
+class PremiumTo(Hoster):
+ __name__ = "PremiumTo"
__type__ = "hoster"
- __version__ = "0.08"
-
- __pattern__ = r'http://(?:www\.)?premium.to/.*'
-
+ __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
@@ -29,7 +26,7 @@ class Premium4Me(Hoster):
self.logError(_("Please enter your %s account or deactivate this plugin") % "premium.to")
self.fail("No premium.to account provided")
- self.logDebug("premium.to: Old URL: %s" % pyfile.url)
+ self.logDebug("Old URL: %s" % pyfile.url)
tra = self.getTraffic()
@@ -37,7 +34,8 @@ class Premium4Me(Hoster):
self.req.setOption("timeout", 120)
self.download(
- "http://premium.to/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")),
+ "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"})
@@ -66,7 +64,9 @@ class Premium4Me(Hoster):
def getTraffic(self):
try:
- traffic = int(self.load("http://premium.to/api/traffic.php?authcode=%s" % self.account.authcode))
+ 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