diff options
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/CloudzillaToFolder.py | 2 | ||||
-rw-r--r-- | module/plugins/crypter/Dereferer.py | 2 | ||||
-rw-r--r-- | module/plugins/crypter/DlProtectCom.py | 2 | ||||
-rw-r--r-- | module/plugins/crypter/EmbeduploadCom.py | 2 | ||||
-rw-r--r-- | module/plugins/crypter/FilecryptCc.py | 11 | ||||
-rw-r--r-- | module/plugins/crypter/FreakhareComFolder.py | 2 | ||||
-rw-r--r-- | module/plugins/crypter/LinkCryptWs.py | 11 | ||||
-rw-r--r-- | module/plugins/crypter/LinkdecrypterCom.py | 4 | ||||
-rw-r--r-- | module/plugins/crypter/LixIn.py | 17 | ||||
-rw-r--r-- | module/plugins/crypter/MediafireComFolder.py | 4 | ||||
-rw-r--r-- | module/plugins/crypter/MultiloadCz.py | 4 | ||||
-rw-r--r-- | module/plugins/crypter/NCryptIn.py | 10 | ||||
-rw-r--r-- | module/plugins/crypter/RelinkUs.py | 13 | ||||
-rw-r--r-- | module/plugins/crypter/SafelinkingNet.py | 35 | ||||
-rw-r--r-- | module/plugins/crypter/ShareLinksBiz.py | 24 | ||||
-rw-r--r-- | module/plugins/crypter/UlozToFolder.py | 2 |
16 files changed, 70 insertions, 75 deletions
diff --git a/module/plugins/crypter/CloudzillaToFolder.py b/module/plugins/crypter/CloudzillaToFolder.py index 6c8ce5917..dc0cdfef2 100644 --- a/module/plugins/crypter/CloudzillaToFolder.py +++ b/module/plugins/crypter/CloudzillaToFolder.py @@ -28,7 +28,7 @@ class CloudzillaToFolder(SimpleHoster): def check_errors(self): m = re.search(self.PASSWORD_PATTERN, self.html) - if m: + if m is not None: self.html = self.load(self.pyfile.url, get={'key': self.get_password()}) if re.search(self.PASSWORD_PATTERN, self.html): diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py index d7dfe52d7..8ecc635ec 100644 --- a/module/plugins/crypter/Dereferer.py +++ b/module/plugins/crypter/Dereferer.py @@ -38,4 +38,4 @@ class Dereferer(SimpleCrypter): def get_links(self): - return [re.match(self.__pattern__, self.pyfile.url).group('LINK').strip()] + return [re.match(self.__pattern__, self.pyfile.url).group('LINK')] diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 0c776ac61..ac45ee4c3 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -53,7 +53,7 @@ class DlProtectCom(SimpleCrypter): if "Security Code" in self.html: m = re.search(r'/captcha\.php\?key=(.+?)"', self.html) - if m: + if m is not None: captcha_code = self.captcha.decrypt("http://www.dl-protect.com/captcha.php?key=" + m.group(1), input_type="gif") post_req['secure'] = captcha_code diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index 341b3e315..e4a9387ae 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -30,7 +30,7 @@ class EmbeduploadCom(Crypter): tmp_links = [] m = re.findall(self.LINK_PATTERN, self.html) - if m: + if m is not None: prefered_set = set(self.get_config('preferedHoster').split('|')) prefered_set = map(lambda s: s.lower().split('.')[0], prefered_set) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index fcabd5ebf..bb9aee1d7 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -24,8 +24,8 @@ class FilecryptCc(Crypter): __description__ = """Filecrypt.cc decrypter plugin""" __license__ = "GPLv3" - __authors__ = [("zapp-brannigan", "" ), - ("GammaC0de" , None)] + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), + ("GammaC0de" , None )] # URL_REPLACEMENTS = [(r'.html$', ""), (r'$', ".html")] #@TODO: Extend SimpleCrypter @@ -138,9 +138,9 @@ class FilecryptCc(Crypter): if captcha_key: try: response, challenge = recaptcha.challenge(captcha_key) + except Exception: - self.captcha.invalid() - self.retry() + self.retry_captcha() self.site_with_links = self.load(self.pyfile.url, post={'g-recaptcha-response': response}) @@ -149,8 +149,7 @@ class FilecryptCc(Crypter): self.retry() if re.search(self.CAPTCHA_PATTERN, self.site_with_links): - self.captcha.invalid() - self.retry() + self.retry_captcha() else: self.log_info(_("No captcha found")) diff --git a/module/plugins/crypter/FreakhareComFolder.py b/module/plugins/crypter/FreakhareComFolder.py index f7f1946f4..e939fe467 100644 --- a/module/plugins/crypter/FreakhareComFolder.py +++ b/module/plugins/crypter/FreakhareComFolder.py @@ -29,7 +29,7 @@ class FreakhareComFolder(SimpleCrypter): def load_page(self, page_n): if not hasattr(self, 'f_id') and not hasattr(self, 'f_md5'): m = re.search(r'http://freakshare.com/\?x=folder&f_id=(\d+)&f_md5=(\w+)', self.html) - if m: + if m is not None: self.f_id = m.group(1) self.f_md5 = m.group(2) return self.load('http://freakshare.com/', get={'x': 'folder', diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index 0d8590860..d61c9d3dd 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -160,13 +160,12 @@ class LinkCryptWs(Crypter): def handle_errors(self): if self.is_password_protected(): - self.fail(_("Incorrect password")) + self.fail(_("Wrong password")) def handle_captcha_errors(self): - if "Your choice was wrong!" in self.html: - self.captcha.invalid() - self.retry() + if "Your choice was wrong" in self.html: + self.retry_captcha() else: self.captcha.correct() @@ -244,7 +243,7 @@ class LinkCryptWs(Crypter): if not clink: continue - self.log_debug("clink avaible") + self.log_debug("clink found") package_name, folder_name = self.get_package_info() self.log_debug("Added package with name %s.%s and container link %s" %( package_name, type, clink.group(1))) @@ -266,7 +265,7 @@ class LinkCryptWs(Crypter): break if cnl_line: - self.log_debug("cnl_line gefunden") + self.log_debug("cnl_line found") try: cnl_section = self.handle_javascript(cnl_line) diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 0f0c3e7a9..c16ec0b6e 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -39,11 +39,11 @@ class LinkdecrypterCom(MultiCrypter): while retries: m = re.search(self.TEXTAREA_PATTERN, self.html, re.S) - if m: + if m is not None: self.urls = [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x] m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: + if m is not None: captcha_url = 'http://linkdecrypter.com/' + m.group(1) result_type = "positional" if "getPos" in m.group(2) else "textual" diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 2d26564e8..ecc92a8d3 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -43,16 +43,13 @@ class LixIn(Crypter): self.error(_("Link doesn't seem valid")) m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: - for _i in xrange(5): - m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: - self.log_debug("Trying captcha") - captcharesult = self.captcha.decrypt(urlparse.urljoin("http://lix.in/", m.group(1))) - self.html = self.load(url, - post={'capt': captcharesult, 'submit': "submit", 'tiny': id}) - else: - self.log_debug("No captcha/captcha solved") + if m is not None: + captcharesult = self.captcha.decrypt(urlparse.urljoin("http://lix.in/", m.group(1))) + self.html = self.load(url, post={'capt': captcharesult, 'submit': "submit", 'tiny': id}) + + if re.search(self.CAPTCHA_PATTERN, self.html): + self.fail(_("No captcha solved")) + else: self.html = self.load(url, post={'submit': "submit", 'tiny': id}) diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py index 81d880725..f90bc04ea 100644 --- a/module/plugins/crypter/MediafireComFolder.py +++ b/module/plugins/crypter/MediafireComFolder.py @@ -33,13 +33,13 @@ class MediafireComFolder(Crypter): #: Load and parse html html = self.load(pyfile.url) m = re.search(self.LINK_PATTERN, html) - if m: + if m is not None: #: File page self.urls.append("http://www.mediafire.com/file/%s" % m.group(1)) else: #: Folder page m = re.search(self.FOLDER_KEY_PATTERN, html) - if m: + if m is not None: folder_key = m.group(1) self.log_debug("FOLDER KEY: %s" % folder_key) diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index d9b6236be..72e9b3a8b 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -30,11 +30,11 @@ class MultiloadCz(Crypter): if re.match(self.__pattern__, pyfile.url).group(1) == "slozka": m = re.search(self.FOLDER_PATTERN, self.html) - if m: + if m is not None: self.urls.extend(m.group(1).split()) else: m = re.findall(self.LINK_PATTERN, self.html) - if m: + if m is not None: prefered_set = set(self.get_config('usedHoster').split('|')) self.urls.extend(x[1] for x in m if x[0] in prefered_set) diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 32c9283f7..dddffbbf2 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -121,7 +121,7 @@ class NCryptIn(Crypter): def get_package_info(self): m = re.search(self.NAME_PATTERN, self.html) - if m: + if m is not None: name = folder = m.group('N').strip() self.log_debug("Found name [%s] and folder [%s] in package info" % (name, folder)) else: @@ -177,13 +177,11 @@ class NCryptIn(Crypter): def handle_errors(self): if self.protection_type == "password": if "This password is invalid!" in self.cleaned_html: - self.log_debug("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(_("Wrong password")) if self.protection_type == "captcha": - if "The securitycheck was wrong!" in self.cleaned_html: - self.captcha.invalid() - self.retry() + if "The securitycheck was wrong" in self.cleaned_html: + self.retry_captcha() else: self.captcha.correct() diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 641353865..6d8383fee 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -154,7 +154,7 @@ class RelinkUs(Crypter): #: Try to get info from web m = re.search(self.FILE_TITLE_REGEX, self.html) - if m: + if m is not None: title = m.group(1).strip() if not self.FILE_NOTITLE in title: name = folder = title @@ -172,14 +172,11 @@ class RelinkUs(Crypter): def handle_errors(self): if self.PASSWORD_ERROR_ROKEN in self.html: - msg = "Incorrect password, please set right password on 'Edit package' form and retry" - self.log_debug(msg) - self.fail(_(msg)) + self.fail(_("Wrong password")) if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: - self.captcha.invalid() - self.retry() + self.retry_captcha() else: self.captcha.correct() @@ -199,7 +196,7 @@ class RelinkUs(Crypter): self.log_debug("Search for CNL2 links") package_links = [] m = re.search(self.CNL2_FORM_REGEX, self.html, re.S) - if m: + if m is not None: cnl2_form = m.group(1) try: (vcrypted, vjk) = self._get_cipher_params(cnl2_form) @@ -216,7 +213,7 @@ class RelinkUs(Crypter): self.log_debug("Search for DLC links") package_links = [] m = re.search(self.DLC_LINK_REGEX, self.html) - if m: + if m is not None: container_url = self.DLC_DOWNLOAD_URL + "?id=%s&dlc=1" % self.fileid self.log_debug("Downloading DLC container link [%s]" % container_url) try: diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index e2b8471ab..29e1cce4f 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -47,24 +47,25 @@ class SafelinkingNet(Crypter): postData['link-password'] = self.get_password() if "altcaptcha" in self.html: - for _i in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captchaKey = m.group(1) - captcha = SolveMedia(self) - captchaProvider = "Solvemedia" - else: - self.fail(_("Error parsing captcha")) + m = re.search(self.SOLVEMEDIA_PATTERN, self.html) + if m is not None: + captchaKey = m.group(1) + captcha = SolveMedia(self) + captchaProvider = "Solvemedia" + else: + self.fail(_("Error parsing captcha")) + + response, challenge = captcha.challenge(captchaKey) + postData['adcopy_challenge'] = challenge + postData['adcopy_response'] = response + + self.html = self.load(url, post=postData) - response, challenge = captcha.challenge(captchaKey) - postData['adcopy_challenge'] = challenge - postData['adcopy_response'] = response + if "The CAPTCHA code you entered was wrong" in self.html: + self.retry_captcha() - self.html = self.load(url, post=postData) - if "The password you entered was incorrect" in self.html: - self.fail(_("Incorrect Password")) - if not "The CAPTCHA code you entered was wrong" in self.html: - break + if "The password you entered was incorrect" in self.html: + self.fail(_("Wrong password")) pyfile.package().password = "" soup = BeautifulSoup.BeautifulSoup(self.html) @@ -73,7 +74,7 @@ class SafelinkingNet(Crypter): if "d_links" in s.text: break m = re.search('d_links":(\[.*?\])', s.text) - if m: + if m is not None: linkDict = json_loads(m.group(1)) for link in linkDict: if not "http://" in link['full']: diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 3316aea56..e372d7c6a 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -66,14 +66,18 @@ class ShareLinksBiz(Crypter): def init_file(self, pyfile): url = pyfile.url + if 's2l.biz' in url: url = self.load(url, just_header=True)['location'] + if re.match(self.__pattern__, url): self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) self.file_id = re.match(self.__pattern__, url).group('ID') + else: self.log_debug("Could not initialize, URL [%s] does not match pattern [%s]" % (url, self.__pattern__)) - self.fail("Unsupported download link") + self.fail(_("Unsupported download link")) + self.package = pyfile.package() @@ -81,7 +85,8 @@ class ShareLinksBiz(Crypter): if "No usable content was found" in self.html: self.log_debug("File not found") return False - return True + else: + return True def is_password_protected(self): @@ -121,7 +126,8 @@ class ShareLinksBiz(Crypter): m = re.search(r'<img src="/captcha.gif\?d=(.+?)&PHPSESSID=(.+?)&legend=1"', self.html) if not m: self.log_debug("Captcha url data not found, maybe plugin out of date?") - self.fail("Captcha url data not found") + self.fail(_("Captcha url data not found")) + captchaUrl = self.base_url + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2)) self.log_debug("Waiting user for correct position") coords = self.captcha.decrypt(captchaUrl, input_type="gif", output_type='positional') @@ -130,8 +136,8 @@ class ShareLinksBiz(Crypter): #: Resolve captcha href = self._resolve_coords(coords, captchaMap) if href is None: - self.captcha.invalid() - self.retry(delay=5) + self.retry_captcha(wait=5) + url = self.base_url + href self.html = self.load(url) @@ -155,13 +161,11 @@ class ShareLinksBiz(Crypter): def handle_errors(self): if "The inserted password was wrong" in self.html: - self.log_debug("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(_("Wrong password")) if self.captcha: if "Your choice was wrong" in self.html: - self.captcha.invalid() - self.retry(delay=5) + self.retry_captcha(wait=5) else: self.captcha.correct() @@ -172,7 +176,7 @@ class ShareLinksBiz(Crypter): #: Extract from web package header title_re = r'<h2><img.*?/>(.*)</h2>' m = re.search(title_re, self.html, re.S) - if m: + if m is not None: title = m.group(1).strip() if 'unnamed' not in title: name = folder = title diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 19569ef31..f2d0e7c17 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -36,7 +36,7 @@ class UlozToFolder(Crypter): new_links.extend(re.findall(self.LINK_PATTERN, m.group(1))) m = re.search(self.NEXT_PAGE_PATTERN, html) - if m: + if m is not None: html = self.load("http://ulozto.net/" + m.group(1)) else: break |