summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/internal/SimpleHoster.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-06 00:31:46 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-06 00:31:46 +0200
commit8d60ae2be14be54d4f4d4775fe696a82f84a000c (patch)
tree57e3da3c2ac9e18d04366c833259cee39635dc7b /pyload/plugin/internal/SimpleHoster.py
parentAuto choose webserver (diff)
parent[SimpleHoster] Fallback option (diff)
downloadpyload-8d60ae2be14be54d4f4d4775fe696a82f84a000c.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: pyload/plugin/addon/AntiVirus.py pyload/plugin/addon/ExtractArchive.py pyload/plugin/hoster/GoogledriveCom.py pyload/plugin/hoster/OneFichierCom.py pyload/plugin/hoster/UlozTo.py pyload/plugin/hoster/YadiSk.py pyload/plugin/hoster/ZippyshareCom.py pyload/plugin/internal/SimpleHoster.py pyload/plugin/internal/XFSCrypter.py pyload/plugin/internal/XFSHoster.py
Diffstat (limited to 'pyload/plugin/internal/SimpleHoster.py')
-rw-r--r--pyload/plugin/internal/SimpleHoster.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/pyload/plugin/internal/SimpleHoster.py b/pyload/plugin/internal/SimpleHoster.py
index a87986330..d3e2edc48 100644
--- a/pyload/plugin/internal/SimpleHoster.py
+++ b/pyload/plugin/internal/SimpleHoster.py
@@ -244,10 +244,11 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name = "SimpleHoster"
__type = "hoster"
- __version = "1.40"
+ __version = "1.42"
__pattern = r'^unmatchable$'
- __config = [("use_premium", "bool", "Use premium account if available", True)]
+ __config = [("use_premium", "bool", "Use premium account if available" , True),
+ ("fallback" , "bool", "Fallback to free download if premium fails", True)]
__description = """Simple hoster plugin"""
__license = "GPLv3"
@@ -487,8 +488,8 @@ class SimpleHoster(Hoster):
self.checkFile()
except Fail, e: #@TODO: Move to PluginThread in 0.4.10
- if self.premium:
- self.logWarning(_("Premium download failed"))
+ if self.getConfig('fallback', True) and self.premium:
+ self.logWarning(_("Premium download failed"), e)
self.retryFree()
else:
raise Fail(e)
@@ -745,7 +746,7 @@ class SimpleHoster(Hoster):
self.premium = False
self.account = None
self.req = self.core.requestFactory.getRequest(self.getClassName())
- self.retries = 0
+ self.retries = -1
raise Retry(_("Fallback to free download"))