From 4cb354ca13eab18d8b43da5a9aa4636ce2e05b81 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sun, 25 Aug 2013 21:31:50 +0200 Subject: UnrestrictLi: fix for #238 (cherry picked from commit 9dda14ce2aab0541c52d830ffdf0851b8cf40497) --- pyload/plugins/hoster/UnrestrictLi.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'pyload/plugins') diff --git a/pyload/plugins/hoster/UnrestrictLi.py b/pyload/plugins/hoster/UnrestrictLi.py index ec7bfe591..0e64a4697 100644 --- a/pyload/plugins/hoster/UnrestrictLi.py +++ b/pyload/plugins/hoster/UnrestrictLi.py @@ -35,7 +35,7 @@ def secondsToMidnight(): class UnrestrictLi(Hoster): __name__ = "UnrestrictLi" - __version__ = "0.09" + __version__ = "0.10" __type__ = "hoster" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), @@ -67,16 +67,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] -- cgit v1.2.3