summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/Base.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-04 04:29:58 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-04 04:29:58 +0200
commit1c7d9e55ffbfc9204c9e9246d9cc64806fa38326 (patch)
tree49fff3f3b5b2c036c99c1422b9d0153a6c80f0cd /module/plugins/internal/Base.py
parentFix https://github.com/pyload/pyload/issues/1911#issuecomment-145026557 (diff)
downloadpyload-1c7d9e55ffbfc9204c9e9246d9cc64806fa38326.tar.xz
Fixpack (2)
Diffstat (limited to 'module/plugins/internal/Base.py')
-rw-r--r--module/plugins/internal/Base.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/module/plugins/internal/Base.py b/module/plugins/internal/Base.py
index bc9ef9158..28bc47556 100644
--- a/module/plugins/internal/Base.py
+++ b/module/plugins/internal/Base.py
@@ -52,7 +52,7 @@ def check_abort(fn):
class Base(Plugin):
__name__ = "Base"
__type__ = "base"
- __version__ = "0.02"
+ __version__ = "0.03"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -270,6 +270,8 @@ class Base(Plugin):
if self.thread.m.reconnecting.isSet():
self.waiting = False
self.wantReconnect = False
+
+ self.req.clearCookies()
raise Reconnect
time.sleep(2)
@@ -334,6 +336,21 @@ class Base(Plugin):
self.fail("temp. offline")
+ def restart(self, msg="", premium=True):
+ if not msg:
+ msg = _("Restart plugin") if premium else _("Fallback to free processing")
+
+ if not premium:
+ if self.premium:
+ self.rst_free = True
+ else:
+ self.fail("%s | %s" % (msg, _("Url was already processed as free")))
+
+ self.req.clearCookies()
+
+ raise Retry(encode(msg)) #@TODO: Remove `encode` in 0.4.10
+
+
def retry(self, attemps=5, wait=1, msg=""):
"""
Retries and begin again from the beginning