summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-26 17:58:54 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-26 17:58:54 +0100
commitff42cec46274b0f2019272424c1a57ec4b413507 (patch)
treefe2ead3503f68aebb0dea5ef739fb22417d0cc68 /module/plugins
parent[SimpleHoster] getInfo handle direct link error (diff)
downloadpyload-ff42cec46274b0f2019272424c1a57ec4b413507.tar.xz
[PremiumTo] Fixup
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/PremiumTo.py2
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py2
-rw-r--r--module/plugins/hoster/PremiumTo.py17
-rw-r--r--module/plugins/internal/MultiHook.py1
4 files changed, 4 insertions, 18 deletions
diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py
index efc64706b..ef3d0cc19 100644
--- a/module/plugins/accounts/PremiumTo.py
+++ b/module/plugins/accounts/PremiumTo.py
@@ -19,7 +19,7 @@ class PremiumTo(Account):
api_r = req.load("http://premium.to/api/straffic.php",
get={'username': self.username, 'password': self.password})
- trafficleft = float(sum(map(int, api_r.split(';')))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ trafficleft = sum(map(float, api_r.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1}
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index c08d6f963..fea278559 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -49,7 +49,7 @@ class ShareonlineBiz(Account):
validuntil = float(api['expire_date'])
if 'traffic_1d' in api:
- traffic = int(api['traffic_1d'].split(";")[0])
+ traffic = float(api['traffic_1d'].split(";")[0])
maxtraffic = max(maxtraffic, traffic)
trafficleft = maxtraffic - traffic
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)
diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py
index caac6c258..78de1ed0a 100644
--- a/module/plugins/internal/MultiHook.py
+++ b/module/plugins/internal/MultiHook.py
@@ -47,6 +47,7 @@ class MultiHook(Hook):
"""getConfig with default value - sublass may not implements all config options"""
try:
return self.getConf(option)
+
except KeyError:
return default