summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/SimplyPremiumCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/SimplyPremiumCom.py')
-rw-r--r--module/plugins/hoster/SimplyPremiumCom.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py
index b3f52bc8c..be1578bfb 100644
--- a/module/plugins/hoster/SimplyPremiumCom.py
+++ b/module/plugins/hoster/SimplyPremiumCom.py
@@ -3,16 +3,18 @@
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 SimplyPremiumCom(MultiHoster):
__name__ = "SimplyPremiumCom"
__type__ = "hoster"
- __version__ = "0.08"
+ __version__ = "0.10"
+ __status__ = "testing"
__pattern__ = r'https?://.+simply-premium\.com'
- __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__ = """Simply-Premium.com multi-hoster plugin"""
__license__ = "GPLv3"
@@ -20,10 +22,10 @@ class SimplyPremiumCom(MultiHoster):
def setup(self):
- self.chunkLimit = 16
+ self.chunk_limit = 16
- def checkErrors(self):
+ def check_errors(self):
if '<valid>0</valid>' in self.html or (
"You are not allowed to download from this host" in self.html and self.premium):
self.account.relogin(self.user)
@@ -33,30 +35,30 @@ class SimplyPremiumCom(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 for this host"))
- self.retry(wait_time=secondsToMidnight(gmt=2), reason="Daily limit for this host reached")
+ self.log_warning(_("Reached daily limit for this host"))
+ self.retry(wait_time=seconds_to_midnight(gmt=2), reason="Daily limit for this host reached")
elif "hostererror" 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("http://www.simply-premium.com/premium.php", get={'info': "", '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'<name>([^<]+)</name>', self.html).group(1)