summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-08-25 21:31:50 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-08-25 21:31:50 +0200
commit9dda14ce2aab0541c52d830ffdf0851b8cf40497 (patch)
treea20b39190dae50e826996d411bec87ba84190b23
parentDepositfiles: fixed file size detect (diff)
downloadpyload-9dda14ce2aab0541c52d830ffdf0851b8cf40497.tar.xz
UnrestrictLi: fix for #238
-rw-r--r--module/plugins/hoster/UnrestrictLi.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py
index 358e493b1..bdafca63d 100644
--- a/module/plugins/hoster/UnrestrictLi.py
+++ b/module/plugins/hoster/UnrestrictLi.py
@@ -35,7 +35,7 @@ def secondsToMidnight():
class UnrestrictLi(Hoster):
__name__ = "UnrestrictLi"
- __version__ = "0.09"
+ __version__ = "0.10"
__type__ = "hoster"
__pattern__ = r"https?://.*(unrestrict|unr)\.li"
__description__ = """Unrestrict.li hoster plugin"""
@@ -61,16 +61,24 @@ class UnrestrictLi(Hoster):
self.logDebug("JSON data: " + page)
if page != '':
break
- if "File offline" in page:
+ else:
+ self.logInfo("Unable to get API data, waiting 1 minute and retry")
+ self.retry(5, 60, "Unable to get API data")
+
+ if 'Expired session' in page or ("You are not allowed to "
+ "download from this host" in page and self.premium):
+ self.account.relogin(self.user)
+ self.retry()
+ elif "File offline" in page:
self.offline()
- elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page:
- self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry")
- self.retry(5, 60, "Hoster is temporarily unavailable")
elif "You are not allowed to download from this host" in page:
self.fail("You are not allowed to download from this host")
elif "You have reached your daily limit for this host" in page:
self.logInfo("Reached daily limit for this host. Waiting until 00:10 GMT+2")
self.retry(5, secondsToMidnight(), "Daily limit for this host reached")
+ elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page:
+ self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry")
+ self.retry(5, 60, "Hoster is temporarily unavailable")
page = json_loads(page)
new_url = page.keys()[0]
self.api_data = page[new_url]