From 4811058490989e5150fd57ea8f0afedddba98069 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 14 Jul 2014 21:05:08 +0200 Subject: [l18n] Improved few source strings --- module/plugins/hoster/MegaDebridEu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/MegaDebridEu.py') diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index 46eb0eb11..23c698710 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -23,7 +23,7 @@ from module.common.json_layer import json_loads class MegaDebridEu(Hoster): __name__ = "MegaDebridEu" - __version__ = "0.3" + __version__ = "0.4" __type__ = "hoster" __pattern__ = r'^https?://(?:w{3}\d+\.mega-debrid.eu|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/download/file/[^/]+/.+$' __description__ = """mega-debrid.eu hoster plugin""" @@ -46,7 +46,7 @@ class MegaDebridEu(Hoster): self.exitOnFail(_("Please enter your %s account or deactivate this plugin") % "Mega-debrid.eu") else: if not self.connectToApi(): - self.exitOnFail(_("Impossible to connect to %s") % "Mega-debrid.eu") + self.exitOnFail(_("Unable to connect to %s") % "Mega-debrid.eu") self.logDebug("Old URL: %s" % pyfile.url) new_url = self.debridLink(pyfile.url) @@ -86,7 +86,7 @@ class MegaDebridEu(Hoster): debridedLink = response["debridLink"][1:-1] return debridedLink else: - self.exitOnFail(_("Impossible to debrid %s") % linkToDebrid) + self.exitOnFail("Unable to debrid %s" % linkToDebrid) def exitOnFail(self, msg): """ -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/MegaDebridEu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/MegaDebridEu.py') diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index 23c698710..1e68cec22 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -64,11 +64,11 @@ class MegaDebridEu(Hoster): """ user, data = self.account.selectAccount() jsonResponse = self.load(self.API_URL, - get={'action': 'connectUser', 'login': user, 'password': data["password"]}) + get={'action': 'connectUser', 'login': user, 'password': data['password']}) response = json_loads(jsonResponse) - if response["response_code"] == "ok": - self.token = response["token"] + if response['response_code'] == "ok": + self.token = response['token'] return True else: return False @@ -82,8 +82,8 @@ class MegaDebridEu(Hoster): post={"link": linkToDebrid}) response = json_loads(jsonResponse) - if response["response_code"] == "ok": - debridedLink = response["debridLink"][1:-1] + if response['response_code'] == "ok": + debridedLink = response['debridLink'][1:-1] return debridedLink else: self.exitOnFail("Unable to debrid %s" % linkToDebrid) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/MegaDebridEu.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/MegaDebridEu.py') diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index 1e68cec22..13415d063 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -1,38 +1,27 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ import re + from urllib import unquote_plus -from module.plugins.Hoster import Hoster from module.common.json_layer import json_loads +from module.plugins.Hoster import Hoster class MegaDebridEu(Hoster): __name__ = "MegaDebridEu" - __version__ = "0.4" __type__ = "hoster" + __version__ = "0.4" + __pattern__ = r'^https?://(?:w{3}\d+\.mega-debrid.eu|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/download/file/[^/]+/.+$' + __description__ = """mega-debrid.eu hoster plugin""" __author_name__ = "D.Ducatel" __author_mail__ = "dducatel@je-geek.fr" - # Define the base URL of MegaDebrid api API_URL = "https://www.mega-debrid.eu/api.php" + def getFilename(self, url): try: return unquote_plus(url.rsplit("/", 1)[1]) -- cgit v1.2.3