From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/crypter/LixIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 619a474f2..8fca7dc02 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -14,7 +14,7 @@ class LixIn(Crypter): __author_name__ = "spoob" __author_mail__ = "spoob@pyload.org" - CAPTCHA_PATTERN = ' Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/LixIn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 8fca7dc02..d3c41bd4c 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -7,9 +7,11 @@ from module.plugins.Crypter import Crypter class LixIn(Crypter): __name__ = "LixIn" + __version__ = "0.22" __type__ = "crypter" + __pattern__ = r'http://(www.)?lix.in/(?P.*)' - __version__ = "0.22" + __description__ = """Lix.in decrypter plugin""" __author_name__ = "spoob" __author_mail__ = "spoob@pyload.org" @@ -18,6 +20,7 @@ class LixIn(Crypter): SUBMIT_PATTERN = r"value='continue.*?'" LINK_PATTERN = r'name="ifram" src="(?P.*?)"' + def decrypt(self, pyfile): url = pyfile.url -- cgit v1.2.3 From a1e78f33dc2b0b6777fdcbc415673f3965b25542 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 16 Jul 2014 00:46:26 +0200 Subject: Prefer self.urls and self.packages for adding links --- module/plugins/crypter/LixIn.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index d3c41bd4c..e609c9da4 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -54,8 +54,6 @@ class LixIn(Crypter): matches = re.search(self.LINK_PATTERN, self.html) if not matches: self.fail("can't find destination url") - - new_link = matches.group("link") - self.logDebug("Found link %s, adding to package" % new_link) - - self.packages.append((pyfile.package().name, [new_link], pyfile.package().name)) + else: + self.urls = [matches.group("link")] + self.logDebug("Found link %s, adding to package" % self.urls[0]) -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/crypter/LixIn.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index e609c9da4..a39173903 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -24,26 +24,26 @@ class LixIn(Crypter): def decrypt(self, pyfile): url = pyfile.url - matches = re.match(self.__pattern__, url) - if not matches: + m = re.match(self.__pattern__, url) + if m is None: self.fail("couldn't identify file id") - id = matches.group("id") + id = m.group("id") self.logDebug("File id is %s" % id) self.html = self.req.load(url, decode=True) - matches = re.search(self.SUBMIT_PATTERN, self.html) - if not matches: + m = re.search(self.SUBMIT_PATTERN, self.html) + if m is None: self.fail("link doesn't seem valid") - matches = re.search(self.CAPTCHA_PATTERN, self.html) - if matches: + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: for _ in xrange(5): - matches = re.search(self.CAPTCHA_PATTERN, self.html) - if matches: + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: self.logDebug("trying captcha") - captcharesult = self.decryptCaptcha("http://lix.in/" + matches.group("image")) + captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image")) self.html = self.req.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: @@ -51,9 +51,9 @@ class LixIn(Crypter): else: self.html = self.req.load(url, decode=True, post={"submit": "submit", "tiny": id}) - matches = re.search(self.LINK_PATTERN, self.html) - if not matches: + m = re.search(self.LINK_PATTERN, self.html) + if m is None: self.fail("can't find destination url") else: - self.urls = [matches.group("link")] + self.urls = [m.group("link")] self.logDebug("Found link %s, adding to package" % self.urls[0]) -- 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/crypter/LixIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index a39173903..cdf87eeb2 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -7,8 +7,8 @@ from module.plugins.Crypter import Crypter class LixIn(Crypter): __name__ = "LixIn" - __version__ = "0.22" __type__ = "crypter" + __version__ = "0.22" __pattern__ = r'http://(www.)?lix.in/(?P.*)' -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/crypter/LixIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index cdf87eeb2..beba5ed04 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -42,12 +42,12 @@ class LixIn(Crypter): for _ in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: - self.logDebug("trying captcha") + self.logDebug("Trying captcha") captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image")) self.html = self.req.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: - self.logDebug("no captcha/captcha solved") + self.logDebug("No captcha/captcha solved") else: self.html = self.req.load(url, decode=True, post={"submit": "submit", "tiny": id}) -- cgit v1.2.3 From a4a2330adc70f9d0b3d2bc2e10386e2a5d8749ea Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 4 Oct 2014 23:35:49 +0200 Subject: Spare __pattern__ cosmetics --- module/plugins/crypter/LixIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index beba5ed04..dec2e02d3 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -10,7 +10,7 @@ class LixIn(Crypter): __type__ = "crypter" __version__ = "0.22" - __pattern__ = r'http://(www.)?lix.in/(?P.*)' + __pattern__ = r'http://(?:www\.)?lix\.in/(?P.+)' __description__ = """Lix.in decrypter plugin""" __author_name__ = "spoob" @@ -28,7 +28,7 @@ class LixIn(Crypter): if m is None: self.fail("couldn't identify file id") - id = m.group("id") + id = m.group("ID") self.logDebug("File id is %s" % id) self.html = self.req.load(url, decode=True) -- cgit v1.2.3 From 1047c706d41dec4a49a747496c2ec01ed3bf7801 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 01:54:58 +0200 Subject: Use load instead req.load in all crypters and CaptchaService --- module/plugins/crypter/LixIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index dec2e02d3..7aedda686 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -31,7 +31,7 @@ class LixIn(Crypter): id = m.group("ID") self.logDebug("File id is %s" % id) - self.html = self.req.load(url, decode=True) + self.html = self.load(url, decode=True) m = re.search(self.SUBMIT_PATTERN, self.html) if m is None: @@ -44,12 +44,12 @@ class LixIn(Crypter): if m: self.logDebug("Trying captcha") captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image")) - self.html = self.req.load(url, decode=True, + self.html = self.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: self.logDebug("No captcha/captcha solved") else: - self.html = self.req.load(url, decode=True, post={"submit": "submit", "tiny": id}) + self.html = self.load(url, decode=True, post={"submit": "submit", "tiny": id}) m = re.search(self.LINK_PATTERN, self.html) if m is None: -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/crypter/LixIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 7aedda686..af4f182b4 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -13,8 +13,8 @@ class LixIn(Crypter): __pattern__ = r'http://(?:www\.)?lix\.in/(?P.+)' __description__ = """Lix.in decrypter plugin""" - __author_name__ = "spoob" - __author_mail__ = "spoob@pyload.org" + __authors__ = [("spoob", "spoob@pyload.org")] + CAPTCHA_PATTERN = r' Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/crypter/LixIn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index af4f182b4..df32eed55 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -13,6 +13,7 @@ class LixIn(Crypter): __pattern__ = r'http://(?:www\.)?lix\.in/(?P.+)' __description__ = """Lix.in decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("spoob", "spoob@pyload.org")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/crypter/LixIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index df32eed55..28b72237b 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -17,7 +17,7 @@ class LixIn(Crypter): __authors__ = [("spoob", "spoob@pyload.org")] - CAPTCHA_PATTERN = r' Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- module/plugins/crypter/LixIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 28b72237b..32423e228 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -18,7 +18,7 @@ class LixIn(Crypter): CAPTCHA_PATTERN = r' Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/LixIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 32423e228..744066d19 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.fail("couldn't 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.fail("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.fail("can't 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]) -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- module/plugins/crypter/LixIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 744066d19..0c20f6499 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -40,7 +40,7 @@ class LixIn(Crypter): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: self.logDebug("Trying captcha") -- cgit v1.2.3 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/crypter/LixIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') 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]) -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/crypter/LixIn.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 4a9dc7769..44831b2db 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -11,6 +11,8 @@ class LixIn(Crypter): __version__ = "0.22" __pattern__ = r'http://(?:www\.)?lix\.in/(?P.+)' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Lix.in decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/crypter/LixIn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 44831b2db..50ad217d4 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -6,8 +6,8 @@ from module.plugins.Crypter import Crypter class LixIn(Crypter): - __name__ = "LixIn" - __type__ = "crypter" + __name__ = "LixIn" + __type__ = "crypter" __version__ = "0.22" __pattern__ = r'http://(?:www\.)?lix\.in/(?P.+)' @@ -15,8 +15,8 @@ class LixIn(Crypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Lix.in decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("spoob", "spoob@pyload.org")] + __license__ = "GPLv3" + __authors__ = [("spoob", "spoob@pyload.org")] CAPTCHA_PATTERN = r' Date: Mon, 22 Dec 2014 16:45:04 +0100 Subject: Spare code cosmetics --- module/plugins/crypter/LixIn.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/LixIn.py') diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 50ad217d4..d899d58c7 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -19,9 +19,9 @@ class LixIn(Crypter): __authors__ = [("spoob", "spoob@pyload.org")] - CAPTCHA_PATTERN = r'