summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/UnrestrictLi.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/hoster/UnrestrictLi.py')
-rw-r--r--pyload/plugins/hoster/UnrestrictLi.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/pyload/plugins/hoster/UnrestrictLi.py b/pyload/plugins/hoster/UnrestrictLi.py
index 18d363788..e807cda98 100644
--- a/pyload/plugins/hoster/UnrestrictLi.py
+++ b/pyload/plugins/hoster/UnrestrictLi.py
@@ -19,36 +19,38 @@ def secondsToMidnight(gmt=0):
class UnrestrictLi(Hoster):
- __name__ = "UnrestrictLi"
- __type__ = "hoster"
+ __name__ = "UnrestrictLi"
+ __type__ = "hoster"
__version__ = "0.12"
__pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li'
__description__ = """Unrestrict.li hoster plugin"""
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
+ __license__ = "GPLv3"
+ __authors__ = [("stickell", "l.stickell@yahoo.it")]
def setup(self):
self.chunkLimit = 16
self.resumeDownload = True
+
def process(self, pyfile):
if re.match(self.__pattern__, pyfile.url):
new_url = pyfile.url
elif not self.account:
self.logError(_("Please enter your %s account or deactivate this plugin") % "Unrestrict.li")
- self.fail("No Unrestrict.li account provided")
+ self.fail(_("No Unrestrict.li account provided"))
else:
self.logDebug("Old URL: %s" % pyfile.url)
- for _ in xrange(5):
- page = self.req.load('https://unrestrict.li/unrestrict.php',
- post={'link': pyfile.url, 'domain': 'long'})
+ for _i in xrange(5):
+ page = self.load('https://unrestrict.li/unrestrict.php',
+ post={'link': pyfile.url, 'domain': 'long'})
self.logDebug("JSON data: " + page)
if page != '':
break
else:
- self.logInfo("Unable to get API data, waiting 1 minute and retry")
+ 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 "
@@ -58,12 +60,12 @@ class UnrestrictLi(Hoster):
elif "File offline" in page:
self.offline()
elif "You are not allowed to download from this host" in page:
- self.fail("You are not allowed to download from this host")
+ self.fail(_("You are not allowed to download from this host"))
elif "You have reached your daily limit for this host" in page:
- self.logWarning("Reached daily limit for this host")
+ self.logWarning(_("Reached daily limit for this host"))
self.retry(5, secondsToMidnight(gmt=2), "Daily limit for this host reached")
elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page:
- self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry")
+ 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]
@@ -79,7 +81,8 @@ class UnrestrictLi(Hoster):
if self.getConfig("history"):
self.load("https://unrestrict.li/history/&delete=all")
- self.logInfo("Download history deleted")
+ self.logInfo(_("Download history deleted"))
+
def setNameSize(self):
if 'name' in self.api_data: