summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-06 00:14:25 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-06 00:14:25 +0200
commit5c153e02a6eaebb721c85202b54401fa2c1f08fc (patch)
tree862970bafae2c42a3dcc4214469cc449d5778dcf
parent[XFSHoster] Fix WAIT_PATTERN (diff)
downloadpyload-5c153e02a6eaebb721c85202b54401fa2c1f08fc.tar.xz
[SimpleHoster] Fallback option
-rw-r--r--module/plugins/hoster/YadiSk.py2
-rw-r--r--module/plugins/internal/SimpleHoster.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py
index 54050fb9b..3b4c9d985 100644
--- a/module/plugins/hoster/YadiSk.py
+++ b/module/plugins/hoster/YadiSk.py
@@ -12,7 +12,7 @@ class YadiSk(SimpleHoster):
__type__ = "hoster"
__version__ = "0.05"
- __pattern__ = r'https?://yadi\.sk/d/.+'
+ __pattern__ = r'https?://yadi\.sk/d/[\w-]+'
__description__ = """Yadi.sk hoster plugin"""
__license__ = "GPLv3"
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index f77a31ae2..0039d3f8e 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -244,10 +244,11 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "1.41"
+ __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"
@@ -488,7 +489,7 @@ class SimpleHoster(Hoster):
self.checkFile()
except Fail, e: #@TODO: Move to PluginThread in 0.4.10
- if self.premium:
+ if self.getConfig('fallback', True) and self.premium:
self.logWarning(_("Premium download failed"), e)
self.retryFree()
else:
@@ -748,7 +749,7 @@ class SimpleHoster(Hoster):
self.premium = False
self.account = None
self.req = self.core.requestFactory.getRequest(self.__name__)
- self.retries = 0
+ self.retries = -1
raise Retry(_("Fallback to free download"))