diff options
| -rw-r--r-- | module/plugins/crypter/DlProtectCom.py | 53 | 
1 files changed, 53 insertions, 0 deletions
| diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 10993d729..81b1cda86 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -3,6 +3,7 @@  import re  import time +import base64  from base64 import urlsafe_b64encode  from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo @@ -30,6 +31,56 @@ class DlProtectCom(SimpleCrypter):      OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found' +    # Information decoding +    # For test purposes +    def info_decode(self, i): +        # Remove end string +        assert i.endswith("_%3D") +        i = i[0:-4] +        # Invert string +        i = i[::-1] +        # Base 64 decode +        i = base64.b64decode(i) +        # Split information +        infos = i.split('|') +        assert(len(infos) == 4) +        res = infos[0] +        user_agent = infos[1] +        plugins = [x.split(';') for x in infos[2].split('&')] +        java = {"ENABLE": True, "DISABLE":False}[infos[3]] +        # Return information +        return {'res':res, +                'user_agent':user_agent, +                'plugins':plugins, +                'java':java} + +    # Information encoding +    def info_encode(self, info): +        # Pack information +        res = info['res'] +        user_agent = info['user_agent'] +        plugins = '&'.join(';'.join(x) for x in info['plugins']) +        java = {True:"ENABLE", False:"DISABLE"}[info['java']] +        i = '|'.join([res, user_agent, plugins, java]) +        # Base 64 encode +        i = base64.b64encode(i) +        # Invert string +        i = i[::-1] +        # Add end string and return +        i = i + "_%3D" +        return i + +    # Sample configuration +    def conf(self): +        useragent = self.get_config('useragent', plugin="UserAgentSwitcher") +        conf = {'res': '1280x611x24', +                'java': True, +                'user_agent': useragent, +                'plugins': [['Adobe Acrobat', 'nppdf32.dll', 'Adobe PDF Plug-In For Firefox and Netscape 11.0.13', '11.0.13.17'], +                            ['Adobe Acrobat', 'nppdf32.dll', 'Adobe PDF Plug-In For Firefox and Netscape 11.0.13', '11.0.13.17'], +                            ['Java(TM) Platform SE 8 U51', 'npjp2.dll', 'Next Generation Java Plug-in 11.51.2 for Mozilla browsers', '11.51.2.16'], +                            ['Shockwave Flash', 'NPSWF32_19_0_0_226.dll', 'Shockwave Flash 19.0 r0', '19.0.0.226']]} +        return conf      def get_links(self):          #: Direct link with redirect @@ -42,6 +93,7 @@ class DlProtectCom(SimpleCrypter):          if "Please click on continue to see the links" in self.data:              post_req['submitform'] = "Continue" +            post_req['i'] = self.info_encode(self.conf())              self.wait(2)          else: @@ -65,6 +117,7 @@ class DlProtectCom(SimpleCrypter):          self.data = self.load(self.pyfile.url, post=post_req) +        # Check error messages in pages          for errmsg in ("The password is incorrect", "The security code is incorrect"):              if errmsg in self.data:                  self.fail(_(errmsg[1:])) | 
