diff options
Diffstat (limited to 'module/plugins/crypter/ShareLinksBiz.py')
-rw-r--r-- | module/plugins/crypter/ShareLinksBiz.py | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index e2ddfd926..2aa670a7e 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -3,9 +3,9 @@ import binascii import re -from Crypto.Cipher import AES +import Crypto.Cipher -from module.plugins.internal.Crypter import Crypter, create_getInfo +from module.plugins.internal.Crypter import Crypter class ShareLinksBiz(Crypter): @@ -15,10 +15,9 @@ class ShareLinksBiz(Crypter): __status__ = "testing" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P<ID>_?\w+)' - __config__ = [("activated" , "bool", "Activated" , True), - ("use_premium" , "bool", "Use premium account if available" , True), - ("use_subfolder" , "bool", "Save package to subfolder" , True), - ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] + __config__ = [("activated" , "bool" , "Activated" , True ), + ("use_premium" , "bool" , "Use premium account if available", True ), + ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default")] __description__ = """Share-Links.biz decrypter plugin""" __license__ = "GPLv3" @@ -53,17 +52,17 @@ class ShareLinksBiz(Crypter): self.handle_errors() #: Extract package links - package_links = [] - package_links.extend(self.handle_web_links()) - package_links.extend(self.handle_containers()) - package_links.extend(self.handle_CNL2()) - package_links = set(package_links) + pack_links = [] + pack_links.extend(self.handle_web_links()) + pack_links.extend(self.handle_containers()) + pack_links.extend(self.handle_CNL2()) + pack_links = set(pack_links) #: Get package info - package_name, package_folder = self.get_package_info() + pack_name, pack_folder = self.get_package_info() #: Pack - self.packages = [(package_name, package_links, package_folder)] + self.packages = [(pack_name, pack_links, pack_folder)] def init_file(self, pyfile): @@ -71,7 +70,7 @@ class ShareLinksBiz(Crypter): if 's2l.biz' in url: header = self.load(url, just_header=True) - + if not 'location' in header: self.fail(_("Unable to initialize download")) else: @@ -200,7 +199,7 @@ class ShareLinksBiz(Crypter): def handle_web_links(self): - package_links = [] + pack_links = [] self.log_debug("Handling Web links") #@TODO: Gather paginated web links @@ -226,16 +225,16 @@ class ShareLinksBiz(Crypter): self.log_debug("JsEngine returns value [%s] for redirection link" % dlLink) - package_links.append(dlLink) + pack_links.append(dlLink) except Exception, detail: self.log_debug("Error decrypting Web link [%s], %s" % (ID, detail)) - return package_links + return pack_links def handle_containers(self): - package_links = [] + pack_links = [] self.log_debug("Handling Container links") pattern = r'javascript:_get\(\'(.*?)\', 0, \'(rsdf|ccf|dlc)\'\)' @@ -243,23 +242,23 @@ class ShareLinksBiz(Crypter): self.log_debug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: link = "%s/get/%s/%s" % (self.base_url, containerLink[1], containerLink[0]) - package_links.append(link) - return package_links + pack_links.append(link) + return pack_links def handle_CNL2(self): - package_links = [] + pack_links = [] self.log_debug("Handling CNL2 links") if '/lib/cnl2/ClicknLoad.swf' in self.data: try: (crypted, jk) = self._get_cipher_params() - 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 _get_cipher_params(self): @@ -290,7 +289,7 @@ class ShareLinksBiz(Crypter): #: Decrypt Key = key IV = key - obj = AES.new(Key, AES.MODE_CBC, IV) + obj = Crypto.Cipher.AES.new(Key, Crypto.Cipher.AES.MODE_CBC, IV) text = obj.decrypt(crypted.decode('base64')) #: Extract links @@ -300,6 +299,3 @@ class ShareLinksBiz(Crypter): #: Log and return self.log_debug("Block has %d links" % len(links)) return links - - -getInfo = create_getInfo(ShareLinksBiz) |