summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/SimplyPremiumCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-06 18:57:55 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-06 18:57:55 +0200
commit0072668fd976f9ce4dbaac7e807791f21cbe07ed (patch)
tree473ef27784ac8f7f2001bdca159852cf3be74ec2 /module/plugins/hoster/SimplyPremiumCom.py
parent[UpdateManager] Little code cleanup + improved threading (diff)
downloadpyload-0072668fd976f9ce4dbaac7e807791f21cbe07ed.tar.xz
Compute wait time using secondsToMidnight
Diffstat (limited to 'module/plugins/hoster/SimplyPremiumCom.py')
-rw-r--r--module/plugins/hoster/SimplyPremiumCom.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py
index 17060e00d..dcd97d1e3 100644
--- a/module/plugins/hoster/SimplyPremiumCom.py
+++ b/module/plugins/hoster/SimplyPremiumCom.py
@@ -19,22 +19,12 @@ import re
from datetime import datetime, timedelta
from module.plugins.Hoster import Hoster
-
-
-def secondsToMidnight():
- # Seconds until 00:10 GMT+2
- now = datetime.utcnow() + timedelta(hours=2)
- 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())
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
class SimplyPremiumCom(Hoster):
__name__ = "SimplyPremiumCom"
- __version__ = "0.02"
+ __version__ = "0.03"
__type__ = "hoster"
__pattern__ = r"https?://.*(simply-premium)\.com"
__description__ = """Simply-Premium.Com hoster plugin"""
@@ -69,13 +59,13 @@ class SimplyPremiumCom(Hoster):
elif "NOTFOUND" in page:
self.offline()
elif "downloadlimit" in page:
- self.logInfo("Reached maximum connctions")
+ self.logWarning("Reached maximum connctions")
self.retry(5, 60, "Reached maximum connctions")
elif "trafficlimit" in page:
- self.logInfo("Reached daily limit for this host. Waiting until 00:10 GMT+2")
- self.retry(5, secondsToMidnight(), "Daily limit for this host reached")
+ self.logWarning("Reached daily limit for this host")
+ self.retry(1, secondsToMidnight(gmt=2), "Daily limit for this host reached")
elif "hostererror" in page:
- self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry")
+ 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]