diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-07 23:40:50 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 10:58:42 +0200 |
commit | 887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch) | |
tree | f31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/crypter/LixIn.py | |
parent | [AccountManager] Fixed #733 (diff) | |
parent | [File4safe] distributing LINK_PATTERN (diff) | |
download | pyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
module/plugins/Account.py
module/plugins/AccountManager.py
module/plugins/Hook.py
module/plugins/OCR.py
module/plugins/Plugin.py
module/plugins/PluginManager.py
module/plugins/ReCaptcha.py
module/plugins/accounts/Ftp.py
module/plugins/accounts/Http.py
module/plugins/internal/MultiHoster.py
module/plugins/ocr/GigasizeCom.py
module/plugins/ocr/LinksaveIn.py
module/plugins/ocr/NetloadIn.py
module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/crypter/LixIn.py')
-rw-r--r-- | module/plugins/crypter/LixIn.py | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 619a474f2..cdf87eeb2 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -8,39 +8,42 @@ from module.plugins.Crypter import Crypter class LixIn(Crypter): __name__ = "LixIn" __type__ = "crypter" - __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)' __version__ = "0.22" + + __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)' + __description__ = """Lix.in decrypter plugin""" __author_name__ = "spoob" __author_mail__ = "spoob@pyload.org" - CAPTCHA_PATTERN = '<img src="(?P<image>captcha_img.php\?.*?)"' + CAPTCHA_PATTERN = r'<img src="(?P<image>captcha_img.php\?.*?)"' SUBMIT_PATTERN = r"value='continue.*?'" LINK_PATTERN = r'name="ifram" src="(?P<link>.*?)"' + 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: @@ -48,11 +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") - - 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 = [m.group("link")] + self.logDebug("Found link %s, adding to package" % self.urls[0]) |