From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/AccountManager.py | 2 +- module/plugins/Container.py | 2 +- module/plugins/Plugin.py | 12 +++++----- module/plugins/PluginManager.py | 2 +- module/plugins/accounts/DebridItaliaCom.py | 2 +- module/plugins/accounts/FilecloudIo.py | 2 +- module/plugins/accounts/FilerNet.py | 2 +- module/plugins/accounts/HellshareCz.py | 2 +- module/plugins/accounts/LetitbitNet.py | 2 +- module/plugins/accounts/MyfastfileCom.py | 4 ++-- module/plugins/accounts/OboomCom.py | 2 +- module/plugins/accounts/RapidshareCom.py | 2 +- module/plugins/accounts/RealdebridCom.py | 2 +- module/plugins/accounts/UnrestrictLi.py | 2 +- module/plugins/accounts/UploadheroCom.py | 2 +- module/plugins/container/LinkList.py | 2 +- module/plugins/container/RSDF.py | 2 +- module/plugins/crypter/ChipDe.py | 2 +- module/plugins/crypter/CzshareComFolder.py | 4 ++-- module/plugins/crypter/DailymotionBatch.py | 2 +- module/plugins/crypter/DataHuFolder.py | 6 ++--- module/plugins/crypter/DlProtectCom.py | 2 +- module/plugins/crypter/DuckCryptInfo.py | 6 ++--- module/plugins/crypter/EmbeduploadCom.py | 2 +- module/plugins/crypter/FileserveComFolder.py | 4 ++-- module/plugins/crypter/FreetexthostCom.py | 2 +- module/plugins/crypter/GooGl.py | 2 +- module/plugins/crypter/HoerbuchIn.py | 2 +- module/plugins/crypter/LetitbitNetFolder.py | 4 ++-- module/plugins/crypter/LinkSaveIn.py | 6 ++--- module/plugins/crypter/LinkdecrypterCom.py | 10 ++++---- module/plugins/crypter/LixIn.py | 6 ++--- module/plugins/crypter/MediafireComFolder.py | 2 +- module/plugins/crypter/MultiloadCz.py | 2 +- module/plugins/crypter/NCryptIn.py | 6 ++--- module/plugins/crypter/NetfolderIn.py | 2 +- module/plugins/crypter/QuickshareCzFolder.py | 4 ++-- module/plugins/crypter/RelinkUs.py | 4 ++-- module/plugins/crypter/SafelinkingNet.py | 6 ++--- module/plugins/crypter/SexuriaCom.py | 2 +- module/plugins/crypter/ShareLinksBiz.py | 4 ++-- module/plugins/crypter/UlozToFolder.py | 8 +++---- module/plugins/crypter/UploadedToFolder.py | 2 +- module/plugins/crypter/XupPl.py | 2 +- module/plugins/crypter/YoutubeBatch.py | 2 +- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/Captcha9kw.py | 8 +++---- module/plugins/hooks/Checksum.py | 6 ++--- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExtractArchive.py | 12 +++++----- module/plugins/hooks/IRCInterface.py | 6 ++--- module/plugins/hooks/PremiumizeMe.py | 2 +- module/plugins/hooks/UpdateManager.py | 6 ++--- module/plugins/hoster/AlldebridCom.py | 6 ++--- module/plugins/hoster/BasePlugin.py | 2 +- module/plugins/hoster/BayfilesCom.py | 8 +++---- module/plugins/hoster/BezvadataCz.py | 10 ++++---- module/plugins/hoster/BitshareCom.py | 2 +- module/plugins/hoster/CatShareNet.py | 2 +- module/plugins/hoster/CrockoCom.py | 6 ++--- module/plugins/hoster/CzshareCom.py | 20 ++++++++-------- module/plugins/hoster/DailymotionCom.py | 2 +- module/plugins/hoster/DataHu.py | 2 +- module/plugins/hoster/DataportCz.py | 6 ++--- module/plugins/hoster/DateiTo.py | 4 ++-- module/plugins/hoster/DebridItaliaCom.py | 4 ++-- module/plugins/hoster/DepositfilesCom.py | 16 ++++++------- module/plugins/hoster/DevhostSt.py | 4 ++-- module/plugins/hoster/DlFreeFr.py | 6 ++--- module/plugins/hoster/DropboxCom.py | 2 +- module/plugins/hoster/EdiskCz.py | 4 ++-- module/plugins/hoster/EuroshareEu.py | 2 +- module/plugins/hoster/ExtabitCom.py | 12 +++++----- module/plugins/hoster/FastixRu.py | 6 ++--- module/plugins/hoster/FastshareCz.py | 6 ++--- module/plugins/hoster/File4safeCom.py | 2 +- module/plugins/hoster/FileSharkPl.py | 6 ++--- module/plugins/hoster/FilecloudIo.py | 12 +++++----- module/plugins/hoster/FilefactoryCom.py | 8 +++---- module/plugins/hoster/FilepostCom.py | 15 ++++++------ module/plugins/hoster/FilepupNet.py | 4 ++-- module/plugins/hoster/FilerNet.py | 8 +++---- module/plugins/hoster/FileserveCom.py | 18 +++++++-------- module/plugins/hoster/FlyFilesNet.py | 2 +- module/plugins/hoster/FourSharedCom.py | 4 ++-- module/plugins/hoster/FreakshareCom.py | 4 ++-- module/plugins/hoster/FreeWayMe.py | 2 +- module/plugins/hoster/FshareVn.py | 12 +++++----- module/plugins/hoster/Ftp.py | 4 ++-- module/plugins/hoster/GamefrontCom.py | 2 +- module/plugins/hoster/GigapetaCom.py | 2 +- module/plugins/hoster/HellshareCz.py | 6 ++--- module/plugins/hoster/IfileIt.py | 4 ++-- module/plugins/hoster/IfolderRu.py | 2 +- module/plugins/hoster/Keep2shareCC.py | 4 ++-- module/plugins/hoster/KingfilesNet.py | 6 ++--- module/plugins/hoster/LetitbitNet.py | 10 ++++---- module/plugins/hoster/LinksnappyCom.py | 9 ++++---- module/plugins/hoster/LoadTo.py | 4 ++-- module/plugins/hoster/LuckyShareNet.py | 6 ++--- module/plugins/hoster/MediafireCom.py | 6 ++--- module/plugins/hoster/MegaDebridEu.py | 8 +++---- module/plugins/hoster/MegaRapidCz.py | 4 ++-- module/plugins/hoster/MegasharesCom.py | 14 ++++++------ module/plugins/hoster/MultishareCz.py | 8 +++---- module/plugins/hoster/MyfastfileCom.py | 4 ++-- module/plugins/hoster/NarodRu.py | 6 ++--- module/plugins/hoster/NetloadIn.py | 34 ++++++++++++++-------------- module/plugins/hoster/NowDownloadEu.py | 2 +- module/plugins/hoster/NowVideoAt.py | 2 +- module/plugins/hoster/OboomCom.py | 10 ++++---- module/plugins/hoster/OneFichierCom.py | 6 ++--- module/plugins/hoster/OverLoadMe.py | 4 ++-- module/plugins/hoster/PremiumTo.py | 6 ++--- module/plugins/hoster/PremiumizeMe.py | 4 ++-- module/plugins/hoster/PromptfileCom.py | 4 ++-- module/plugins/hoster/QuickshareCz.py | 10 ++++---- module/plugins/hoster/RPNetBiz.py | 6 ++--- module/plugins/hoster/RapidfileshareNet.py | 2 +- module/plugins/hoster/RapidgatorNet.py | 10 ++++---- module/plugins/hoster/RapidshareCom.py | 4 ++-- module/plugins/hoster/RealdebridCom.py | 6 ++--- module/plugins/hoster/RehostTo.py | 2 +- module/plugins/hoster/RemixshareCom.py | 4 ++-- module/plugins/hoster/RgHostNet.py | 2 +- module/plugins/hoster/RyushareCom.py | 2 +- module/plugins/hoster/SendspaceCom.py | 2 +- module/plugins/hoster/ShareonlineBiz.py | 10 ++++---- module/plugins/hoster/ShareplaceCom.py | 4 ++-- module/plugins/hoster/SimplyPremiumCom.py | 10 ++++---- module/plugins/hoster/SimplydebridCom.py | 4 ++-- module/plugins/hoster/SoundcloudCom.py | 2 +- module/plugins/hoster/SpeedyshareCom.py | 4 ++-- module/plugins/hoster/StreamCz.py | 8 +++---- module/plugins/hoster/StreamcloudEu.py | 10 ++++---- module/plugins/hoster/TurbobitNet.py | 10 ++++---- module/plugins/hoster/TwoSharedCom.py | 2 +- module/plugins/hoster/UlozTo.py | 20 ++++++++-------- module/plugins/hoster/UloziskoSk.py | 6 ++--- module/plugins/hoster/UnibytesCom.py | 2 +- module/plugins/hoster/UnrestrictLi.py | 12 +++++----- module/plugins/hoster/UploadedTo.py | 20 ++++++++-------- module/plugins/hoster/UploadheroCom.py | 4 ++-- module/plugins/hoster/UploadingCom.py | 12 +++++----- module/plugins/hoster/UpstoreNet.py | 6 ++--- module/plugins/hoster/VeehdCom.py | 10 +++----- module/plugins/hoster/VeohCom.py | 4 ++-- module/plugins/hoster/VimeoCom.py | 6 ++--- module/plugins/hoster/WebshareCz.py | 2 +- module/plugins/hoster/WrzucTo.py | 4 ++-- module/plugins/hoster/XHamsterCom.py | 10 ++++---- module/plugins/hoster/Xdcc.py | 24 ++++++++++---------- module/plugins/hoster/YibaishiwuCom.py | 4 ++-- module/plugins/hoster/YourfilesTo.py | 4 ++-- module/plugins/hoster/YoutubeCom.py | 4 ++-- module/plugins/hoster/ZDF.py | 2 +- module/plugins/hoster/ZeveraCom.py | 8 +++---- module/plugins/hoster/ZippyshareCom.py | 2 +- module/plugins/internal/CaptchaService.py | 12 +++++----- module/plugins/internal/SimpleCrypter.py | 6 ++--- module/plugins/internal/SimpleHoster.py | 12 +++++----- module/plugins/internal/XFSPHoster.py | 26 ++++++++++----------- 162 files changed, 469 insertions(+), 473 deletions(-) diff --git a/module/plugins/AccountManager.py b/module/plugins/AccountManager.py index b039b5827..d9888ec8b 100644 --- a/module/plugins/AccountManager.py +++ b/module/plugins/AccountManager.py @@ -74,7 +74,7 @@ class AccountManager(): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() - self.core.log.warning(_("Account settings deleted, due to new config format.")) + self.core.log.warning(_("Account settings deleted, due to new config format")) return plugin = "" diff --git a/module/plugins/Container.py b/module/plugins/Container.py index f5a0fac14..1d93a4f4a 100644 --- a/module/plugins/Container.py +++ b/module/plugins/Container.py @@ -53,7 +53,7 @@ class Container(Crypter): if exists(save_join(pypath, self.pyfile.url)): self.pyfile.url = save_join(pypath, self.pyfile.url) else: - self.fail(_("File not exists.")) + self.fail(_("File not exists")) def deleteTmp(self): diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index efb20ad59..cc2fc794e 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -340,7 +340,7 @@ class Plugin(Base): :param reason: reason for retrying, will be passed to fail if max_tries reached """ if 0 < max_tries <= self.retries: - self.error(reason or "Max retries reached", "retry") + self.error(reason or _("Max retries reached"), "retry") self.wantReconnect = False self.setWait(wait_time) @@ -351,13 +351,13 @@ class Plugin(Base): def invalidCaptcha(self): - self.logError("Invalid captcha") + self.logError(_("Invalid captcha")) if self.cTask: self.cTask.invalid() def correctCaptcha(self): - self.logInfo("Correct captcha") + self.logInfo(_("Correct captcha")) if self.cTask: self.cTask.correct() @@ -419,7 +419,7 @@ class Plugin(Base): elif task.error: self.fail(task.error) elif not task.result: - self.fail(_("No captcha result obtained in appropiate time by any of the plugins.")) + self.fail(_("No captcha result obtained in appropiate time by any of the plugins")) result = task.result self.logDebug("Received captcha result: %s" % str(result)) @@ -548,7 +548,7 @@ class Plugin(Base): self.pyfile.size = self.req.size if disposition and newname and newname != name: #triple check, just to be sure - self.logInfo("%(name)s saved as %(newname)s" % {"name": name, "newname": newname}) + self.logInfo(_("%(name)s saved as %(newname)s") % {"name": name, "newname": newname}) self.pyfile.name = newname filename = join(location, newname) @@ -639,7 +639,7 @@ class Plugin(Base): if starting and self.core.config['download']['skip_existing'] and exists(location): size = os.stat(location).st_size if size >= self.pyfile.size: - raise SkipDownload("File exists.") + raise SkipDownload("File exists") pyfile = self.core.db.findDuplicates(self.pyfile.id, self.pyfile.package().folder, self.pyfile.name) if pyfile: diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index c4f4f8924..47f48c031 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -136,7 +136,7 @@ class PluginManager: try: plugins[name]['re'] = re.compile(pattern) except: - self.log.error(_("%s has a invalid pattern.") % name) + self.log.error(_("%s has a invalid pattern") % name) # internals have no config diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index 631a2a316..750e1ecec 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -30,7 +30,7 @@ class DebridItaliaCom(Account): validuntil = int(time.mktime(time.strptime(m.group('D'), "%d/%m/%Y %H:%M"))) return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: - self.logError("Unable to retrieve account information") + self.logError(_("Unable to retrieve account information")) def login(self, user, data, req): diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index e1f8c0142..c889c9644 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -24,7 +24,7 @@ class FilecloudIo(Account): if rep['status'] == 'ok': break elif rep['status'] == 'error' and rep['message'] == 'no such user or wrong password': - self.logError("Wrong username or password") + self.logError(_("Wrong username or password")) return {"valid": False, "premium": False} else: return {"premium": False} diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 8dcb20295..f7720adcc 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -36,7 +36,7 @@ class FilerNet(Account): trafficleft = self.parseTraffic(traffic.group(1)) return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} else: - self.logError("Unable to retrieve account information") + self.logError(_("Unable to retrieve account information")) return {"premium": False, "validuntil": None, "trafficleft": None} diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index d24a6ae51..15e25a7dd 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -44,7 +44,7 @@ class HellshareCz(Account): trafficleft = int(credit) * 1024 validuntil = -1 except Exception, e: - self.logError("Unable to parse credit info", e) + self.logError(_("Unable to parse credit info"), repr(e)) validuntil = -1 trafficleft = -1 diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index fba599078..3ca9e44da 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -31,4 +31,4 @@ class LetitbitNet(Account): def login(self, user, data, req): # API_KEY is the username and the PREMIUM_KEY is the password - self.logInfo("You must use your API KEY as username and the PREMIUM KEY as password.") + self.logInfo(_("You must use your API KEY as username and the PREMIUM KEY as password")) diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 350974d79..2d60cf939 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -21,7 +21,7 @@ class MyfastfileCom(Account): validuntil = int(time() + self.json_data['days_left'] * 24 * 60 * 60) return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: - self.logError("Unable to get account information") + self.logError(_("Unable to get account information")) def login(self, user, data, req): @@ -31,5 +31,5 @@ class MyfastfileCom(Account): self.logDebug("JSON data: " + html) self.json_data = json_loads(html) if self.json_data['status'] != 'ok': - self.logError('Invalid login. The password to use is the API-Password you find in your "My Account" page') + self.logError(_('Invalid login. The password to use is the API-Password you find in your "My Account" page')) self.wrongPassword() diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index a0d945342..cf9329e1f 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -24,7 +24,7 @@ class OboomCom(Account): pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2})) if not result[0] == 200: - self.logWarning("Failed to log in: %s" % result[1]) + self.logWarning(_("Failed to log in: %s") % result[1]) self.wrongPassword() return result[1] diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py index d6f4efe8d..864873d5d 100644 --- a/module/plugins/accounts/RapidshareCom.py +++ b/module/plugins/accounts/RapidshareCom.py @@ -43,7 +43,7 @@ class RapidshareCom(Account): "password": data['password'], "withcookie": 1} src = req.load(api_url_base, cookies=False, get=api_param_prem) if src.startswith("ERROR"): - raise Exception(src + "### Note you have to use your account number for login, instead of name.") + raise Exception(src + "### Note you have to use your account number for login, instead of name") fields = src.split("\n") info = {} for t in fields: diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index e85a28f02..4c3c3bc2b 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -32,5 +32,5 @@ class RealdebridCom(Account): if "Your login informations are incorrect" in page: self.wrongPassword() elif "PIN Code required" in page: - self.logWarning("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com.") + self.logWarning(_("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com")) self.pin_code = True diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index f89eab473..27abb3f51 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -33,7 +33,7 @@ class UnrestrictLi(Account): html = req.load("https://unrestrict.li/sign_in") if 'solvemedia' in html: - self.logError("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry") + self.logError(_("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry")) return post_data = {"username": user, "password": data['password'], diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index e66f7b9c6..771940dbd 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -18,7 +18,7 @@ class UploadheroCom(Account): def loadAccountInfo(self, user, req): - premium_pattern = re.compile('Il vous reste (\d+) jours premium.') + premium_pattern = re.compile('Il vous reste (\d+) jours premium') data = self.getAccountData(user) page = req.load("http://uploadhero.co/my-account") diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py index 9fc900100..af52b90f2 100644 --- a/module/plugins/container/LinkList.py +++ b/module/plugins/container/LinkList.py @@ -68,7 +68,7 @@ class LinkList(Container): txt = open(file_name, 'wb') txt.close() except: - self.logWarning(_("LinkList could not be cleared.")) + self.logWarning(_("LinkList could not be cleared")) for name, links in packages.iteritems(): self.packages.append((name, links, name)) diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py index 60afb5600..781b00326 100644 --- a/module/plugins/container/RSDF.py +++ b/module/plugins/container/RSDF.py @@ -49,4 +49,4 @@ class RSDF(Container): decryptedUrl = link.replace('CCF: ', '') self.urls.append(decryptedUrl) - self.logDebug("%s: adding package %s with %d links" % (self.__name__,pyfile.package().name,len(links))) + self.logDebug("Adding package %s with %d links" % (pyfile.package().name, len(links))) diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py index 4ef476895..26805b5b8 100644 --- a/module/plugins/crypter/ChipDe.py +++ b/module/plugins/crypter/ChipDe.py @@ -21,7 +21,7 @@ class ChipDe(Crypter): try: f = re.search(r'"(http://video\.chip\.de/.+)"', self.html) except: - self.fail("Failed to find the URL") + self.fail(_("Failed to find the URL")) else: self.urls = [f.group(1)] self.logDebug("The file URL is %s" % self.urls[0]) diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 8cca84e42..002d9a9c3 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -25,8 +25,8 @@ class CzshareComFolder(Crypter): m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: - self.fail("Parse error (FOLDER)") + self.error(_("FOLDER_PATTERN not found")) self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) if not self.urls: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py index 5d2f53b38..3b9b82a0c 100644 --- a/module/plugins/crypter/DailymotionBatch.py +++ b/module/plugins/crypter/DailymotionBatch.py @@ -95,7 +95,7 @@ class DailymotionBatch(Crypter): self.logDebug("%s playlist\s found on channel \"%s\"" % (len(playlists), m_id)) if not playlists: - self.fail("No playlist available") + self.fail(_("No playlist available")) for p_id, p_name, p_owner in playlists: p_videos = self.getVideos(p_id) diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py index 303b5835c..8cea48062 100644 --- a/module/plugins/crypter/DataHuFolder.py +++ b/module/plugins/crypter/DataHuFolder.py @@ -28,11 +28,11 @@ class DataHuFolder(SimpleCrypter): if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: # Password protected password = self.getPassword() if password is '': - self.fail("No password specified, please set right password on Add package form and retry") + self.fail(_("No password specified, please set right password on Add package form and retry")) self.logDebug("The folder is password protected', 'Using password: " + password) self.html = self.load(pyfile.url, post={'mappa_pass': password}, decode=True) if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password - self.fail("Incorrect password, please set right password on Add package form and retry") + self.fail(_("Incorrect password, please set right password on Add package form and retry")) package_name, folder_name = self.getPackageNameAndFolder() @@ -42,4 +42,4 @@ class DataHuFolder(SimpleCrypter): if package_links: self.packages = [(package_name, package_links, folder_name)] else: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index e31c62185..4b5f8fc95 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -57,7 +57,7 @@ class DlProtectCom(SimpleCrypter): for errmsg in (">The password is incorrect", ">The security code is incorrect"): if errmsg in self.html: - self.fail(errmsg[1:]) + self.fail(_(errmsg[1:])) pattern = r'' return re.findall(pattern, self.html) diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 41c245c00..126a1f544 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -27,7 +27,7 @@ class DuckCryptInfo(Crypter): m = re.match(self.__pattern__, url) if m is None: - self.fail("Weird error in link") + self.fail(_("Weird error in link")) if str(m.group(1)) == "link": self.handleLink(url) else: @@ -43,7 +43,7 @@ class DuckCryptInfo(Crypter): cryptlinks = soup.findAll("div", attrs={"class": "folderbox"}) self.logDebug("Redirectet to " + str(cryptlinks)) if not cryptlinks: - self.error("No link found") + self.error(_("No link found")) for clink in cryptlinks: if clink.find("a"): self.handleLink(clink.find("a")['href']) @@ -54,4 +54,4 @@ class DuckCryptInfo(Crypter): soup = BeautifulSoup(src) self.urls = [soup.find("iframe")['src']] if not self.urls: - self.logInfo("No link found") + self.logInfo(_("No link found")) diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index 54c8d2df0..6af3194df 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -42,7 +42,7 @@ class EmbeduploadCom(Crypter): self.urls = self.getLocation(tmp_links) if not self.urls: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) def getLocation(self, tmp_links): diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py index 42d0f3829..826350f6c 100644 --- a/module/plugins/crypter/FileserveComFolder.py +++ b/module/plugins/crypter/FileserveComFolder.py @@ -28,11 +28,11 @@ class FileserveComFolder(Crypter): folder = re.search(self.FOLDER_PATTERN, html, re.S) if folder is None: - self.fail("Parse error (FOLDER)") + self.error(_("FOLDER_PATTERN not found")) new_links.extend(re.findall(self.LINK_PATTERN, folder.group(1))) if new_links: self.urls = [map(lambda s: "http://fileserve.com%s" % s, new_links)] else: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/FreetexthostCom.py b/module/plugins/crypter/FreetexthostCom.py index 73a5c98dc..3fe51b913 100644 --- a/module/plugins/crypter/FreetexthostCom.py +++ b/module/plugins/crypter/FreetexthostCom.py @@ -20,6 +20,6 @@ class FreetexthostCom(SimpleCrypter): def getLinks(self): m = re.search(r'
\s*(.+)
', self.html, re.S) if m is None: - self.fail("Unable to extract links | Plugin may be out-of-date") + self.error(_("Unable to extract links")) links = m.group(1) return links.strip().split("
\r\n") diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 4f551aa42..c831fb2de 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -27,4 +27,4 @@ class GooGl(Crypter): if 'longUrl' in rep: self.urls = [rep['longUrl']] else: - self.fail("Unable to expand shortened link") + self.fail(_("Unable to expand shortened link")) diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py index 773e0bf8b..d35b2d8bc 100644 --- a/module/plugins/crypter/HoerbuchIn.py +++ b/module/plugins/crypter/HoerbuchIn.py @@ -44,7 +44,7 @@ class HoerbuchIn(Crypter): def decryptFolder(self, url): m = self.protection.search(url) if m is None: - self.fail("Bad URL") + self.fail(_("Bad URL")) url = m.group(0) self.pyfile.url = url diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py index af10f248c..3a31903ae 100644 --- a/module/plugins/crypter/LetitbitNetFolder.py +++ b/module/plugins/crypter/LetitbitNetFolder.py @@ -26,9 +26,9 @@ class LetitbitNetFolder(Crypter): folder = re.search(self.FOLDER_PATTERN, html, re.S) if folder is None: - self.fail("Parse error (FOLDER)") + self.error(_("FOLDER_PATTERN not found")) self.urls.extend(re.findall(self.LINK_PATTERN, folder.group(0))) if not self.urls: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 96d737382..aa340f873 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -74,7 +74,7 @@ class LinkSaveIn(SimpleCrypter): if package_links: self.packages = [(package_name, package_links, folder_name)] else: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) def isOnline(self): @@ -121,7 +121,7 @@ class LinkSaveIn(SimpleCrypter): def handleErrors(self): if "The visitorpassword you have entered is wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail(_("Incorrect password, please set right password on 'Edit package' form and retry")) if self.captcha: if "Wrong code. Please retry" in self.html: @@ -196,7 +196,7 @@ class LinkSaveIn(SimpleCrypter): for (crypted, jk) in zip(vcrypted, vjk): package_links.extend(self._getLinks(crypted, jk)) except: - self.fail("Unable to decrypt CNL2 links") + self.fail(_("Unable to decrypt CNL2 links")) return package_links diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 8731d1d0f..0848338ec 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -29,7 +29,7 @@ class LinkdecrypterCom(Crypter): # API not working anymore self.urls = self.decryptHTML() if not self.urls: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) def decryptAPI(self): @@ -46,7 +46,7 @@ class LinkdecrypterCom(Crypter): self.logError("API", self.html) if self.html == 'INTERRUPTION(PASSWORD)': - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) return None @@ -69,7 +69,7 @@ class LinkdecrypterCom(Crypter): m = re.search(r"

([^<]+)

", self.html) msg = m.group(1) if m else "" - self.logInfo("Captcha protected link", result_type, msg) + self.logInfo(_("Captcha protected link"), result_type, msg) captcha = self.decryptCaptcha(captcha_url, result_type=result_type) if result_type == "positional": @@ -80,10 +80,10 @@ class LinkdecrypterCom(Crypter): elif self.PASSWORD_PATTERN in self.html: if self.passwords: password = self.passwords.pop(0) - self.logInfo("Password protected link, trying " + password) + self.logInfo(_("Password protected link, trying ") + password) self.html = self.load('http://linkdecrypter.com/', post={'password': password}, decode=True) else: - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) else: retries -= 1 diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 0c20f6499..4a9dc7769 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -27,7 +27,7 @@ class LixIn(Crypter): m = re.match(self.__pattern__, url) if m is None: - self.error("Unable to identify file ID") + self.error(_("Unable to identify file ID")) id = m.group("ID") self.logDebug("File id is %s" % id) @@ -36,7 +36,7 @@ class LixIn(Crypter): m = re.search(self.SUBMIT_PATTERN, self.html) if m is None: - self.error("Link doesn't seem valid") + self.error(_("Link doesn't seem valid")) m = re.search(self.CAPTCHA_PATTERN, self.html) if m: @@ -54,7 +54,7 @@ class LixIn(Crypter): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Unable to find destination url") + self.error(_("Unable to find destination url")) else: self.urls = [m.group("link")] self.logDebug("Found link %s, adding to package" % self.urls[0]) diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py index 607c630e4..ae8f3fd44 100644 --- a/module/plugins/crypter/MediafireComFolder.py +++ b/module/plugins/crypter/MediafireComFolder.py @@ -54,4 +54,4 @@ class MediafireComFolder(Crypter): self.urls.append(url) if not self.urls: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index 54e9343e5..e894c8c5d 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -40,4 +40,4 @@ class MultiloadCz(Crypter): self.urls.extend([x[1] for x in m if x[0] not in ignored_set]) if not self.urls: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index a9f04f45f..801afc50b 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -74,7 +74,7 @@ class NCryptIn(Crypter): # Pack and return links if not package_links: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) self.packages = [(package_name, package_links, folder_name)] @@ -177,7 +177,7 @@ class NCryptIn(Crypter): if self.protection_type == "password": if "This password is invalid!" in self.cleanedHtml: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail(_("Incorrect password, please set right password on 'Edit package' form and retry")) if self.protection_type == "captcha": if "The securitycheck was wrong!" in self.cleanedHtml: @@ -229,7 +229,7 @@ class NCryptIn(Crypter): for (crypted, jk) in zip(vcrypted, vjk): package_links.extend(self._getLinks(crypted, jk)) except: - self.fail("Unable to decrypt CNL2 links") + self.fail(_("Unable to decrypt CNL2 links")) return package_links diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 03c62ba14..01774362c 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -29,7 +29,7 @@ class NetfolderIn(SimpleCrypter): if self.isPasswordProtected(): self.html = self.submitPassword() if not self.html: - self.fail("Incorrect password, please set right password on Add package form and retry") + self.fail(_("Incorrect password, please set right password on Add package form and retry")) # Get package name and folder (package_name, folder_name) = self.getPackageNameAndFolder() diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py index cb6bd4696..7b2d336b3 100644 --- a/module/plugins/crypter/QuickshareCzFolder.py +++ b/module/plugins/crypter/QuickshareCzFolder.py @@ -25,8 +25,8 @@ class QuickshareCzFolder(Crypter): m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: - self.fail("Parse error (FOLDER)") + self.error(_("FOLDER_PATTERN not found")) self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) if not self.urls: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 184e1a38e..a71c736b5 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -94,7 +94,7 @@ class RelinkUs(Crypter): if package_links: self.packages = [(package_name, package_links, folder_name)] else: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) def initPackage(self, pyfile): @@ -169,7 +169,7 @@ class RelinkUs(Crypter): if self.PASSWORD_ERROR_ROKEN in self.html: msg = "Incorrect password, please set right password on 'Edit package' form and retry" self.logDebug(msg) - self.fail(msg) + self.fail(_(msg)) if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index d9b511cf5..fbeaa406c 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -35,7 +35,7 @@ class SafelinkingNet(Crypter): if m: self.urls = [m.group(1)] else: - self.fail("Couldn't find forwarded Link") + self.fail(_("Couldn't find forwarded Link")) else: postData = {"post-protect": "1"} @@ -53,7 +53,7 @@ class SafelinkingNet(Crypter): captcha = SolveMedia(self) captchaProvider = "Solvemedia" else: - self.fail("Error parsing captcha") + self.fail(_("Error parsing captcha")) challenge, response = captcha.challenge(captchaKey) postData['adcopy_challenge'] = challenge @@ -61,7 +61,7 @@ class SafelinkingNet(Crypter): self.html = self.load(url, post=postData) if "The password you entered was incorrect" in self.html: - self.fail("Incorrect Password") + self.fail(_("Incorrect Password")) if not "The CAPTCHA code you entered was wrong" in self.html: break diff --git a/module/plugins/crypter/SexuriaCom.py b/module/plugins/crypter/SexuriaCom.py index 68a404f46..6b9b2c5f6 100644 --- a/module/plugins/crypter/SexuriaCom.py +++ b/module/plugins/crypter/SexuriaCom.py @@ -88,7 +88,7 @@ class SexuriaCom(Crypter): # Inform the user if no link could been extracted if linklist == []: - self.error("Could not extract any links") + self.error(_("Could not extract any links")) # Debug log self.logDebug("%d supported links" % len(linklist)) diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index bc79c5f70..8e89c98f9 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -149,7 +149,7 @@ class ShareLinksBiz(Crypter): def handleErrors(self): if "The inserted password was wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail(_("Incorrect password, please set right password on 'Edit package' form and retry")) if self.captcha: if "Your choice was wrong" in self.html: @@ -233,7 +233,7 @@ class ShareLinksBiz(Crypter): (crypted, jk) = self._getCipherParams() package_links.extend(self._getLinks(crypted, jk)) except: - self.fail("Unable to decrypt CNL2 links") + self.fail(_("Unable to decrypt CNL2 links")) return package_links diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 8b763dd82..acb360ee4 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -26,10 +26,10 @@ class UlozToFolder(Crypter): new_links = [] for i in xrange(1, 100): - self.logInfo("Fetching links from page %i" % i) + self.logInfo(_("Fetching links from page %i") % i) m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: - self.fail("Parse error (FOLDER)") + self.error(_("FOLDER_PATTERN not found")) new_links.extend(re.findall(self.LINK_PATTERN, m.group(1))) m = re.search(self.NEXT_PAGE_PATTERN, html) @@ -38,9 +38,9 @@ class UlozToFolder(Crypter): else: break else: - self.logInfo("Limit of 99 pages reached, aborting") + self.logInfo(_("Limit of 99 pages reached, aborting")) if new_links: self.urls = [map(lambda s: "http://ulozto.net/%s" % s, new_links)] else: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py index 94afe98ea..8f50f80aa 100644 --- a/module/plugins/crypter/UploadedToFolder.py +++ b/module/plugins/crypter/UploadedToFolder.py @@ -30,7 +30,7 @@ class UploadedToFolder(SimpleCrypter): if m: plain_link = 'http://uploaded.net/' + m.group('plain') else: - self.fail("Parse error - Unable to find plain url list") + self.error(_("Unable to find plain url list")) self.html = self.load(plain_link) package_links = self.html.split('\n')[:-1] diff --git a/module/plugins/crypter/XupPl.py b/module/plugins/crypter/XupPl.py index 1cb1b0b10..3323d0ff4 100644 --- a/module/plugins/crypter/XupPl.py +++ b/module/plugins/crypter/XupPl.py @@ -20,4 +20,4 @@ class XupPl(Crypter): if 'location' in header: self.urls = [header['location']] else: - self.fail("Unable to find link") + self.fail(_("Unable to find link")) diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py index e70003ab1..c5bcdd72d 100644 --- a/module/plugins/crypter/YoutubeBatch.py +++ b/module/plugins/crypter/YoutubeBatch.py @@ -123,7 +123,7 @@ class YoutubeBatch(Crypter): playlists = [self.getPlaylist(m_id)] if not playlists: - self.fail("No playlist available") + self.fail(_("No playlist available")) addedvideos = [] urlize = lambda x: "https://www.youtube.com/watch?v=" + x diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index a07b2fc66..ef7ba01c3 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -92,7 +92,7 @@ class BypassCaptcha(Hook): response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}) except BadHeader, e: - self.logError(_("Could not send response."), e + self.logError(_("Could not send response"), repr(e)) def newCaptchaTask(self, task): diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 930293002..7bbfa2e73 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -137,9 +137,9 @@ class Captcha9kw(Hook): self.logInfo(_("Request correct"), response) except BadHeader, e: - self.logError(_("Could not send correct request."), e) + self.logError(_("Could not send correct request"), repr(e)) else: - self.logError(_("No CaptchaID for correct request (task %s) found.") % task) + self.logError(_("No CaptchaID for correct request (task %s) found") % task) def captchaInvalid(self, task): @@ -157,6 +157,6 @@ class Captcha9kw(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request."), e) + self.logError(_("Could not send refund request"), repr(e)) else: - self.logError(_("No CaptchaID for not correct request (task %s) found.") % task) + self.logError(_("No CaptchaID for not correct request (task %s) found") % task) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 4a7cfd661..bcd1139d9 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -120,7 +120,7 @@ class Checksum(Hook): checksum = computeChecksum(local_file, key.replace("-", "").lower()) if checksum: if checksum == data[key].lower(): - self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') % (pyfile.name, key.upper(), checksum)) break else: @@ -130,7 +130,7 @@ class Checksum(Hook): else: self.logWarning(_("Unsupported hashing algorithm"), key.upper()) else: - self.logWarning(_("Unable to validate checksum for file"), pyfile.name) + self.logWarning(_("Unable to validate checksum for file: ") + pyfile.name) def checkFailed(self, pyfile, local_file, msg): @@ -174,7 +174,7 @@ class Checksum(Hook): algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) if checksum == data['hash']: - self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') % (data['name'], algorithm, checksum)) else: self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index e786cc35a..f1d949544 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -96,4 +96,4 @@ class ExpertDecoders(Hook): self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError(_("Could not send refund request."), e) + self.logError(_("Could not send refund request"), repr(e)) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 649689f6e..8164b3157 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -98,12 +98,12 @@ class ExtractArchive(Hook): if e.errno == 2: self.logInfo(_("No %s installed") % p) else: - self.logWarning(_("Could not activate %s") % p, e) + self.logWarning(_("Could not activate %s") % p, repr(e)) if self.core.debug: print_exc() except Exception, e: - self.logWarning(_("Could not activate %s") % p, e) + self.logWarning(_("Could not activate %s") % p, repr(e)) if self.core.debug: print_exc() @@ -202,7 +202,7 @@ class ExtractArchive(Hook): password = p.password.strip().splitlines() new_files = self._extract(klass, fid, password, thread) except Exception, e: - self.logError(basename(target), e) + self.logError(basename(target), repr(e)) success = False continue @@ -289,13 +289,13 @@ class ExtractArchive(Hook): return extracted_files except ArchiveError, e: - self.logError(basename(plugin.file), _("Archive Error"), e) + self.logError(basename(plugin.file), _("Archive Error"), repr(e)) except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) except Exception, e: if self.core.debug: print_exc() - self.logError(basename(plugin.file), _("Unknown Error"), e) + self.logError(basename(plugin.file), _("Unknown Error"), repr(e)) self.manager.dispatchEvent("archive_extract_failed", pyfile) raise Exception(_("Extract failed")) @@ -352,4 +352,4 @@ class ExtractArchive(Hook): gid = getgrnam(self.config['permission']['group'])[2] chown(f, uid, gid) except Exception, e: - self.logWarning(_("Setting User and Group failed"), e) + self.logWarning(_("Setting User and Group failed"), repr(e)) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 59977b8af..9a23951cf 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -156,15 +156,15 @@ class IRCInterface(Thread, Hook): # HANDLE CTCP ANTI FLOOD/BOT PROTECTION if msg['text'] == "\x01VERSION\x01": - self.logDebug("Sending CTCP VERSION.") + self.logDebug("Sending CTCP VERSION") self.sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) return elif msg['text'] == "\x01TIME\x01": - self.logDebug("Sending CTCP TIME.") + self.logDebug("Sending CTCP TIME") self.sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) return elif msg['text'] == "\x01LAG\x01": - self.logDebug("Received CTCP LAG.") # don't know how to answer + self.logDebug("Received CTCP LAG") #: don't know how to answer return trigger = "pass" diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py index 1ef82612e..2adeadb75 100644 --- a/module/plugins/hooks/PremiumizeMe.py +++ b/module/plugins/hooks/PremiumizeMe.py @@ -48,7 +48,7 @@ class PremiumizeMe(MultiHoster): self.account = self.core.accountManager.getAccountPlugin("PremiumizeMe") if not self.account.canUse(): self.account = None - self.logError(_("Please add a valid premiumize.me account first and restart pyLoad.")) + self.logError(_("Please add a valid premiumize.me account first and restart pyLoad")) return # Run the overwriten core ready which actually enables the multihoster hook diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index be1d6e5fc..1bddbf967 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -218,7 +218,7 @@ class UpdateManager(Hook): else: raise Exception, _("Version mismatch") except Exception, e: - self.logError(_("Error updating plugin %s") % filename, e) + self.logError(_("Error updating plugin %s") % filename, repr(e)) if blacklist: blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist)) @@ -273,7 +273,7 @@ class UpdateManager(Hook): try: remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), e) + self.logDebug("Error deleting", path.basename(filename), repr(e)) err = True filename += "c" @@ -283,7 +283,7 @@ class UpdateManager(Hook): self.manager.deactivateHook(name) remove(filename) except Exception, e: - self.logDebug("Error deleting", path.basename(filename), e) + self.logDebug("Error deleting", path.basename(filename), repr(e)) err = True if not err: 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'
', 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" % 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'(?P[^<]+)', 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+)', 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 '' 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 (\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("")}) 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": "302 Found"}) 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'Ошиблись?' 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 '