diff options
Diffstat (limited to 'module/plugins/hoster')
105 files changed, 343 insertions, 347 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 1b65237a0..c5dd9b707 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -42,7 +42,7 @@ class AlldebridCom(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "AllDebrid") - self.fail("No AllDebrid account provided") + self.fail(_("No AllDebrid account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) password = self.getPassword().splitlines() @@ -84,6 +84,6 @@ class AlldebridCom(Hoster): 'empty': re.compile(r"^$")}) if check == "error": - self.retry(wait_time=60, reason="An error occured while generating link.") + self.retry(wait_time=60, reason="An error occured while generating link") elif check == "empty": - self.retry(wait_time=60, reason="Downloaded File was empty.") + self.retry(wait_time=60, reason="Downloaded File was empty") diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 573134cb9..af8718817 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -74,7 +74,7 @@ class BasePlugin(Hoster): raise else: - self.fail("No Plugin matched and not a downloadable url.") + self.fail(_("No Plugin matched and not a downloadable url")) def downloadFile(self, pyfile): diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index 69aab78ef..48758ed88 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -39,7 +39,7 @@ class BayfilesCom(SimpleHoster): # Get download token m = re.search(self.VARS_PATTERN, self.html) if m is None: - self.error("VARS") + self.error(_("VARS_PATTERN not found")) vfid, delay = m.groups() response = json_loads(self.load('http://bayfiles.com/ajax_download', get={ @@ -48,7 +48,7 @@ class BayfilesCom(SimpleHoster): "vfid": vfid}, decode=True)) if not "token" in response or not response['token']: - self.fail("No token") + self.fail(_("No token")) self.wait(int(delay)) @@ -60,14 +60,14 @@ class BayfilesCom(SimpleHoster): # Get final link and download m = re.search(self.FREE_LINK_PATTERN, self.html) if m is None: - self.error("Free link") + self.error(_("Free link")) self.startDownload(m.group(1)) def handlePremium(self): m = re.search(self.PREMIUM_LINK_PATTERN, self.html) if m is None: - self.error("Premium link") + self.error(_("Premium link")) self.startDownload(m.group(1)) diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index aa5e1faee..2b1959674 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -30,7 +30,7 @@ class BezvadataCz(SimpleHoster): #download button m = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html) if m is None: - self.error("Page 1 URL") + self.error(_("Page 1 URL not found")) url = "http://bezvadata.cz%s" % m.group(1) #captcha form @@ -39,11 +39,11 @@ class BezvadataCz(SimpleHoster): for _i in xrange(5): action, inputs = self.parseHtmlForm('frm-stahnoutFreeForm') if not inputs: - self.error("FreeForm") + self.error(_("FreeForm")) m = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html) if m is None: - self.error("Wrong captcha image") + self.error(_("Wrong captcha image")) #captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url self.load, proper_load = self.loadcaptcha, self.load @@ -58,14 +58,14 @@ class BezvadataCz(SimpleHoster): self.correctCaptcha() break else: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) #download url self.html = self.load("http://bezvadata.cz%s" % action, post=inputs) self.checkErrors() m = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html) if m is None: - self.error("Page 2 URL") + self.error(_("Page 2 URL not found")) url = "http://bezvadata.cz%s" % m.group(1) self.logDebug("DL URL %s" % url) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index a7edf60f3..4cbc04755 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -55,7 +55,7 @@ class BitshareCom(SimpleHoster): # Check Traffic used up if re.search(self.TRAFFIC_USED_UP, self.html): - self.logInfo("Your Traffic is used up for today") + self.logInfo(_("Your Traffic is used up for today")) self.wait(30 * 60, True) self.retry() diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 315ec712b..e5cf69914 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -38,7 +38,7 @@ class CatShareNet(SimpleHoster): def getFileInfo(self): m = re.search(self.IP_BLOCKED_PATTERN, self.html) if m: - self.fail("Only connections from Polish IP address are allowed") + self.fail(_("Only connections from Polish IP address are allowed")) return super(CatShareNet, self).getFileInfo() diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 95e00f679..87dd99c84 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -32,7 +32,7 @@ class CrockoCom(SimpleHoster): def handleFree(self): if "You need Premium membership to download this file." in self.html: - self.fail("You need Premium membership to download this file.") + self.fail(_("You need Premium membership to download this file")) for _i in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) @@ -45,7 +45,7 @@ class CrockoCom(SimpleHoster): m = re.search(self.FORM_PATTERN, self.html, re.S) if m is None: - self.error("ACTION") + self.error(_("FORM_PATTERN not found")) action, form = m.groups() inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) @@ -64,7 +64,7 @@ class CrockoCom(SimpleHoster): else: break else: - self.fail("No valid captcha solution received") + self.fail(_("No valid captcha solution received")) getInfo = create_getInfo(CrockoCom) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index cb450425b..5396a7826 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -51,14 +51,14 @@ class CzshareCom(SimpleHoster): # check user credit try: credit = parseFileSize(m.group(1).replace(' ', ''), m.group(2)) - self.logInfo("Premium download for %i KiB of Credit" % (self.pyfile.size / 1024)) - self.logInfo("User %s has %i KiB left" % (self.user, credit / 1024)) + self.logInfo(_("Premium download for %i KiB of Credit") % (self.pyfile.size / 1024)) + self.logInfo(_("User %s has %i KiB left") % (self.user, credit / 1024)) if credit < self.pyfile.size: - self.logInfo("Not enough credit to download file %s" % self.pyfile.name) + self.logInfo(_("Not enough credit to download file: %s") % self.pyfile.name) return False except Exception, e: # let's continue and see what happens... - self.logError("Parse error (CREDIT): %s" % e) + self.logError(repr(e)) return True @@ -69,7 +69,7 @@ class CzshareCom(SimpleHoster): form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.S).group(1) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) except Exception, e: - self.logError("Parse error (FORM): %s" % e) + self.logError(repr(e)) self.resetAccount() # download the file, destination is determined by pyLoad @@ -81,7 +81,7 @@ class CzshareCom(SimpleHoster): # get free url m = re.search(self.FREE_URL_PATTERN, self.html) if m is None: - self.error("Free URL") + self.error(_("FREE_URL_PATTERN not found")) parsed_url = "http://sdilej.cz" + m.group(1) self.logDebug("PARSED_URL:" + parsed_url) @@ -96,7 +96,7 @@ class CzshareCom(SimpleHoster): self.pyfile.size = int(inputs['size']) except Exception, e: self.logError(e) - self.error("Form") + self.error(_("Form")) # get and decrypt captcha captcha_url = 'http://sdilej.cz/captcha.php' @@ -111,7 +111,7 @@ class CzshareCom(SimpleHoster): self.correctCaptcha() break else: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) m = re.search("countdown_number = (\d+);", self.html) self.setWait(int(m.group(1)) if m else 50) @@ -120,7 +120,7 @@ class CzshareCom(SimpleHoster): self.logDebug("WAIT URL", self.req.lastEffectiveURL) m = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL) if m is None: - self.error("Download URL") + self.error(_("Download URL not found")) url = "http://%s/download.php?%s" % (m.group(1), m.group(2)) @@ -139,7 +139,7 @@ class CzshareCom(SimpleHoster): }) if check == "temp_offline": - self.fail("File not available - try later") + self.fail(_("File not available - try later")) if check == "credit": self.resetAccount() elif check == "multi_dl": diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index b4ef6fa92..91028156b 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -91,7 +91,7 @@ class DailymotionCom(Hoster): idx = quality s = streams[idx] - self.logInfo("Download video quality %sx%s" % s[0]) + self.logInfo(_("Download video quality %sx%s") % s[0]) return s[1] diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py index a15e1df39..8cb50b336 100644 --- a/module/plugins/hoster/DataHu.py +++ b/module/plugins/hoster/DataHu.py @@ -37,7 +37,7 @@ class DataHu(SimpleHoster): url = m.group(1) self.logDebug("Direct link: " + url) else: - self.error("Unable to get direct link") + self.error(_("LINK_PATTERN not found")) self.download(url, disposition=True) diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index d57d86e2f..643f5054e 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -32,19 +32,19 @@ class DataportCz(SimpleHoster): action, inputs = self.parseHtmlForm('free_download_form') self.logDebug(action, inputs) if not action or not inputs: - self.error("free_download_form") + self.error(_("free_download_form")) if "captchaId" in inputs and inputs['captchaId'] in captchas: inputs['captchaCode'] = captchas[inputs['captchaId']] else: - self.error("captcha") + self.error(_("captcha")) self.html = self.download("http://www.dataport.cz%s" % action, post=inputs) check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) if check == "captcha": - self.error("invalid captcha") + self.error(_("invalid captcha")) elif check == "slot": self.logDebug("No free slots - wait 60s and retry") self.wait(60, False) diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 73e48d129..4eed41496 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -46,14 +46,14 @@ class DateiTo(SimpleHoster): m = re.search(self.DATA_PATTERN, self.html) if m is None: - self.error("data") + self.error(_("data")) url = 'http://datei.to/' + m.group(1) data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge() else: - self.fail("Too bad...") + self.fail(_("Too bad...")) download_url = self.html self.download(download_url) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index 84f9fbb72..c82d13363 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -27,7 +27,7 @@ class DebridItaliaCom(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia") - self.fail("No DebridItalia account provided") + self.fail(_("No DebridItalia account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) url = "http://debriditalia.com/linkgen2.php?xjxfun=convertiLink&xjxargs[]=S<![CDATA[%s]]>" % pyfile.url @@ -35,7 +35,7 @@ class DebridItaliaCom(Hoster): self.logDebug("XML data: %s" % page) if 'File not available' in page: - self.fail("File not available") + self.fail(_("File not available")) else: new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct') diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 66c81de29..de1cb7000 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -41,21 +41,21 @@ class DepositfilesCom(SimpleHoster): self.html = self.load(self.pyfile.url, post={"gateway_result": "1"}, cookies=True) if re.search(r'File is checked, please try again in a minute.', self.html) is not None: - self.logInfo("DepositFiles.com: The file is being checked. Waiting 1 minute.") + self.logInfo(_("The file is being checked. Waiting 1 minute")) self.wait(61) self.retry() wait = re.search(r'html_download_api-limit_interval\">(\d+)</span>', self.html) if wait: wait_time = int(wait.group(1)) - self.logInfo("%s: Traffic used up. Waiting %d seconds." % (self.__name__, wait_time)) + self.logInfo(_("Traffic used up. Waiting %d seconds") % wait_time) self.wait(wait_time, True) self.retry() wait = re.search(r'>Try in (\d+) minutes or use GOLD account', self.html) if wait: wait_time = int(wait.group(1)) - self.logInfo("%s: All free slots occupied. Waiting %d minutes." % (self.__name__, wait_time)) + self.logInfo(_("All free slots occupied. Waiting %d minutes") % wait_time) self.setWait(wait_time * 60, False) wait = re.search(r'Please wait (\d+) sec', self.html) @@ -72,7 +72,7 @@ class DepositfilesCom(SimpleHoster): recaptcha = ReCaptcha(self) captcha_key = recaptcha.detect_key() if captcha_key is None: - self.error("ReCaptcha key not found") + self.error(_("ReCaptcha key not found")) for _i in xrange(5): self.html = self.load("https://dfiles.eu/get_file.php", get=params) @@ -92,9 +92,9 @@ class DepositfilesCom(SimpleHoster): self.logDebug("LINK: %s" % link) break else: - self.error("Download link") + self.error(_("Download link")) else: - self.fail("No valid captcha response received") + self.fail(_("No valid captcha response received")) try: self.download(link, disposition=True) @@ -104,7 +104,7 @@ class DepositfilesCom(SimpleHoster): def handlePremium(self): if '<span class="html_download_api-gold_traffic_limit">' in self.html: - self.logWarning("Download limit reached") + self.logWarning(_("Download limit reached")) self.retry(25, 60 * 60, "Download limit reached") elif 'onClick="show_gold_offer' in self.html: self.account.relogin(self.user) @@ -117,7 +117,7 @@ class DepositfilesCom(SimpleHoster): elif mirror: dlink = mirror.group(1) else: - self.error("No direct download link or mirror found") + self.error(_("No direct download link or mirror found")) self.download(dlink, disposition=True) diff --git a/module/plugins/hoster/DevhostSt.py b/module/plugins/hoster/DevhostSt.py index fce9e6387..d96209b3f 100644 --- a/module/plugins/hoster/DevhostSt.py +++ b/module/plugins/hoster/DevhostSt.py @@ -35,14 +35,14 @@ class DevhostSt(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) dl_url = m.group(1) self.download(dl_url, disposition=True) check = self.checkDownload({'html': re.compile("html")}) if check == "html": - self.error("Downloaded file is an html page") + self.error(_("Downloaded file is an html page")) getInfo = create_getInfo(DevhostSt) diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index 8932e749c..8b91c03f3 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -161,7 +161,7 @@ class DlFreeFr(SimpleHoster): elif headers.get('code') == 404: self.offline() else: - self.fail("Invalid return code: " + str(headers.get('code'))) + self.fail(_("Invalid return code: ") + str(headers.get('code'))) def handleFree(self): @@ -180,12 +180,12 @@ class DlFreeFr(SimpleHoster): if m: cj.setCookie(m.group(4), m.group(1), m.group(2), m.group(3)) else: - self.fail("Cookie error") + self.fail(_("Cookie error")) location = headers.get("location") self.req.setCookieJar(cj) self.download(location, disposition=True) else: - self.fail("Invalid response") + self.fail(_("Invalid response")) def getLastHeaders(self): diff --git a/module/plugins/hoster/DropboxCom.py b/module/plugins/hoster/DropboxCom.py index efc711bd4..b4152d7ab 100644 --- a/module/plugins/hoster/DropboxCom.py +++ b/module/plugins/hoster/DropboxCom.py @@ -36,7 +36,7 @@ class DropboxCom(SimpleHoster): check = self.checkDownload({'html': re.compile("html")}) if check == "html": - self.error("Downloaded file is an html page") + self.error(_("Downloaded file is an html page")) getInfo = create_getInfo(DropboxCom) diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py index a2e1937fb..a2c78269a 100644 --- a/module/plugins/hoster/EdiskCz.py +++ b/module/plugins/hoster/EdiskCz.py @@ -35,7 +35,7 @@ class EdiskCz(SimpleHoster): m = re.search(self.ACTION_PATTERN, url) if m is None: - self.error("ACTION") + self.error(_("ACTION_PATTERN not found")) action = m.group(1) self.html = self.load(url, decode=True) @@ -48,7 +48,7 @@ class EdiskCz(SimpleHoster): }) if not re.match(self.LINK_PATTERN, url): - self.fail("Unexpected server response") + self.fail(_("Unexpected server response")) self.download(url) diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index d7c4b2eeb..3fad62693 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -54,7 +54,7 @@ class EuroshareEu(SimpleHoster): m = re.search(self.FREE_URL_PATTERN, self.html) if m is None: - self.error("Parse error (URL)") + self.error(_("FREE_URL_PATTERN not found")) parsed_url = "http://euroshare.eu%s" % m.group(1) self.logDebug("URL", parsed_url) self.download(parsed_url, disposition=True) diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 493644721..b2a2fea65 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -31,13 +31,13 @@ class ExtabitCom(SimpleHoster): def handleFree(self): if r">Only premium users can download this file" in self.html: - self.fail("Only premium users can download this file") + self.fail(_("Only premium users can download this file")) m = re.search(r"Next free download from your ip will be available in <b>(\d+)\s*minutes", self.html) if m: self.wait(int(m.group(1)) * 60, True) elif "The daily downloads limit from your IP is exceeded" in self.html: - self.logWarning("You have reached your daily downloads limit for today") + self.logWarning(_("You have reached your daily downloads limit for today")) self.wait(secondsToMidnight(gmt=2), True) self.logDebug("URL: " + self.req.http.lastEffectiveURL) @@ -59,18 +59,18 @@ class ExtabitCom(SimpleHoster): else: self.invalidCaptcha() else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) else: - self.error("Captcha") + self.error(_("Captcha")) if not "href" in response: - self.error("JSON") + self.error(_("Bad JSON response")) self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download URL") + self.error(_("LINK_PATTERN not found")) url = m.group(1) self.download(url) diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index b1e834c61..cb6c44eb7 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -41,7 +41,7 @@ class FastixRu(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix") - self.fail("No Fastix account provided") + self.fail(_("No Fastix account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) api_key = self.account.getAccountData(self.user) @@ -68,6 +68,6 @@ class FastixRu(Hoster): "empty": re.compile(r"^$")}) if check == "error": - self.retry(wait_time=60, reason="An error occurred while generating link.") + self.retry(wait_time=60, reason="An error occurred while generating link") elif check == "empty": - self.retry(wait_time=60, reason="Downloaded File was empty.") + self.retry(wait_time=60, reason="Downloaded File was empty") diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 0019a5708..a07f741fa 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -44,7 +44,7 @@ class FastshareCz(SimpleHoster): if m: action, captcha_src = m.groups() else: - self.error("Free URL") + self.error(_("FREE_URL_PATTERN not found")) baseurl = "http://www.fastshare.cz" captcha = self.decryptCaptcha(urljoin(baseurl, captcha_src)) @@ -66,14 +66,14 @@ class FastshareCz(SimpleHoster): if "location" in header: url = header['location'] elif self.CREDIT_PATTERN in self.html: - self.logWarning("Not enough traffic left") + self.logWarning(_("Not enough traffic left")) self.resetAccount() else: m = re.search(self.PREMIUM_URL_PATTERN, self.html) if m: url = m.group(1) else: - self.error("Premium URL") + self.error(_("PREMIUM_URL_PATTERN not found")) self.logDebug("PREMIUM URL: " + url) self.download(url, disposition=True) diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index 211e668a1..d7e951010 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -35,7 +35,7 @@ class File4safeCom(XFSPHoster): location = m.group(1).strip() self.startDownload(location) else: - self.error("Unable to detect premium download link") + self.error(_("LINK_PATTERN not found")) getInfo = create_getInfo(File4safeCom) diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 427ae9dcc..8f314f059 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -57,9 +57,9 @@ class FileSharkPl(SimpleHoster): alert = m.group(1) if re.match(self.IP_BLOCKED_PATTERN, alert): - self.fail("Only connections from Polish IP are allowed") + self.fail(_("Only connections from Polish IP are allowed")) elif re.match(self.DOWNLOAD_SLOTS_ERROR_PATTERN, alert): - self.logInfo("No free download slots available") + self.logInfo(_("No free download slots available")) self.retry(10, 30 * 60, "Still no free download slots available") else: self.logInfo(alert) @@ -79,7 +79,7 @@ class FileSharkPl(SimpleHoster): def handleFree(self): m = re.search(self.DOWNLOAD_URL_FREE, self.html) if m is None: - self.error("Download url not found") + self.error(_("Download url not found")) file_url = urljoin("http://fileshark.pl", m.group(1)) diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 60b4838ec..6f8f3f775 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -43,7 +43,7 @@ class FilecloudIo(SimpleHoster): m = re.search(self.AB1_PATTERN, self.html) if m is None: - self.error("__AB1") + self.error(_("__AB1")) data['__ab1'] = m.group(1) recaptcha = ReCaptcha(self) @@ -52,10 +52,10 @@ class FilecloudIo(SimpleHoster): captcha_key = m.group(1) if m else recaptcha.detect_key() if captcha_key is None: - self.error("ReCaptcha key not found") + self.error(_("ReCaptcha key not found")) if not self.account: - self.fail("User not logged in") + self.fail(_("User not logged in")) elif not self.account.logged_in: captcha_challenge, captcha_response = recaptcha.challenge(captcha_key) self.account.form_data = {"recaptcha_challenge_field": captcha_challenge, @@ -89,14 +89,14 @@ class FilecloudIo(SimpleHoster): self.correctCaptcha() break else: - self.fail("Incorrect captcha") + self.fail(_("Incorrect captcha")) if response['dl']: self.html = self.load('http://filecloud.io/download.html') m = re.search(self.LINK_PATTERN % self.file_info['ID'], self.html) if m is None: - self.error("Download URL") + self.error(_("LINK_PATTERN not found")) if "size" in self.file_info and self.file_info['size']: self.check_data = {"size": int(self.file_info['size'])} @@ -104,7 +104,7 @@ class FilecloudIo(SimpleHoster): download_url = m.group(1) self.download(download_url) else: - self.fail("Unexpected server response") + self.fail(_("Unexpected server response")) def handlePremium(self): diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index f4729cf2f..068724488 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -45,13 +45,13 @@ class FilefactoryCom(SimpleHoster): def handleFree(self): if "Currently only Premium Members can download files larger than" in self.html: - self.fail("File too large for free download") + self.fail(_("File too large for free download")) elif "All free download slots on this server are currently in use" in self.html: self.retry(50, 15 * 60, "All free slots are busy") m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Free download link not found") + self.error(_("Free download link not found")) dl_link = m.group(1) @@ -68,7 +68,7 @@ class FilefactoryCom(SimpleHoster): self.logDebug("Parallel downloads detected; waiting 15 minutes") self.retry(wait_time=15 * 60, reason="Parallel downloads") elif check == "error": - self.error("Unknown error") + self.error(_("Unknown error")) def handlePremium(self): @@ -86,6 +86,6 @@ class FilefactoryCom(SimpleHoster): if m: url = m.group(1) else: - self.error("Premium download link not found") + self.error(_("Premium download link not found")) self.download(url, disposition=True) diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 4090ce92b..338c89cae 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -35,12 +35,12 @@ class FilepostCom(SimpleHoster): m = re.search(self.FLP_TOKEN_PATTERN, self.html) if m is None: - self.error("Token") + self.error(_("Token")) flp_token = m.group(1) m = re.search(self.RECAPTCHA_PATTERN, self.html) if m is None: - self.error("Captcha key") + self.error(_("Captcha key")) captcha_key = m.group(1) # Get wait time @@ -58,14 +58,14 @@ class FilepostCom(SimpleHoster): for file_pass in self.getPassword().splitlines(): get_dict['JsHttpRequest'] = str(int(time() * 10000)) + '-xml' post_dict['file_pass'] = file_pass - self.logInfo("Password protected link, trying " + file_pass) + self.logInfo(_("Password protected link, trying ") + file_pass) download_url = self.getJsonResponse(get_dict, post_dict, 'link') if download_url: break else: - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) else: # Solve recaptcha @@ -88,7 +88,7 @@ class FilepostCom(SimpleHoster): self.invalidCaptcha() else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) # Download self.download(download_url) @@ -99,7 +99,7 @@ class FilepostCom(SimpleHoster): self.logDebug(json_response) if not 'js' in json_response: - self.error("JSON %s 1" % field) + self.error(_("JSON %s 1") % field) # i changed js_answer to json_response['js'] since js_answer is nowhere set. # i don't know the JSON-HTTP specs in detail, but the previous author @@ -120,10 +120,9 @@ class FilepostCom(SimpleHoster): return None else: self.fail(json_response['js']['error']) - # ~? self.fail(js_answer['error']) if not 'answer' in json_response['js'] or not field in json_response['js']['answer']: - self.error("JSON %s 2" % field) + self.error(_("JSON %s 2") % field) return json_response['js']['answer'][field] diff --git a/module/plugins/hoster/FilepupNet.py b/module/plugins/hoster/FilepupNet.py index 2a1c43913..81d171685 100644 --- a/module/plugins/hoster/FilepupNet.py +++ b/module/plugins/hoster/FilepupNet.py @@ -38,14 +38,14 @@ class FilepupNet(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) dl_link = m.group(1) self.download(dl_link, post={'task': "download"}) check = self.checkDownload({'html': re.compile("html")}) if check == "html": - self.error("Downloaded file is an html page") + self.error(_("Downloaded file is an html page")) getInfo = create_getInfo(FilepupNet) diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index d45289fc0..9a34f8872 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -41,7 +41,7 @@ class FilerNet(SimpleHoster): inputs = self.parseHtmlForm(input_names='token')[1] if 'token' not in inputs: - self.error("Unable to detect token") + self.error(_("Unable to detect token")) token = inputs['token'] self.logDebug("Token: " + token) @@ -49,7 +49,7 @@ class FilerNet(SimpleHoster): inputs = self.parseHtmlForm(input_names='hash')[1] if 'hash' not in inputs: - self.error("Unable to detect hash") + self.error(_("Unable to detect hash")) hash_data = inputs['hash'] self.logDebug("Hash: " + hash_data) @@ -76,7 +76,7 @@ class FilerNet(SimpleHoster): self.invalidCaptcha() if not downloadURL: - self.fail("No Download url retrieved/all captcha attempts failed") + self.fail(_("No Download url retrieved/all captcha attempts failed")) self.download(downloadURL, disposition=True) @@ -89,7 +89,7 @@ class FilerNet(SimpleHoster): html = self.load(self.pyfile.url) m = re.search(self.LINK_PATTERN, html) if m is None: - self.error("Unable to detect direct link, try to enable 'Direct download' in your user settings") + self.error(_("LINK_PATTERN not found")) dl = 'http://filer.net' + m.group(1) self.logDebug("Direct link: " + dl) diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 8aafb5c0c..9fded2dd8 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -91,11 +91,11 @@ class FileserveCom(Hoster): self.doLongWait(re.search(self.LONG_WAIT_PATTERN, self.html)) elif action['fail'] == "parallelDownload": - self.logWarning(_("Parallel download error, now waiting 60s.")) + self.logWarning(_("Parallel download error, now waiting 60s")) self.retry(wait_time=60, reason="parallelDownload") else: - self.fail("Download check returned %s" % action['fail']) + self.fail(_("Download check returned: %s") % action['fail']) elif "success" in action: if action['success'] == "showCaptcha": @@ -105,13 +105,13 @@ class FileserveCom(Hoster): self.doTimmer() else: - self.error("Unknown server response") + self.error(_("Unknown server response")) # show download link response = self.load(self.url, post={"downloadLink": "show"}, decode=True) self.logDebug("Show downloadLink response : %s" % response) if "fail" in response: - self.error("Couldn't retrieve download url") + self.error(_("Couldn't retrieve download url")) # this may either download our file or forward us to an error page self.download(self.url, post={"download": "normal"}) @@ -127,7 +127,7 @@ class FileserveCom(Hoster): elif check == "wait": self.doLongWait(self.lastCheck) elif check == "limit": - self.logWarning("Download limited reached for today") + self.logWarning(_("Download limited reached for today")) self.setWait(secondsToMidnight(gmt=2), True) self.wait() self.retry() @@ -140,12 +140,12 @@ class FileserveCom(Hoster): self.logDebug("Wait response : %s" % response[:80]) if "fail" in response: - self.fail("Failed getting wait time") + self.fail(_("Failed getting wait time")) if self.__name__ == "FilejungleCom": m = re.search(r'"waitTime":(\d+)', response) if m is None: - self.fail("Cannot get wait time") + self.fail(_("Cannot get wait time")) wait_time = int(m.group(1)) else: wait_time = int(response) + 3 @@ -170,7 +170,7 @@ class FileserveCom(Hoster): self.correctCaptcha() break else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) def doLongWait(self, m): @@ -209,7 +209,7 @@ class FileserveCom(Hoster): if check == "login": self.account.relogin(self.user) - self.retry(reason=_("Not logged in.")) + self.retry(reason=_("Not logged in")) def getInfo(urls): diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py index 8c5c95839..9aa2a3e11 100644 --- a/module/plugins/hoster/FlyFilesNet.py +++ b/module/plugins/hoster/FlyFilesNet.py @@ -36,7 +36,7 @@ class FlyFilesNet(SimpleHoster): self.logDebug("Parsed URL: %s" % parsed_url) if parsed_url == '#downlink|' or parsed_url == "#downlink|#": - self.logWarning("Could not get the download URL. Please wait 10 minutes.") + self.logWarning(_("Could not get the download URL. Please wait 10 minutes")) self.wait(10 * 60, True) self.retry() diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py index 2ea061544..f3f97e875 100644 --- a/module/plugins/hoster/FourSharedCom.py +++ b/module/plugins/hoster/FourSharedCom.py @@ -32,7 +32,7 @@ class FourSharedCom(SimpleHoster): def handleFree(self): if not self.account: - self.fail("User not logged in") + self.fail(_("User not logged in")) m = re.search(self.DOWNLOAD_BUTTON_PATTERN, self.html) if m: @@ -44,7 +44,7 @@ class FourSharedCom(SimpleHoster): m = re.search(self.DOWNLOAD_URL_PATTERN, self.html) if m is None: - self.error("Download link") + self.error(_("Download link")) link = m.group(1) try: diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 6287545cb..529b107d3 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -50,13 +50,13 @@ class FreakshareCom(Hoster): "downloadserver": "No Downloadserver. Please try again later!"}) if check == "bad": - self.fail("Bad Try.") + self.fail(_("Bad Try")) elif check == "paralell": self.setWait(300, True) self.wait() self.retry() elif check == "empty": - self.fail("File not downloadable") + self.fail(_("File not downloadable")) elif check == "wrong_captcha": self.invalidCaptcha() self.retry() diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py index 88ba982f6..e9ca59e3f 100644 --- a/module/plugins/hoster/FreeWayMe.py +++ b/module/plugins/hoster/FreeWayMe.py @@ -24,7 +24,7 @@ class FreeWayMe(Hoster): def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "FreeWayMe") - self.fail("No FreeWay account provided") + self.fail(_("No FreeWay account provided")) self.logDebug("Old URL: %s" % pyfile.url) diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 217e2d754..fd9980117 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -68,16 +68,16 @@ class FshareVn(SimpleHoster): self.url = self.pyfile.url + action if not inputs: - self.error("FORM") + self.error(_("No FORM")) elif 'link_file_pwd_dl' in inputs: for password in self.getPassword().splitlines(): - self.logInfo("Password protected link, trying", password) + self.logInfo(_("Password protected link, trying ") + password) inputs['link_file_pwd_dl'] = password self.html = self.load(self.url, post=inputs, decode=True) if not 'name="link_file_pwd_dl"' in self.html: break else: - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) else: self.html = self.load(self.url, post=inputs, decode=True) @@ -88,7 +88,7 @@ class FshareVn(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("FREE DL URL") + self.error(_("LINK_PATTERN not found")) self.url = m.group(1) self.logDebug("FREE DL URL: %s" % self.url) @@ -106,7 +106,7 @@ class FshareVn(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: - self.logInfo("Wait until %s ICT" % m.group(1)) + self.logInfo(_("Wait until %s ICT") % m.group(1)) wait_until = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")) self.wait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True) self.retry() @@ -123,4 +123,4 @@ class FshareVn(SimpleHoster): }) if check == "not_found": - self.fail("File not m on server") + self.fail(_("File not m on server")) diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index bdf75b10f..68104aeec 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -55,7 +55,7 @@ class Ftp(Hoster): try: response = self.load(pyfile.url) except pycurl.error, e: - self.fail("Error %d: %s" % e.args) + self.fail(_("Error %d: %s") % e.args) self.req.http.c.setopt(pycurl.NOBODY, 0) self.logDebug(self.req.http.header) @@ -76,4 +76,4 @@ class Ftp(Hoster): self.logDebug("LINKS", links) self.core.api.addPackage(pkgname, links) else: - self.fail("Unexpected server response") + self.fail(_("Unexpected server response")) diff --git a/module/plugins/hoster/GamefrontCom.py b/module/plugins/hoster/GamefrontCom.py index 2009d06ab..e36e5a570 100644 --- a/module/plugins/hoster/GamefrontCom.py +++ b/module/plugins/hoster/GamefrontCom.py @@ -56,7 +56,7 @@ class GamefrontCom(Hoster): def _getName(self): name = re.search(self.PATTERN_FILENAME, self.html) if name is None: - self.fail("%s: Plugin broken." % self.__name__) + self.fail(_("Plugin broken") return name.group(1) diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 5b322187b..20e453ce6 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -49,7 +49,7 @@ class GigapetaCom(SimpleHoster): elif "Entered figures don`t coincide with the picture" in self.html: self.invalidCaptcha() else: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) self.req.http.c.setopt(FOLLOWLOCATION, 1) self.download(download_url) diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index a5cea6b9f..44ca53c8a 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -30,16 +30,16 @@ class HellshareCz(SimpleHoster): def process(self, pyfile): if not self.account: - self.fail("User not logged in") + self.fail(_("User not logged in")) pyfile.url = re.match(self.__pattern__, pyfile.url).group(1) self.html = self.load(pyfile.url, decode=True) self.getFileInfo() if not self.checkTrafficLeft(): - self.fail("Not enough traffic left for user %s." % self.user) + self.fail(_("Not enough traffic left for user ") + self.user) m = re.search(self.SHOW_WINDOW_PATTERN, self.html) if m is None: - self.error("SHOW WINDOW") + self.error(_("SHOW_WINDOW_PATTERN not found")) self.url = "http://www.hellshare.com" + m.group(1) self.download(self.url) diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 6f92b4b42..f06fa2788 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -53,10 +53,10 @@ class IfileIt(SimpleHoster): self.correctCaptcha() break else: - self.fail("Incorrect captcha") + self.fail(_("Incorrect captcha")) if not "ticket_url" in json_response: - self.error("Download URL") + self.error(_("No download URL")) self.download(json_response['ticket_url']) diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 94a7d0c5f..396cc62d2 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -66,7 +66,7 @@ class IfolderRu(SimpleHoster): else: break else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) download_url = re.search(self.LINK_PATTERN, self.html).group(1) self.correctCaptcha() diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index aea80d29f..bd7825d08 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -66,7 +66,7 @@ class Keep2shareCC(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Unable to detect direct link") + self.error(_("LINK_PATTERN not found")) self.startDownload(m.group(1)) @@ -96,7 +96,7 @@ class Keep2shareCC(SimpleHoster): else: self.invalidCaptcha() else: - self.fail("All captcha attempts failed") + self.fail(_("All captcha attempts failed")) def startDownload(self, url): diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index b4e393c37..4bf477663 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -50,7 +50,7 @@ class KingfilesNet(SimpleHoster): # Make the downloadlink appear and load the file m = re.search(self.RAND_ID_PATTERN, b) if m is None: - self.error("Random key not found") + self.error(_("Random key not found")) rand = m.group(1) self.logDebug("rand = ", rand) @@ -68,14 +68,14 @@ class KingfilesNet(SimpleHoster): m = re.search(self.LINK_PATTERN, c) if m is None: - self.error("Download url not found") + self.error(_("Download url not found")) dl_url = m.group(1) self.download(dl_url, cookies=True, disposition=True) check = self.checkDownload({'html': re.compile("<html>")}) if check == "html": - self.error("Downloaded file is an html page") + self.error(_("Downloaded file is an html page")) getInfo = create_getInfo(KingfilesNet) diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 983a50c6c..94702e4ab 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -71,7 +71,7 @@ class LetitbitNet(SimpleHoster): def handleFree(self): action, inputs = self.parseHtmlForm('id="ifree_form"') if not action: - self.error("ifree_form") + self.error(_("ifree_form")) domain = "http://www." + self.HOSTER_NAME self.pyfile.size = float(inputs['sssize']) @@ -90,7 +90,7 @@ class LetitbitNet(SimpleHoster): response = self.load("%s/ajax/download3.php" % domain, post=" ", cookies=True) if response != '1': - self.error("Unknown response - ajax_check_url") + self.error(_("Unknown response - ajax_check_url")) self.logDebug(response) recaptcha = ReCaptcha(self) @@ -104,7 +104,7 @@ class LetitbitNet(SimpleHoster): if not response: self.invalidCaptcha() if response == "error_free_download_blocked": - self.logWarning("Daily limit reached") + self.logWarning(_("Daily limit reached")) self.wait(secondsToMidnight(gmt=2), True) if response == "error_wrong_captcha": self.invalidCaptcha() @@ -114,7 +114,7 @@ class LetitbitNet(SimpleHoster): elif response.startswith('http://'): urls = [response] else: - self.error("Unknown response - captcha check") + self.error(_("Unknown response - captcha check")) self.correctCaptcha() @@ -125,7 +125,7 @@ class LetitbitNet(SimpleHoster): except Exception, e: self.logError(e) else: - self.fail("Download did not finish correctly") + self.fail(_("Download did not finish correctly")) def handlePremium(self): diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index 3c417a9d3..512f55686 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -33,7 +33,7 @@ class LinksnappyCom(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Linksnappy.com") - self.fail("No Linksnappy.com account provided") + self.fail(_("No Linksnappy.com account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) host = self._get_host(pyfile.url) @@ -48,8 +48,9 @@ class LinksnappyCom(Hoster): j = json_loads(r)['links'][0] if j['error']: - self.logError("Error converting the link: %s" % j['error']) - self.fail("Error converting the link") + msg = _("Error converting the link") + self.logError(msg, j['error']) + self.fail(msg) pyfile.name = j['filename'] new_url = j['generated'] @@ -66,7 +67,7 @@ class LinksnappyCom(Hoster): check = self.checkDownload({"html302": "<title>302 Found</title>"}) if check == "html302": - self.retry(wait_time=5, reason="Linksnappy returns only HTML data.") + self.retry(wait_time=5, reason="Linksnappy returns only HTML data") @staticmethod diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 53227baf1..c289ddf3c 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -42,7 +42,7 @@ class LoadTo(SimpleHoster): # Search for Download URL m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Unable to detect download URL") + self.error(_("LINK_PATTERN not found")) download_url = m.group(1) @@ -65,7 +65,7 @@ class LoadTo(SimpleHoster): self.invalidCaptcha() self.retry() elif check == "html": - self.logWarning("Downloaded file is an html page, will retry") + self.logWarning(_("Downloaded file is an html page, will retry")) self.retry() diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index b7f3d7099..8ae56458b 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -33,7 +33,7 @@ class LuckyShareNet(SimpleHoster): self.logDebug("You have to wait %d seconds between free downloads" % waittime) self.retry(wait_time=waittime) else: - self.error("Unable to detect wait time between free downloads") + self.error(_("Unable to detect wait time between free downloads")) elif 'Hash expired' in rep: self.retry(reason="Hash expired") return json_loads(rep) @@ -64,10 +64,10 @@ class LuckyShareNet(SimpleHoster): elif 'Verification failed' in rep: self.invalidCaptcha() else: - self.error("Unable to get downlaod link") + self.error(_("Unable to get downlaod link")) if not json['link']: - self.fail("No Download url retrieved/all captcha attempts failed") + self.fail(_("No Download url retrieved/all captcha attempts failed")) self.logDebug("Direct URL: " + json['link']) self.download(json['link']) diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 571589de8..969203248 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -100,14 +100,14 @@ class MediafireCom(SimpleHoster): while self.PASSWORD_PATTERN in self.html: if len(passwords): password = passwords.pop(0) - self.logInfo("Password protected link, trying " + password) + self.logInfo(_("Password protected link, trying ") + password) self.html = self.load(self.url, post={"downloadp": password}) else: - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) m = re.search(r'kNO = r"(http://.*?)";', self.html) if m is None: - self.error("Download URL") + self.error(_("No download URL")) download_url = m.group(1) self.download(download_url) diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index 68b7e0c1e..ea245b9d0 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -34,10 +34,10 @@ class MegaDebridEu(Hoster): if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url elif not self.account: - self.exitOnFail(_("Please enter your %s account or deactivate this plugin") % "Mega-debrid.eu") + self.exitOnFail("Please enter your %s account or deactivate this plugin" % "Mega-debrid.eu") else: if not self.connectToApi(): - self.exitOnFail(_("Unable to connect to %s") % "Mega-debrid.eu") + self.exitOnFail("Unable to connect to Mega-debrid.eu") self.logDebug("Old URL: %s" % pyfile.url) new_url = self.debridLink(pyfile.url) @@ -88,7 +88,7 @@ class MegaDebridEu(Hoster): And display the reason of this failure """ if self.getConfig("unloadFailing"): - self.logError(msg) + self.logError(_(msg)) self.resetAccount() else: - self.fail(msg) + self.fail(_(msg)) diff --git a/module/plugins/hoster/MegaRapidCz.py b/module/plugins/hoster/MegaRapidCz.py index 01b2aaf70..61c3ab425 100644 --- a/module/plugins/hoster/MegaRapidCz.py +++ b/module/plugins/hoster/MegaRapidCz.py @@ -66,6 +66,6 @@ class MegaRapidCz(SimpleHoster): self.relogin(self.user) self.retry(wait_time=60, reason="User login failed") elif re.search(self.ERR_CREDIT_PATTERN, self.html): - self.fail("Not enough credit left") + self.fail(_("Not enough credit left")) else: - self.fail("Download link not found") + self.fail(_("Download link not found")) diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index 29ae47509..9f21ce868 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -57,7 +57,7 @@ class MegasharesCom(SimpleHoster): verifyinput = self.decryptCaptcha( "http://d01.megashares.com/index.php?secgfx=gfx&random_num=%s" % random_num) - self.logInfo("Reactivating passport %s: %s %s" % (passport_num, random_num, verifyinput)) + self.logInfo(_("Reactivating passport %s: %s %s") % (passport_num, random_num, verifyinput)) url = ("http://d01.megashares.com%s&rs=check_passport_renewal" % request_uri + "&rsargs[]=%s&rsargs[]=%s&rsargs[]=%s" % (verifyinput, random_num, passport_num) + @@ -71,23 +71,23 @@ class MegasharesCom(SimpleHoster): else: self.invalidCaptcha() else: - self.fail("Failed to reactivate passport") + self.fail(_("Failed to reactivate passport")) m = re.search(self.PASSPORT_RENEW_PATTERN, self.html) if m: time = [int(x) for x in m.groups()] renew = time[0] + (time[1] * 60) + (time[2] * 60) - self.logDebug('Waiting %d seconds for a new passport' % renew) + self.logDebug("Waiting %d seconds for a new passport" % renew) self.retry(wait_time=renew, reason="Passport renewal") # Check traffic left on passport m = re.search(self.PASSPORT_LEFT_PATTERN, self.html, re.M | re.S) if m is None: - self.fail("Passport not found") + self.fail(_("Passport not found")) - self.logInfo("Download passport: %s" % m.group(1)) + self.logInfo(_("Download passport: %s") % m.group(1)) data_left = float(m.group(2)) * 1024 ** {'B': 0, 'KB': 1, 'MB': 2, 'GB': 3}[m.group(3)] - self.logInfo("Data left: %s %s (%d MB needed)" % (m.group(2), m.group(3), self.pyfile.size / 1048576)) + self.logInfo(_("Data left: %s %s (%d MB needed)") % (m.group(2), m.group(3), self.pyfile.size / 1048576)) if not data_left: self.retry(wait_time=600, reason="Passport renewal") @@ -98,7 +98,7 @@ class MegasharesCom(SimpleHoster): def handleDownload(self, premium=False): # Find download link; m = re.search(self.LINK_PATTERN % (1 if premium else 2), self.html) - msg = '%s download URL' % ('Premium' if premium else 'Free') + msg = _('%s download URL' % ('Premium' if premium else 'Free')) if m is None: self.error(msg) diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index f7c8b47fd..24aabfb24 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -45,7 +45,7 @@ class MultishareCz(SimpleHoster): def handlePremium(self): if not self.checkCredit(): - self.logWarning("Not enough credit left to download file") + self.logWarning(_("Not enough credit left to download file")) self.resetAccount() self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) @@ -53,13 +53,13 @@ class MultishareCz(SimpleHoster): def handleOverriden(self): if not self.premium: - self.fail("Only premium users can download from other hosters") + self.fail(_("Only premium users can download from other hosters")) self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post={"link": self.pyfile.url}, decode=True) self.getFileInfo() if not self.checkCredit(): - self.fail("Not enough credit left to download file") + self.fail(_("Not enough credit left to download file")) url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random() * 10000 * random()) params = {"u_ID": self.acc_info['u_ID'], "u_hash": self.acc_info['u_hash'], "link": self.pyfile.url} @@ -69,7 +69,7 @@ class MultishareCz(SimpleHoster): def checkCredit(self): self.acc_info = self.account.getAccountInfo(self.user, True) - self.logInfo("User %s has %i MB left" % (self.user, self.acc_info['trafficleft'] / 1024)) + self.logInfo(_("User %s has %i MB left") % (self.user, self.acc_info['trafficleft'] / 1024)) return self.pyfile.size / 1024 <= self.acc_info['trafficleft'] diff --git a/module/plugins/hoster/MyfastfileCom.py b/module/plugins/hoster/MyfastfileCom.py index a9e84a2f2..64161affa 100644 --- a/module/plugins/hoster/MyfastfileCom.py +++ b/module/plugins/hoster/MyfastfileCom.py @@ -28,7 +28,7 @@ class MyfastfileCom(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Myfastfile.com") - self.fail("No Myfastfile.com account provided") + self.fail(_("No Myfastfile.com account provided")) else: self.logDebug("Original URL: %s" % pyfile.url) page = self.load('http://myfastfile.com/api.php', @@ -37,7 +37,7 @@ class MyfastfileCom(Hoster): self.logDebug("JSON data: " + page) page = json_loads(page) if page['status'] != 'ok': - self.fail("Unable to unrestrict link") + self.fail(_("Unable to unrestrict link")) new_url = page['link'] if new_url != pyfile.url: diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index 4ba43a850..d99d997f5 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -36,7 +36,7 @@ class NarodRu(SimpleHoster): self.html = self.load('http://narod.ru/disk/getcapchaxml/?rnd=%d' % int(random() * 777)) m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error("Captcha") + self.error(_("Captcha")) post_data = {"action": "sendcapcha"} captcha_url, post_data['key'] = m.groups() post_data['rep'] = self.decryptCaptcha(captcha_url) @@ -50,9 +50,9 @@ class NarodRu(SimpleHoster): elif u'<b class="error-msg"><strong>ÐÑОблОÑÑ?</strong>' in self.html: self.invalidCaptcha() else: - self.error("Download link") + self.error(_("Download link")) else: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) self.download(url) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index ffacc9c66..2d4773bac 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -81,7 +81,7 @@ class NetloadIn(Hoster): self.pyfile.name = self.api_data['filename'] if self.premium: - self.logDebug("Netload: Use Premium Account") + self.logDebug("Use Premium Account") settings = self.load("http://www.netload.in/index.php?id=2&lang=en") if '<option value="2" selected="selected">Direkter Download' in settings: self.logDebug("Using direct download") @@ -92,7 +92,7 @@ class NetloadIn(Hoster): if self.download_html(): return True else: - self.fail("Failed") + self.fail(_("Failed")) return False @@ -118,7 +118,7 @@ class NetloadIn(Hoster): self.download_api_data(n + 1) return - self.logDebug("Netload: APIDATA: " + src) + self.logDebug("APIDATA: " + src) self.api_data = {} if src and ";" in src and src not in ("unknown file_data", "unknown_server_data", "No input file specified."): lines = src.split(";") @@ -141,18 +141,18 @@ class NetloadIn(Hoster): def final_wait(self, page): wait_time = self.get_wait_time(page) self.setWait(wait_time) - self.logDebug("Netload: final wait %d seconds" % wait_time) + self.logDebug("Final wait %d seconds" % wait_time) self.wait() self.url = self.get_file_url(page) def download_html(self): - self.logDebug("Netload: Entering download_html") + self.logDebug("Entering download_html") page = self.load(self.url, decode=True) t = time() + 30 if "/share/templates/download_hddcrash.tpl" in page: - self.logError("Netload HDD Crash") + self.logError(_("Netload HDD Crash")) self.fail(_("File temporarily not available")) if not self.api_data: @@ -176,28 +176,28 @@ class NetloadIn(Hoster): t = time() + 30 if "/share/templates/download_hddcrash.tpl" in page: - self.logError("Netload HDD Crash") + self.logError(_("Netload HDD Crash")) self.fail(_("File temporarily not available")) - self.logDebug("Netload: try number %d " % i) + self.logDebug("Try number %d " % i) if ">Your download is being prepared.<" in page: - self.logDebug("Netload: We will prepare your download") + self.logDebug("We will prepare your download") self.final_wait(page) return True if ">An access request has been made from IP address <" in page: wait = self.get_wait_time(page) if not wait: - self.logDebug("Netload: Wait was 0 setting 30") + self.logDebug("Wait was 0 setting 30") wait = 30 * 60 - self.logInfo(_("Netload: waiting between downloads %d s." % wait)) + self.logInfo(_("Waiting between downloads %d seconds") % wait) self.wantReconnect = True self.setWait(wait) self.wait() return self.download_html() - self.logDebug("Netload: Trying to find captcha") + self.logDebug("Trying to find captcha") try: url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', @@ -210,7 +210,7 @@ class NetloadIn(Hoster): page = self.load(url_captcha_html, cookies=True) captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', page).group(1) except: - self.logDebug("Netload: Could not find captcha, try again from beginning") + self.logDebug("Could not find captcha, try again from beginning") captchawaited = False continue @@ -221,7 +221,7 @@ class NetloadIn(Hoster): self.pyfile.waitUntil = time() # dont wait contrary to time on website else: self.pyfile.waitUntil = t - self.logInfo(_("Netload: waiting for captcha %d s.") % (self.pyfile.waitUntil - time())) + self.logInfo(_("Waiting for captcha %d seconds") % (self.pyfile.waitUntil - time())) #self.setWait(wait) self.wait() captchawaited = True @@ -240,12 +240,12 @@ class NetloadIn(Hoster): if attempt is not None: return attempt.group(1) else: - self.logDebug("Netload: Backup try for final link") + self.logDebug("Backup try for final link") file_url_pattern = r'<a href="(.+)" class="Orange_Link">Click here' attempt = re.search(file_url_pattern, page) return "http://netload.in/" + attempt.group(1) except: - self.logDebug("Netload: Getting final link failed") + self.logDebug("Getting final link failed") return None @@ -255,7 +255,7 @@ class NetloadIn(Hoster): def proceed(self, url): - self.logDebug("Netload: Downloading..") + self.logDebug("Downloading..") self.download(url, disposition=True) diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 59ca68258..c3867a2f5 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -55,7 +55,7 @@ class NowDownloadEu(SimpleHoster): url = re.search(self.LINK_PATTERN, self.html) if url is None: - self.error("Download link not found") + self.error(_("Download link not found")) self.download(str(url.group(1))) diff --git a/module/plugins/hoster/NowVideoAt.py b/module/plugins/hoster/NowVideoAt.py index 93ecec9cf..3cfd94f43 100644 --- a/module/plugins/hoster/NowVideoAt.py +++ b/module/plugins/hoster/NowVideoAt.py @@ -30,7 +30,7 @@ class NowVideoAt(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) self.download(m.group(1), disposition=True) diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index afbd6566c..57c35e1ac 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -60,14 +60,14 @@ class OboomCom(Hoster): if "session" in accountInfo: self.sessionToken = accountInfo['session'] else: - self.fail("Could not retrieve premium session") + self.fail(_("Could not retrieve premium session")) else: apiUrl = "https://www.oboom.com/1.0/guestsession" result = self.loadUrl(apiUrl) if result[0] == 200: self.sessionToken = result[1] else: - self.fail("Could not retrieve token for guest session. Error code %s" % result[0]) + self.fail(_("Could not retrieve token for guest session. Error code: %s") % result[0]) def solveCaptcha(self): @@ -107,7 +107,7 @@ class OboomCom(Hoster): self.retry(5) else: self.invalidCaptcha() - self.fail("Received invalid captcha 5 times") + self.fail(_("Received invalid captcha 5 times")) def getFileInfo(self, token, fileId): @@ -123,7 +123,7 @@ class OboomCom(Hoster): else: self.offline() else: - self.fail("Could not retrieve file info. Error code %s: %s" % (result[0], result[1])) + self.fail(_("Could not retrieve file info. Error code %s: %s") % (result[0], result[1])) def getDownloadTicket(self): @@ -142,4 +142,4 @@ class OboomCom(Hoster): elif result[0] == 421: self.retry(wait_time=result[2] + 60, reason="Connection limit exceeded") else: - self.fail("Could not retrieve download ticket. Error code %s" % result[0]) + self.fail(_("Could not retrieve download ticket. Error code: %s") % result[0]) diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 3f3d0a19a..d7e477356 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -40,13 +40,13 @@ class OneFichierCom(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: wait_time = int(m.group(1)) + 1 #: One minute more than what the page displays to be safe - self.logInfo("You have to wait been each free download", "Retrying in %d minutes." % wait_time) + self.logInfo(_("You have to wait been each free download"), _("Retrying in %d minutes") % wait_time) self.wait(wait_time * 60, True) self.retry() url, inputs = self.parseHtmlForm('action="http://%s' % self.file_info['ID']) if not url: - self.error("Download link not found") + self.error(_("Download link not found")) # Check for protection if "pass" in inputs: @@ -62,7 +62,7 @@ class OneFichierCom(SimpleHoster): def handlePremium(self): url, inputs = self.parseHtmlForm('action="http://%s' % self.file_info['ID']) if not url: - self.error("Download link not found") + self.error(_("Download link not found")) # Check for protection if "pass" in inputs: diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index 1b50ae8a2..6ebfbfdbe 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -27,7 +27,7 @@ class OverLoadMe(Hoster): name = unquote(url.rsplit("/", 1)[1]) except IndexError: name = "Unknown_Filename..." - if name.endswith("..."): # incomplete filename, append random stuff + if name.endswith("..."): #: incomplete filename, append random stuff name += "%s.tmp" % randrange(100, 999) return name @@ -42,7 +42,7 @@ class OverLoadMe(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Over-Load") - self.fail("No Over-Load account provided") + self.fail(_("No Over-Load account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) data = self.account.getAccountData(self.user) diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 8595304c4..e3f9b9dc2 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -30,7 +30,7 @@ class PremiumTo(Hoster): def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "premium.to") - self.fail("No premium.to account provided") + self.fail(_("No premium.to account provided")) self.logDebug("Old URL: %s" % pyfile.url) @@ -59,10 +59,10 @@ class PremiumTo(Hoster): f.close() remove(lastDownload) else: - err = 'File does not exist' + err = _('File does not exist') trb = self.getTraffic() - self.logInfo("Filesize: %d, Traffic used %d, traffic left %d" % (pyfile.size, tra - trb, trb)) + self.logInfo(_("Filesize: %d, Traffic used %d, traffic left %d") % (pyfile.size, tra - trb, trb)) if err: self.fail(err) diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py index 07872326c..e7dba7dc3 100644 --- a/module/plugins/hoster/PremiumizeMe.py +++ b/module/plugins/hoster/PremiumizeMe.py @@ -20,7 +20,7 @@ class PremiumizeMe(Hoster): # Check account if not self.account or not self.account.canUse(): self.logError(_("Please enter your %s account or deactivate this plugin") % "premiumize.me") - self.fail("No valid premiumize.me account provided") + self.fail(_("No valid premiumize.me account provided")) # In some cases hostsers do not supply us with a filename at download, so we # are going to set a fall back filename (e.g. for freakshare or xfileshare) @@ -46,7 +46,7 @@ class PremiumizeMe(Hoster): if status == 200: self.download(data['result']['location'], disposition=True) elif status == 400: - self.fail("Invalid link") + self.fail(_("Invalid link")) elif status == 404: self.offline() elif status >= 500: diff --git a/module/plugins/hoster/PromptfileCom.py b/module/plugins/hoster/PromptfileCom.py index 641c1f642..14c0854b7 100644 --- a/module/plugins/hoster/PromptfileCom.py +++ b/module/plugins/hoster/PromptfileCom.py @@ -28,7 +28,7 @@ class PromptfileCom(SimpleHoster): # STAGE 1: get link to continue m = re.search(self.CHASH_PATTERN, self.html) if m is None: - self.error("Unable to detect chash") + self.error(_("CHASH_PATTERN not found")) chash = m.group(1) self.logDebug("Read chash %s" % chash) # continue to stage2 @@ -37,7 +37,7 @@ class PromptfileCom(SimpleHoster): # STAGE 2: get the direct link m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Unable to detect direct link") + self.error(_("LINK_PATTERN not found")) direct = m.group(1) self.logDebug("Found direct link: " + direct) self.download(direct, disposition=True) diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py index 07b95e1bc..948ab2005 100644 --- a/module/plugins/hoster/QuickshareCz.py +++ b/module/plugins/hoster/QuickshareCz.py @@ -37,11 +37,11 @@ class QuickshareCz(SimpleHoster): if self.premium: if 'UU_prihlasen' in self.jsvars: if self.jsvars['UU_prihlasen'] == '0': - self.logWarning("User not logged in") + self.logWarning(_("User not logged in")) self.relogin(self.user) self.retry() elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']): - self.logWarning("Not enough credit left") + self.logWarning(_("Not enough credit left")) self.premium = False if self.premium: @@ -51,7 +51,7 @@ class QuickshareCz(SimpleHoster): check = self.checkDownload({"err": re.compile(r"\AChyba!")}, max_size=100) if check == "err": - self.fail("File not m or plugin defect") + self.fail(_("File not m or plugin defect")) def handleFree(self): @@ -67,7 +67,7 @@ class QuickshareCz(SimpleHoster): m = re.search("Location\s*:\s*(.*)", self.header, re.I) if m is None: - self.fail("File not found") + self.fail(_("File not found")) download_url = m.group(1) self.logDebug("FREE URL2:" + download_url) @@ -79,7 +79,7 @@ class QuickshareCz(SimpleHoster): elif m.group(1) == '2': self.retry(60, 60, "No free slots available") else: - self.fail("Error %d" % m.group(1)) + self.fail(_("Error %d") % m.group(1)) # download file self.download(download_url) diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py index 0d032ef2f..8a730cf76 100644 --- a/module/plugins/hoster/RPNetBiz.py +++ b/module/plugins/hoster/RPNetBiz.py @@ -29,7 +29,7 @@ class RPNetBiz(Hoster): elif not self.account: # Check account self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") - self.fail("No rpnet account provided") + self.fail(_("No rpnet account provided")) else: (user, data) = self.account.selectAccount() @@ -71,11 +71,11 @@ class RPNetBiz(Hoster): my_try += 1 if my_try > max_tries: # We went over the limit! - self.fail("Waited for about 15 minutes for download to finish but failed") + self.fail(_("Waited for about 15 minutes for download to finish but failed")) if 'generated' in link_status: self.download(link_status['generated'], disposition=True) elif 'error' in link_status: self.fail(link_status['error']) else: - self.fail("Something went wrong, not supposed to enter here") + self.fail(_("Something went wrong, not supposed to enter here")) diff --git a/module/plugins/hoster/RapidfileshareNet.py b/module/plugins/hoster/RapidfileshareNet.py index f29e2b6a1..b5fb66407 100644 --- a/module/plugins/hoster/RapidfileshareNet.py +++ b/module/plugins/hoster/RapidfileshareNet.py @@ -25,7 +25,7 @@ class RapidfileshareNet(XFSPHoster): def handlePremium(self): - self.fail("Premium download not implemented") + self.fail(_("Premium download not implemented")) getInfo = create_getInfo(RapidfileshareNet) diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index f0acfd04e..8db84340b 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -67,7 +67,7 @@ class RapidgatorNet(SimpleHoster): status = json['response_status'] msg = json['response_details'] except BadHeader, e: - self.logError("API:%s" % cmd, e, "SID: %s" % self.sid) + self.logError("API: %s" % cmd, repr(e), "SID: %s" % self.sid) status = e.code msg = e @@ -138,7 +138,7 @@ class RapidgatorNet(SimpleHoster): else: self.correctCaptcha() else: - self.error("Download link") + self.error(_("Download link")) def getCaptcha(self): @@ -157,7 +157,7 @@ class RapidgatorNet(SimpleHoster): captcha_key = m.group(1) captcha = SolveMedia(self) else: - self.error("Captcha") + self.error(_("Captcha")) return captcha, captcha_key @@ -165,7 +165,7 @@ class RapidgatorNet(SimpleHoster): def checkFree(self): m = re.search(self.PREMIUM_ONLY_ERROR_PATTERN, self.html) if m: - self.fail("Premium account needed for download") + self.fail(_("Premium account needed for download")) else: m = re.search(self.WAIT_PATTERN, self.html) @@ -176,7 +176,7 @@ class RapidgatorNet(SimpleHoster): if m is None: return elif m.group(1) == "daily": - self.logWarning("You have reached your daily downloads limit for today") + self.logWarning(_("You have reached your daily downloads limit for today")) wait_time = secondsToMidnight(gmt=2) else: wait_time = 1 * 60 * 60 diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index b0462e82c..1b8967108 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -106,7 +106,7 @@ class RapidshareCom(Hoster): elif self.api_data['status'] == "3": self.tempOffline() else: - self.error("Unknown response code.") + self.error(_("Unknown response code")) def handleFree(self): @@ -134,7 +134,7 @@ class RapidshareCom(Hoster): def handlePremium(self): info = self.account.getAccountInfo(self.user, True) - self.logDebug("%s: Use Premium Account" % self.__name__) + self.logDebug("Use Premium Account") url = self.api_data['mirror'] self.download(url, get={"directstart": 1}) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index cf1f825ef..dd4101402 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -28,7 +28,7 @@ class RealdebridCom(Hoster): name = unquote(url.rsplit("/", 1)[1]) except IndexError: name = "Unknown_Filename..." - if not name or name.endswith(".."): # incomplete filename, append random stuff + if not name or name.endswith(".."): #: incomplete filename, append random stuff name += "%s.tmp" % randrange(100, 999) return name @@ -43,7 +43,7 @@ class RealdebridCom(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Real-debrid") - self.fail("No Real-debrid account provided") + self.fail(_("No Real-debrid account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) password = self.getPassword().splitlines() @@ -90,4 +90,4 @@ class RealdebridCom(Hoster): if check == "error": #usual this download can safely be retried - self.retry(wait_time=60, reason="An error occured while generating link.") + self.retry(wait_time=60, reason="An error occured while generating link") diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index 80465724d..67cb882d4 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -29,7 +29,7 @@ class RehostTo(Hoster): def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "rehost.to") - self.fail("No rehost.to account provided") + self.fail(_("No rehost.to account provided")) data = self.account.getAccountInfo(self.user) long_ses = data['long_ses'] diff --git a/module/plugins/hoster/RemixshareCom.py b/module/plugins/hoster/RemixshareCom.py index 38c55afc3..e294d4b87 100644 --- a/module/plugins/hoster/RemixshareCom.py +++ b/module/plugins/hoster/RemixshareCom.py @@ -42,10 +42,10 @@ class RemixshareCom(SimpleHoster): def handleFree(self): b = re.search(self.LINK_PATTERN, self.html) if not b: - self.error("Cannot parse download url") + self.error(_("Cannot parse download url")) c = re.search(self.TOKEN_PATTERN, self.html) if not c: - self.error("Cannot parse file token") + self.error(_("Cannot parse file token")) dl_url = b.group(1) + c.group(1) #Check if we have to wait diff --git a/module/plugins/hoster/RgHostNet.py b/module/plugins/hoster/RgHostNet.py index 48ea8ff8c..6a9f09fe4 100644 --- a/module/plugins/hoster/RgHostNet.py +++ b/module/plugins/hoster/RgHostNet.py @@ -25,7 +25,7 @@ class RgHostNet(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Unable to detect the direct link") + self.error(_("LINK_PATTERN not found")) download_link = m.group(1) self.download(download_link, disposition=True) diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 3179426fb..4e57b7a58 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -72,7 +72,7 @@ class RyushareCom(XFSPHoster): self.correctCaptcha() break else: - self.fail("You have entered 5 invalid captcha codes") + self.fail(_("You have entered 5 invalid captcha codes")) if "Click here to download" in self.html: return re.search(r'<a href="([^"]+)">Click here to download</a>', self.html).group(1) diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 62c6e4a70..0e3c74a6c 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -52,7 +52,7 @@ class SendspaceCom(SimpleHoster): self.logDebug(params) self.html = self.load(self.pyfile.url, post=params) else: - self.fail("Download link not found") + self.fail(_("Download link not found")) self.download(download_url) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 5441efce1..f27be7f9c 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -120,11 +120,11 @@ class ShareonlineBiz(Hoster): self.invalidCaptcha() else: self.invalidCaptcha() - self.fail("No valid captcha solution received") + self.fail(_("No valid captcha solution received")) download_url = response.decode("base64") if not download_url.startswith("http://"): - self.error("Wrong download url") + self.error(_("Wrong download url")) self.wait() self.download(download_url) @@ -181,9 +181,9 @@ class ShareonlineBiz(Hoster): self.logError(err, "Unknown error occurred") if err == "invalid": - self.fail(msg or "File not available") + self.fail(_("File not available")) elif err in ("freelimit", "size", "proxy"): - self.fail(msg or "Premium account needed") + self.fail(_("Premium account needed")) else: if err in 'server': self.setWait(600, False) @@ -193,4 +193,4 @@ class ShareonlineBiz(Hoster): self.setWait(300, True) self.wait() - self.retry(max_tries=25, reason=msg) + self.retry(max_tries=25, reason=err) diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index 7f2a95dfe..a4b0149d9 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -33,7 +33,7 @@ class ShareplaceCom(Hoster): wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) + self.logDebug("Waiting %d seconds." % wait_time) self.wait() @@ -68,7 +68,7 @@ class ShareplaceCom(Hoster): self.logDebug("URL: %s" % url) return url else: - self.error("Absolute filepath not found") + self.error(_("Absolute filepath not found")) def get_file_name(self): diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py index 965c1421a..f236fb01c 100644 --- a/module/plugins/hoster/SimplyPremiumCom.py +++ b/module/plugins/hoster/SimplyPremiumCom.py @@ -30,7 +30,7 @@ class SimplyPremiumCom(Hoster): new_url = pyfile.url elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "Simply-Premium.com") - self.fail("No Simply-Premium.com account provided") + self.fail(_("No Simply-Premium.com account provided")) else: self.logDebug("Old URL: %s" % pyfile.url) for i in xrange(5): @@ -39,7 +39,7 @@ class SimplyPremiumCom(Hoster): 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 '<valid>0</valid>' in page or ( @@ -49,13 +49,13 @@ class SimplyPremiumCom(Hoster): elif "NOTFOUND" in page: self.offline() elif "downloadlimit" in page: - self.logWarning("Reached maximum connctions") + self.logWarning(_("Reached maximum connctions")) self.retry(5, 60, "Reached maximum connctions") elif "trafficlimit" in page: - self.logWarning("Reached daily limit for this host") + self.logWarning(_("Reached daily limit for this host")) self.retry(1, secondsToMidnight(gmt=2), "Daily limit for this host reached") elif "hostererror" in page: - self.logWarning("Hoster temporarily unavailable, waiting 1 minute and retry") + self.logWarning(_("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] diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 66b1ff222..91072d7d2 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -25,7 +25,7 @@ class SimplydebridCom(Hoster): def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "simply-debrid.com") - self.fail("No simply-debrid.com account provided") + self.fail(_("No simply-debrid.com account provided")) self.logDebug("Old URL: %s" % pyfile.url) @@ -48,7 +48,7 @@ class SimplydebridCom(Hoster): if not re.match(self.__pattern__, new_url): page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) # +'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): - self.fail("Unable to unrestrict link") + self.fail(_("Unable to unrestrict link")) new_url = page self.setWait(5) diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index 9305a2142..1228e85e9 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -27,7 +27,7 @@ class SoundcloudCom(Hoster): if m: songId = m.group("ID") if len(songId) <= 0: - self.logError("Could not find song id") + self.logError(_("Could not find song id")) self.offline() else: m = re.search(r'"clientID":"(?P<CID>.*?)"', page) diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 98d74631f..7ae61ea47 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -38,14 +38,14 @@ class SpeedyshareCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) dl_link = urljoin("http://www.speedyshare.com", m.group(1)) self.download(dl_link, disposition=True) check = self.checkDownload({'html': re.compile("html")}) if check == "html": - self.error("Downloaded file is an html page") + self.error(_("Downloaded file is an html page")) getInfo = create_getInfo(SpeedyshareCom) diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index d4ebd7701..5f3971df3 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -51,7 +51,7 @@ class StreamCz(Hoster): m = re.search(self.CDN_PATTERN, self.html) if m is None: - self.fail("Parse error (CDN)") + self.error(_("CDN_PATTERN not found")) cdn = m.groupdict() self.logDebug(cdn) for cdnkey in ("cdnHD", "cdnHQ", "cdnLQ"): @@ -59,13 +59,13 @@ class StreamCz(Hoster): cdnid = cdn[cdnkey] break else: - self.fail("Stream URL not found") + self.fail(_("Stream URL not found")) m = re.search(self.FILE_NAME_PATTERN, self.html) if m is None: - self.fail("Parse error (NAME)") + self.error(_("FILE_NAME_PATTERN not found")) pyfile.name = "%s-%s.%s.mp4" % (m.group(2), m.group(1), cdnkey[-2:]) download_url = "http://cdn-dispatcher.stream.cz/?id=" + cdnid - self.logInfo("STREAM (%s): %s" % (cdnkey[-2:], download_url)) + self.logInfo(_("STREAM: %s") % cdnkey[-2:], download_url) self.download(download_url) diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 11a402bfd..24b0ebfae 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -55,9 +55,9 @@ class StreamcloudEu(XFSPHoster): else: if self.errmsg and 'captcha' in self.errmsg: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) else: - self.fail("Download link not found") + self.fail(_("Download link not found")) return m.group(1) @@ -78,7 +78,7 @@ class StreamcloudEu(XFSPHoster): if self.errmsg: self.retry() else: - self.error("Form not found") + self.error(_("Form not found")) self.logDebug(self.HOSTER_NAME, inputs) @@ -87,7 +87,7 @@ class StreamcloudEu(XFSPHoster): if self.passwords: inputs['password'] = self.passwords.pop(0) else: - self.fail("No or invalid passport") + self.fail(_("No or invalid passport")) if not self.premium: m = re.search(self.WAIT_PATTERN, self.html) @@ -122,7 +122,7 @@ class StreamcloudEu(XFSPHoster): self.errmsg = None else: - self.error("FORM: %s" % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + self.error(_("FORM: %s") % (inputs['op'] if 'op' in inputs else _("UNKNOWN"))) getInfo = create_getInfo(StreamcloudEu) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index a12fc3874..4e26f74b1 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -67,7 +67,7 @@ class TurbobitNet(SimpleHoster): action, inputs = self.parseHtmlForm("action='#'") if not inputs: - self.error("Captcha form not found") + self.error(_("Captcha form not found")) self.logDebug(inputs) if inputs['captcha_type'] == 'recaptcha': @@ -76,7 +76,7 @@ class TurbobitNet(SimpleHoster): else: m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error("captcha") + self.error(_("captcha")) captcha_url = m.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_url) @@ -89,7 +89,7 @@ class TurbobitNet(SimpleHoster): self.correctCaptcha() break else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) def getRtUpdate(self): @@ -109,7 +109,7 @@ class TurbobitNet(SimpleHoster): self.setStorage("timestamp", timestamp()) self.setStorage("version", self.__version__) else: - self.logError("Unable to download, wait for update...") + self.logError(_("Unable to download, wait for update...")) self.tempOffline() return rtUpdate @@ -165,7 +165,7 @@ class TurbobitNet(SimpleHoster): def downloadFile(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) self.url = "http://turbobit.net" + m.group('url') self.download(self.url) diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 1c944756b..c77e4f829 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -31,7 +31,7 @@ class TwoSharedCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link") + self.error(_("Download link")) link = m.group(1) self.download(link) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 5725d84fc..43398772c 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -50,11 +50,11 @@ class UlozTo(SimpleHoster): self.html = self.load(pyfile.url, decode=True, cookies=True) if re.search(self.ADULT_PATTERN, self.html): - self.logInfo("Adult content confirmation needed. Proceeding..") + self.logInfo(_("Adult content confirmation needed")) m = re.search(self.TOKEN_PATTERN, self.html) if m is None: - self.error("TOKEN") + self.error(_("TOKEN_PATTERN not found")) token = m.group(1) self.html = self.load(pyfile.url, get={"do": "askAgeForm-submit"}, @@ -64,11 +64,11 @@ class UlozTo(SimpleHoster): while self.PASSWD_PATTERN in self.html: if passwords: password = passwords.pop(0) - self.logInfo("Password protected link, trying " + password) + self.logInfo(_("Password protected link, trying ") + password) self.html = self.load(pyfile.url, get={"do": "passwordProtectedForm-submit"}, post={"password": password, "password_send": 'Send'}, cookies=True) else: - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) if re.search(self.VIPLINK_PATTERN, self.html): self.html = self.load(pyfile.url, get={"disclaimer": "1"}) @@ -86,7 +86,7 @@ class UlozTo(SimpleHoster): def handleFree(self): action, inputs = self.parseHtmlForm('id="frm-downloadDialog-freeDownloadForm"') if not action or not inputs: - self.error("Free download form not found") + self.error(_("Free download form not found")) self.logDebug("inputs.keys = " + str(inputs.keys())) # get and decrypt captcha @@ -112,7 +112,7 @@ class UlozTo(SimpleHoster): inputs.update({'timestamp': data['timestamp'], 'salt': data['salt'], 'hash': data['hash'], 'captcha_value': captcha_value}) else: - self.error("CAPTCHA form changed") + self.error(_("CAPTCHA form changed")) self.multiDL = True self.download("http://www.ulozto.net" + action, post=inputs, cookies=True, disposition=True) @@ -125,7 +125,7 @@ class UlozTo(SimpleHoster): def findDownloadURL(self, premium=False): - msg = "%s link" % ("Premium" if premium else "Free") + msg = _("%s link" % ("Premium" if premium else "Free")) m = re.search(self.PREMIUM_URL_PATTERN if premium else self.FREE_URL_PATTERN, self.html) if m is None: self.error(msg) @@ -151,14 +151,14 @@ class UlozTo(SimpleHoster): elif check == "offline": self.offline() elif check == "passwd": - self.fail("Wrong password") + self.fail(_("Wrong password")) elif check == "server_error": - self.logError("Server error, try downloading later") + self.logError(_("Server error, try downloading later")) self.multiDL = False self.wait(1 * 60 * 60, True) self.retry() elif check == "not_found": - self.fail("Server error - file not downloadable") + self.fail(_("Server error - file not downloadable")) getInfo = create_getInfo(UlozTo) diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index 54620709a..4bc19f07e 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -42,19 +42,19 @@ class UloziskoSk(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("URL") + self.error(_("LINK_PATTERN not found")) parsed_url = 'http://www.ulozisko.sk' + m.group(1) m = re.search(self.ID_PATTERN, self.html) if m is None: - self.error("ID") + self.error(_("ID_PATTERN not found")) id = m.group(1) self.logDebug("URL:" + parsed_url + ' ID:' + id) m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error("CAPTCHA") + self.error(_("CAPTCHA_PATTERN not found")) captcha_url = 'http://www.ulozisko.sk' + m.group(1) captcha = self.decryptCaptcha(captcha_url, cookies=True) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 93c7af529..eb7ef4c87 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -62,7 +62,7 @@ class UnibytesCom(SimpleHoster): elif last_step in ("captcha", "last"): post_data['captcha'] = self.decryptCaptcha(domain + '/captcha.jpg') else: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) self.req.http.c.setopt(FOLLOWLOCATION, 1) self.download(url) diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index fd53e0125..2de52075c 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -40,7 +40,7 @@ class UnrestrictLi(Hoster): 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 _i in xrange(5): @@ -50,7 +50,7 @@ class UnrestrictLi(Hoster): 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 " @@ -60,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] @@ -81,7 +81,7 @@ 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): diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 7ec3716e7..e6ec0eb12 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -128,7 +128,7 @@ class UploadedTo(Hoster): # TODO: fallback to parse from site, because api sometimes delivers wrong status codes if not api: - self.logWarning("No response for API call") + self.logWarning(_("No response for API call")) self.html = unicode(self.load(pyfile.url, decode=False), 'iso-8859-1') name, size, status, self.fileID = parseFileInfo(self) @@ -138,7 +138,7 @@ class UploadedTo(Hoster): elif status == 2: pyfile.name, pyfile.size = name, size else: - self.fail("Parse error - file info") + self.error(_("file info")) elif api == 'Access denied': self.fail(_("API key invalid")) @@ -165,7 +165,7 @@ class UploadedTo(Hoster): self.logDebug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name": self.__name__, "left": info['trafficleft'] / 1024 / 1024}) if int(self.data[1]) / 1024 > info['trafficleft']: - self.logInfo(_("%s: Not enough traffic left" % self.__name__)) + self.logInfo(_("Not enough traffic left")) self.account.empty(self.user) self.resetAccount() self.fail(_("Traffic exceeded")) @@ -180,7 +180,7 @@ class UploadedTo(Hoster): self.html = self.load("http://uploaded.net/file/%s" % self.fileID) m = re.search(r'<div class="tfree".*\s*<form method="post" action="(.*?)"', self.html) if m is None: - self.fail("Download URL not m. Try to enable direct downloads.") + self.fail(_("Download URL not m. Try to enable direct downloads")) url = m.group(1) print "Premium URL: " + url self.download(url, post={}) @@ -190,12 +190,12 @@ class UploadedTo(Hoster): self.html = self.load(self.pyfile.url, decode=True) if 'var free_enabled = false;' in self.html: - self.logError("Free-download capacities exhausted.") + self.logError(_("Free-download capacities exhausted")) self.retry(max_tries=24, wait_time=5 * 60) m = re.search(r"Current waiting period: <span>(\d+)</span> seconds", self.html) if m is None: - self.fail("File not downloadable for free users") + self.fail(_("File not downloadable for free users")) self.setWait(int(m.group(1))) self.html = self.load("http://uploaded.net/js/download.js", decode=True) @@ -214,13 +214,13 @@ class UploadedTo(Hoster): self.logDebug("Result: %s" % result) if "limit-size" in result: - self.fail("File too big for free download") + self.fail(_("File too big for free download")) elif "limit-slot" in result: # Temporary restriction so just wait a bit self.setWait(30 * 60, True) self.wait() self.retry() elif "limit-parallel" in result: - self.fail("Cannot download in parallel") + self.fail(_("Cannot download in parallel")) elif "limit-dl" in result or self.DL_LIMIT_PATTERN in result: # limit-dl self.setWait(3 * 60 * 60, True) self.wait() @@ -232,10 +232,10 @@ class UploadedTo(Hoster): downloadURL = re.search("url:'([^']+)", result).group(1) break else: - self.error("Unknown error '%s'" % result) + self.error(_("Unknown error: %s") % result) if not downloadURL: - self.fail("No Download url retrieved/all captcha attempts failed") + self.fail(_("No Download url retrieved/all captcha attempts failed")) self.download(downloadURL, disposition=True) check = self.checkDownload({"limit-dl": self.DL_LIMIT_PATTERN}) diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index b9eac42a7..cf2cebde8 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -40,7 +40,7 @@ class UploadheroCom(SimpleHoster): m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error("Captcha URL") + self.error(_("CAPTCHA_PATTERN not found")) captcha_url = "http://uploadhero.co" + m.group(1) for _i in xrange(5): @@ -54,7 +54,7 @@ class UploadheroCom(SimpleHoster): else: self.invalidCaptcha() else: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) self.download(download_url) diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 71a1eb4a0..656543a83 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -56,7 +56,7 @@ class UploadingCom(SimpleHoster): url = url.group(1).replace("\\/", "/") self.download(url) - raise Exception("Plugin defect.") + raise Exception("Plugin defect") def handleFree(self): @@ -73,30 +73,30 @@ class UploadingCom(SimpleHoster): response = json_loads(self.load(ajax_url, post={'action': 'second_page', 'code': self.file_info['ID']})) if 'answer' in response and 'wait_time' in response['answer']: wait_time = int(response['answer']['wait_time']) - self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) + self.logInfo(_("Waiting %d seconds") % wait_time) self.wait(wait_time) else: - self.error("AJAX/WAIT") + self.error(_("No AJAX/WAIT")) response = json_loads( self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'})) if 'answer' in response and 'link' in response['answer']: url = response['answer']['link'] else: - self.error("AJAX/URL") + self.error(_("No AJAX/URL")) self.html = self.load(url) m = re.search(r'<form id="file_form" action="(.*?)"', self.html) if m: url = m.group(1) else: - self.error("URL") + self.error(_("No URL")) self.download(url) check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")}) if check == "html": - self.logWarning("Redirected to a HTML page, wait 10 minutes and retry") + self.logWarning(_("Redirected to a HTML page, wait 10 minutes and retry")) self.wait(10 * 60, True) diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 3695f0c6d..1ee123357 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -30,7 +30,7 @@ class UpstoreNet(SimpleHoster): # STAGE 1: get link to continue m = re.search(self.CHASH_PATTERN, self.html) if m is None: - self.error("Unable to detect hash") + self.error(_("CHASH_PATTERN not found")) chash = m.group(1) self.logDebug("Read hash " + chash) # continue to stage2 @@ -45,7 +45,7 @@ class UpstoreNet(SimpleHoster): for i in xrange(5): m = re.search(self.WAIT_PATTERN, self.html) if m is None: - self.error("Wait pattern not found") + self.error(_("Wait pattern not found")) wait_time = m.group(1) # then, do the waiting @@ -64,7 +64,7 @@ class UpstoreNet(SimpleHoster): break if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) direct = m.group(1) self.download(direct, disposition=True) diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 0283674d1..ad99793e4 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -19,10 +19,6 @@ class VeehdCom(Hoster): __authors__ = [("cat", "cat@pyload")] - def _debug(self, msg): - self.logDebug("[%s] %s" % (self.__name__, msg)) - - def setup(self): self.multiDL = True self.req.canContinue = True @@ -39,7 +35,7 @@ class VeehdCom(Hoster): def download_html(self): url = self.pyfile.url - self._debug("Requesting page: %s" % (repr(url),)) + self.logDebug("Requesting page: %s" % repr(url)) self.html = self.load(url) @@ -58,7 +54,7 @@ class VeehdCom(Hoster): m = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html) if m is None: - self.error("Video title not found") + self.error(_("Video title not found")) name = m.group(1) @@ -80,6 +76,6 @@ class VeehdCom(Hoster): m = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"', self.html) if m is None: - self.error("Embedded video url not found") + self.error(_("Embedded video url not found")) return m.group(1) diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 8863750e0..4533c4f80 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -44,9 +44,9 @@ class VeohCom(SimpleHoster): self.download(link) return else: - self.logInfo("No %s quality video found" % q.upper()) + self.logInfo(_("No %s quality video found") % q.upper()) else: - self.fail("No video found!") + self.fail(_("No video found!")) getInfo = create_getInfo(VeohCom) diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 8de7fad88..08377b98f 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -51,7 +51,7 @@ class VimeoCom(SimpleHoster): self.download(link[q]) return else: - self.logInfo("Original file not downloadable") + self.logInfo(_("Original file not downloadable")) quality = self.getConfig("quality") if quality == "Highest": @@ -66,9 +66,9 @@ class VimeoCom(SimpleHoster): self.download(link[q]) return else: - self.logInfo("No %s quality video found" % q.upper()) + self.logInfo(_("No %s quality video found") % q.upper()) else: - self.fail("No video found!") + self.fail(_("No video found!")) getInfo = create_getInfo(VimeoCom) diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 11f7e97b0..942205d0a 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -38,7 +38,7 @@ class WebshareCz(SimpleHoster): self.logDebug("API data: " + api_data) m = re.search('<link>(.+)</link>', api_data) if m is None: - self.error("Unable to detect direct link") + self.error(_("Unable to detect direct link")) direct = m.group(1) self.logDebug("Direct link: " + direct) self.download(direct, disposition=True) diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py index 28d4f4716..41d114946 100644 --- a/module/plugins/hoster/WrzucTo.py +++ b/module/plugins/hoster/WrzucTo.py @@ -32,7 +32,7 @@ class WrzucTo(SimpleHoster): def handleFree(self): data = dict(re.findall(r'(md5|file): "(.*?)"', self.html)) if len(data) != 2: - self.error("File ID") + self.error(_("No file ID")) self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = self.pyfile.url @@ -43,7 +43,7 @@ class WrzucTo(SimpleHoster): data.update(re.findall(r'"(download_link|server_id)":"(.*?)"', self.html)) if len(data) != 4: - self.error("Download URL") + self.error(_("No download URL")) download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) self.download(download_url) diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py index 9b97b5e94..1c0a094f3 100644 --- a/module/plugins/hoster/XHamsterCom.py +++ b/module/plugins/hoster/XHamsterCom.py @@ -57,7 +57,7 @@ class XHamsterCom(Hoster): json_flashvar = flashvar_pattern.search(self.html) if not json_flashvar: - self.fail("Parse error (flashvars)") + self.error(_("flashvar not found")) j = clean_json(json_flashvar.group(1)) flashvars = json_loads(j) @@ -65,19 +65,19 @@ class XHamsterCom(Hoster): if flashvars['srv']: srv_url = flashvars['srv'] + '/' else: - self.fail("Parse error (srv_url)") + self.error(_("srv_url not found")) if flashvars['url_mode']: url_mode = flashvars['url_mode'] else: - self.fail("Parse error (url_mode)") + self.error(_("url_mode not found")) if self.desired_fmt == ".mp4": file_url = re.search(r"<a href=\"" + srv_url + "(.+?)\"", self.html) if file_url is None: - self.fail("Parse error (file_url)") + self.error(_("file_url not found")) file_url = file_url.group(1) long_url = srv_url + file_url self.logDebug("long_url = " + long_url) @@ -85,7 +85,7 @@ class XHamsterCom(Hoster): if flashvars['file']: file_url = unquote(flashvars['file']) else: - self.fail("Parse error (file_url)") + self.error(_("file_url not found")) if url_mode == '3': long_url = file_url diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 35725ce32..c3fae80f1 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -42,7 +42,7 @@ class Xdcc(Hoster): for _i in xrange(0, 3): try: nmn = self.doDownload(pyfile.url) - self.logDebug("%s: Download of %s finished." % (self.__name__, nmn)) + self.logDebug("Download of %s finished." % nmn) return except socket.error, e: if hasattr(e, "errno"): @@ -51,14 +51,14 @@ class Xdcc(Hoster): errno = e.args[0] if errno == 10054: - self.logDebug("XDCC: Server blocked our ip, retry in 5 min") + self.logDebug("Server blocked our ip, retry in 5 min") self.setWait(300) self.wait() continue - self.fail("Failed due to socket errors. Code: %d" % errno) + self.fail(_("Failed due to socket errors. Code: %d") % errno) - self.fail("Server blocked our ip, retry again later manually") + self.fail(_("Server blocked our ip, retry again later manually")) def doDownload(self, url): @@ -80,7 +80,7 @@ class Xdcc(Hoster): elif ln == 1: host, port = temp[0], 6667 else: - self.fail("Invalid hostname for IRC Server (%s)" % server) + self.fail(_("Invalid hostname for IRC Server: %s") % server) ####################### # CONNECT TO IRC AND IDLE FOR REAL LINK @@ -117,7 +117,7 @@ class Xdcc(Hoster): if (dl_time + self.timeout) < time.time(): # todo: add in config sock.send("QUIT :byebye\r\n") sock.close() - self.fail("XDCC Bot did not answer") + self.fail(_("XDCC Bot did not answer")) fdset = select([sock], [], [], 0) if sock not in fdset[0]: @@ -137,7 +137,7 @@ class Xdcc(Hoster): sock.send("PONG %s\r\n" % first[1]) if first[0] == "ERROR": - self.fail("IRC-Error: %s" % line) + self.fail(_("IRC-Error: %s") % line) msg = line.split(None, 3) if len(msg) != 4: @@ -152,10 +152,10 @@ class Xdcc(Hoster): if nick == msg['target'][0:len(nick)] and "PRIVMSG" == msg['action']: if msg['text'] == "\x01VERSION\x01": - self.logDebug("XDCC: Sending CTCP VERSION.") + self.logDebug("Sending CTCP VERSION") sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) elif msg['text'] == "\x01TIME\x01": - self.logDebug("Sending CTCP TIME.") + self.logDebug("Sending CTCP TIME") sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) elif msg['text'] == "\x01LAG\x01": pass # don't know how to answer @@ -172,7 +172,7 @@ class Xdcc(Hoster): retry = time.time() + 300 if "you must be on a known channel to request a pack" in msg['text']: - self.fail("Wrong channel") + self.fail(_("Wrong channel")) m = re.match('\x01DCC SEND (.*?) (\d+) (\d+)(?: (\d+))?\x01', msg['text']) if m: @@ -191,12 +191,12 @@ class Xdcc(Hoster): download_folder = self.config['general']['download_folder'] filename = save_join(download_folder, packname) - self.logInfo("XDCC: Downloading %s from %s:%d" % (packname, ip, port)) + self.logInfo(_("Downloading %s from %s:%d") % (packname, ip, port)) self.pyfile.setStatus("downloading") newname = self.req.download(ip, port, filename, sock, self.pyfile.setProgress) if newname and newname != filename: - self.logInfo("%(name)s saved as %(newname)s" % {"name": self.pyfile.name, "newname": newname}) + self.logInfo(_("%(name)s saved as %(newname)s") % {"name": self.pyfile.name, "newname": newname}) filename = newname # kill IRC socket diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index 520b5562d..94995c9d2 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -28,7 +28,7 @@ class YibaishiwuCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("AJAX URL") + self.error(_("LINK_PATTERN not found")) url = m.group(1) self.logDebug(('FREEUSER' if m.group(2) == 'download' else 'GUEST') + ' URL', url) @@ -49,7 +49,7 @@ class YibaishiwuCom(SimpleHoster): except: continue else: - self.fail("No working link found") + self.fail(_("No working link found")) getInfo = create_getInfo(YibaishiwuCom) diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 38cae4deb..401f3174a 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -34,7 +34,7 @@ class YourfilesTo(Hoster): wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) + self.logDebug("Waiting %d seconds." % wait_time) self.wait() @@ -66,7 +66,7 @@ class YourfilesTo(Hoster): url = unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) return url else: - self.error("Absolute filepath not found") + self.error(_("Absolute filepath not found")) def get_file_name(self): diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index f16e9ae43..7198b6a82 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -107,7 +107,7 @@ class YoutubeCom(Hoster): "480p": 35, "720p": 22, "1080p": 37, "3072p": 38} desired_fmt = self.getConfig("fmt") if desired_fmt and desired_fmt not in self.formats: - self.logWarning("FMT %d unknown - using default." % desired_fmt) + self.logWarning(_("FMT %d unknown, using default") % desired_fmt) desired_fmt = 0 if not desired_fmt: desired_fmt = quality.get(self.getConfig("quality"), 18) @@ -124,7 +124,7 @@ class YoutubeCom(Hoster): allowed = lambda x: self.getConfig(self.formats[x][0]) streams = [x for x in streams if x[0] in self.formats and allowed(x[0])] if not streams: - self.fail("No available stream meets your preferences") + self.fail(_("No available stream meets your preferences")) fmt_dict = dict([x for x in streams if self.formats[x[0]][4] == use3d] or streams) self.logDebug("DESIRED STREAM: ITAG:%d (%s) %sfound, %sallowed" % diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index 274dd474a..479209b4b 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -46,7 +46,7 @@ class ZDF(Hoster): status = xml.findtext("./status/statuscode") if status != "ok": - self.fail("Error retrieving manifest.") + self.fail(_("Error retrieving manifest")) video = xml.find("video") title = video.findtext("information/title") diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index 9394a5c93..b5e92f762 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -23,19 +23,19 @@ class ZeveraCom(Hoster): def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "zevera.com") - self.fail("No zevera.com account provided") + self.fail(_("No zevera.com account provided")) self.logDebug("Old URL: %s" % pyfile.url) if self.account.getAPIData(self.req, cmd="checklink", olink=pyfile.url) != "Alive": - self.fail("Offline or not downloadable - contact Zevera support") + self.fail(_("Offline or not downloadable - contact Zevera support")) header = self.account.getAPIData(self.req, just_header=True, cmd="generatedownloaddirect", olink=pyfile.url) if not "location" in header: - self.fail("Unable to initialize download - contact Zevera support") + self.fail(_("Unable to initialize download")) self.download(header['location'], disposition=True) check = self.checkDownload({"error": 'action="ErrorDownload.aspx'}) if check == "error": - self.fail("Error response received - contact Zevera support") + self.fail(_("Error response received - contact Zevera support")) diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index b73113040..29b013b51 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -49,7 +49,7 @@ class ZippyshareCom(SimpleHoster): c = lambda a,b: a + b if not m: - self.error("Unable to calculate checksum") + self.error(_("Unable to calculate checksum")) a = map(lambda x: int(x), m[0]) b = map(lambda x: int(x), m[1]) |