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