diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-20 18:43:15 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-27 22:46:01 +0100 |
commit | 5deded62d94c04be64d34f6b67d07803eea9b6bf (patch) | |
tree | a33f82a6208b3a922bf5e1883f134a1fb86a9217 /module/plugins/crypter/NCryptIn.py | |
parent | Update addons (diff) | |
download | pyload-5deded62d94c04be64d34f6b67d07803eea9b6bf.tar.xz |
Spare code cosmetics
Diffstat (limited to 'module/plugins/crypter/NCryptIn.py')
-rw-r--r-- | module/plugins/crypter/NCryptIn.py | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 2ebdd5de8..c0e48ba25 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -43,13 +43,13 @@ class NCryptIn(Crypter): def decrypt(self, pyfile): #: Init self.package = pyfile.package() - package_links = [] - package_name = self.package.name + pack_links = [] + pack_name = self.package.name folder_name = self.package.folder #: Deal with single links if self.is_single_link(): - package_links.extend(self.handle_single_link()) + pack_links.extend(self.handle_single_link()) #: Deal with folders else: @@ -67,18 +67,18 @@ class NCryptIn(Crypter): self.handle_errors() #: Prepare package name and folder - (package_name, folder_name) = self.get_package_info() + (pack_name, folder_name) = self.get_package_info() #: Extract package links for link_source_type in self.links_source_order: - package_links.extend(self.handle_link_source(link_source_type)) - if package_links: #: Use only first source which provides links + pack_links.extend(self.handle_link_source(link_source_type)) + if pack_links: #: Use only first source which provides links break - package_links = set(package_links) + pack_links = set(pack_links) #: Pack and return links - if package_links: - self.packages = [(package_name, package_links, folder_name)] + if pack_links: + self.packages = [(pack_name, pack_links, folder_name)] def is_single_link(self): @@ -157,8 +157,8 @@ class NCryptIn(Crypter): self.log_debug("ReCaptcha protected") captcha_key = re.search(r'\?k=(.*?)"', form).group(1) self.log_debug("Resolving ReCaptcha with key [%s]" % captcha_key) - recaptcha = ReCaptcha(self) - response, challenge = recaptcha.challenge(captcha_key) + self.captcha = ReCaptcha(self.pyfile) + response, challenge = self.captcha.challenge(captcha_key) postData['recaptcha_challenge_field'] = challenge postData['recaptcha_response_field'] = response @@ -210,44 +210,44 @@ class NCryptIn(Crypter): def handle_single_link(self): self.log_debug("Handling Single link") - package_links = [] + pack_links = [] #: Decrypt single link decrypted_link = self.decrypt_link(self.pyfile.url) if decrypted_link: - package_links.append(decrypted_link) + pack_links.append(decrypted_link) - return package_links + return pack_links def handle_CNL2(self): self.log_debug("Handling CNL2 links") - package_links = [] + pack_links = [] if 'cnl2_output' in self.cleaned_html: try: (vcrypted, vjk) = self._get_cipher_params() for (crypted, jk) in zip(vcrypted, vjk): - package_links.extend(self._get_links(crypted, jk)) + pack_links.extend(self._get_links(crypted, jk)) except Exception: self.fail(_("Unable to decrypt CNL2 links")) - return package_links + return pack_links def handle_containers(self): self.log_debug("Handling Container links") - package_links = [] + pack_links = [] pattern = r'/container/(rsdf|dlc|ccf)/(\w+)' containersLinks = re.findall(pattern, self.data) self.log_debug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: link = "http://ncrypt.in/container/%s/%s.%s" % (containerLink[0], containerLink[1], containerLink[0]) - package_links.append(link) + pack_links.append(link) - return package_links + return pack_links def handle_web_links(self): @@ -255,15 +255,15 @@ class NCryptIn(Crypter): pattern = r'(http://ncrypt\.in/link-.*?=)' links = re.findall(pattern, self.data) - package_links = [] + pack_links = [] self.log_debug("Decrypting %d Web links" % len(links)) for i, link in enumerate(links): self.log_debug("Decrypting Web link %d, %s" % (i + 1, link)) decrypted_link = self.decrypt(link) if decrypted_link: - package_links.append(decrypted_link) + pack_links.append(decrypted_link) - return package_links + return pack_links def decrypt_link(self, link): |