From 3e9ac24baa2131f77c5f3756ee1defc0178a4e5c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 8 Jun 2011 23:25:48 +0200 Subject: retries for real debrid --- module/common/JsEngine.py | 2 +- module/plugins/hoster/RealdebridCom.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/module/common/JsEngine.py b/module/common/JsEngine.py index 0b451c9dd..5612b12a3 100644 --- a/module/common/JsEngine.py +++ b/module/common/JsEngine.py @@ -49,7 +49,7 @@ if not ENGINE: pass -if not ENGINE or ENGINE: +if not ENGINE: try: path = "" #path where to find rhino diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 47bd5e4db..d003b4e2b 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -4,6 +4,7 @@ import re from urllib import quote, unquote from random import randrange +from time import sleep from module.plugins.Hoster import Hoster @@ -26,6 +27,9 @@ class RealdebridCom(Hoster): name += "%s.tmp" % randrange(100,999) return name + def init(self): + self.tries = 0 + def setup(self): self.chunkLimit = 3 self.resumeDownload = True @@ -76,5 +80,11 @@ class RealdebridCom(Hoster): {"error": "An error occured while processing your request"}) if check == "error": - self.fail("Error occured.") + #usual this download can safely be retried + if self.tries < 3: + self.tries += 1 + sleep(1) + self.retry() + else: + self.fail("Error occured.") -- cgit v1.2.3