prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Plugin DlProtectCom doesn't work
  Trying to download http://www.dl-protect.com/2C964B88 gives the rror 'NoneType' object has no attribute 'group' 0.00 B
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `module/plugins/crypter/DlProtectCom.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 
  3 import re
  4 import time
  5 
  6 from base64 import urlsafe_b64encode
  7 
  8 from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
  9 
  10 
  11 class DlProtectCom(SimpleCrypter):
  12     __name__    = "DlProtectCom"
  13     __type__    = "crypter"
  14     __version__ = "0.03"
  15 
  16     __pattern__ = r'https?://(?:www\.)?dl-protect\.com/((en|fr)/)?\w+'
  17     __config__  = [("use_premium"       , "bool", "Use premium account if available"   , True),
  18                    ("use_subfolder"     , "bool", "Save package to subfolder"          , True),
  19                    ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
  20 
  21     __description__ = """Dl-protect.com decrypter plugin"""
  22     __license__     = "GPLv3"
  23     __authors__     = [("Walter Purcaro", "vuolter@gmail.com")]
  24 
  25 
  26     COOKIES = [("dl-protect.com", "l", "en")]
  27 
  28     OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found'
  29 
  30 
  31     def getLinks(self):
  32         # Direct link with redirect
  33         if not re.match(r"https?://(?:www\.)?dl-protect\.com/.+", self.req.http.lastEffectiveURL):
  34             return [self.req.http.lastEffectiveURL]
  35 
  36         post_req = {'key'       : re.search(r'name="key" value="(.+?)"', self.html).group(1),
  37                     'submitform': ""}
  38 
  39         if "Please click on continue to see the content" in self.html:
  40             post_req['submitform'] = "Continue"
  41             self.wait(2)
  42 
  43         else:
  44             mstime  = int(round(time.time() * 1000))
  45             b64time = "_" + urlsafe_b64encode(str(mstime)).replace("=", "%3D")
  46 
  47             post_req.update({'i'         : b64time,
  48                              'submitform': "Decrypt+link"})
  49 
  50             if "Password :" in self.html:
  51                 post_req['pwd'] = self.getPassword()
  52 
  53             if "Security Code" in self.html:
  54                 captcha_id   = re.search(r'/captcha\.php\?uid=(.+?)"', self.html).group(1)
  55                 captcha_url  = "http://www.dl-protect.com/captcha.php?uid=" + captcha_id
  56                 captcha_code = self.decryptCaptcha(captcha_url, imgtype="gif")
  57 
  58                 post_req['secure'] = captcha_code
  59 
  60         self.html = self.load(self.pyfile.url, post=post_req)
  61 
  62         for errmsg in ("The password is incorrect", "The security code is incorrect"):
  63             if errmsg in self.html:
  64                 self.fail(_(errmsg[1:]))
  65 
  66         return re.findall(r'<a href="([^/].+?)" target="_blank">', self.html)
  67 
  68 
  69 getInfo = create_getInfo(DlProtectCom)
  70
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py
  --- a/module/plugins/crypter/DlProtectCom.py
  +++ b/module/plugins/crypter/DlProtectCom.py
  @@ -11,7 +11,7 @@
   class DlProtectCom(SimpleCrypter):
       __name__    = "DlProtectCom"
       __type__    = "crypter"
  -    __version__ = "0.03"
  +    __version__ = "0.04"
   
       __pattern__ = r'https?://(?:www\.)?dl-protect\.com/((en|fr)/)?\w+'
       __config__  = [("use_premium"       , "bool", "Use premium account if available"   , True),
  @@ -36,7 +36,7 @@
           post_req = {'key'       : re.search(r'name="key" value="(.+?)"', self.html).group(1),
                       'submitform': ""}
   
  -        if "Please click on continue to see the content" in self.html:
  +        if "Please click on continue to see the links" in self.html:
               post_req['submitform'] = "Continue"
               self.wait(2)
   
  @@ -51,11 +51,10 @@
                   post_req['pwd'] = self.getPassword()
   
               if "Security Code" in self.html:
  -                captcha_id   = re.search(r'/captcha\.php\?uid=(.+?)"', self.html).group(1)
  -                captcha_url  = "http://www.dl-protect.com/captcha.php?uid=" + captcha_id
  -                captcha_code = self.decryptCaptcha(captcha_url, imgtype="gif")
  -
  -                post_req['secure'] = captcha_code
  +                m = re.search(r'/captcha\.php\?key=(.+?)"', self.html)
  +                if m:
  +                    captcha_code = self.decryptCaptcha("http://www.dl-protect.com/captcha.php?key=" + m.group(1), imgtype="gif")
  +                    post_req['secure'] = captcha_code
   
           self.html = self.load(self.pyfile.url, post=post_req)
  
verification_info: {"golden_diff": "diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py\n--- a/module/plugins/crypter/DlProtectCom.py\n+++ b/module/plugins/crypter/DlProtectCom.py\n@@ -11,7 +11,7 @@\n class DlProtectCom(SimpleCrypter):\n     __name__    = \"DlProtectCom\"\n     __type__    = \"crypter\"\n-    __version__ = \"0.03\"\n+    __version__ = \"0.04\"\n \n     __pattern__ = r'https?://(?:www\\.)?dl-protect\\.com/((en|fr)/)?\\w+'\n     __config__  = [(\"use_premium\"       , \"bool\", \"Use premium account if available\"   , True),\n@@ -36,7 +36,7 @@\n         post_req = {'key'       : re.search(r'name=\"key\" value=\"(.+?)\"', self.html).group(1),\n                     'submitform': \"\"}\n \n-        if \"Please click on continue to see the content\" in self.html:\n+        if \"Please click on continue to see the links\" in self.html:\n             post_req['submitform'] = \"Continue\"\n             self.wait(2)\n \n@@ -51,11 +51,10 @@\n                 post_req['pwd'] = self.getPassword()\n \n             if \"Security Code\" in self.html:\n-                captcha_id   = re.search(r'/captcha\\.php\\?uid=(.+?)\"', self.html).group(1)\n-                captcha_url  = \"http://www.dl-protect.com/captcha.php?uid=\" + captcha_id\n-                captcha_code = self.decryptCaptcha(captcha_url, imgtype=\"gif\")\n-\n-                post_req['secure'] = captcha_code\n+                m = re.search(r'/captcha\\.php\\?key=(.+?)\"', self.html)\n+                if m:\n+                    captcha_code = self.decryptCaptcha(\"http://www.dl-protect.com/captcha.php?key=\" + m.group(1), imgtype=\"gif\")\n+                    post_req['secure'] = captcha_code\n \n         self.html = self.load(self.pyfile.url, post=post_req)\n", "issue": "Plugin DlProtectCom doesn't work\nTrying to download http://www.dl-protect.com/2C964B88 gives the rror 'NoneType' object has no attribute 'group' 0.00 B\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport re\nimport time\n\nfrom base64 import urlsafe_b64encode\n\nfrom module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo\n\n\nclass DlProtectCom(SimpleCrypter):\n    __name__    = \"DlProtectCom\"\n    __type__    = \"crypter\"\n    __version__ = \"0.03\"\n\n    __pattern__ = r'https?://(?:www\\.)?dl-protect\\.com/((en|fr)/)?\\w+'\n    __config__  = [(\"use_premium\"       , \"bool\", \"Use premium account if available\"   , True),\n                   (\"use_subfolder\"     , \"bool\", \"Save package to subfolder\"          , True),\n                   (\"subfolder_per_pack\", \"bool\", \"Create a subfolder for each package\", True)]\n\n    __description__ = \"\"\"Dl-protect.com decrypter plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"Walter Purcaro\", \"vuolter@gmail.com\")]\n\n\n    COOKIES = [(\"dl-protect.com\", \"l\", \"en\")]\n\n    OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found'\n\n\n    def getLinks(self):\n        # Direct link with redirect\n        if not re.match(r\"https?://(?:www\\.)?dl-protect\\.com/.+\", self.req.http.lastEffectiveURL):\n            return [self.req.http.lastEffectiveURL]\n\n        post_req = {'key'       : re.search(r'name=\"key\" value=\"(.+?)\"', self.html).group(1),\n                    'submitform': \"\"}\n\n        if \"Please click on continue to see the content\" in self.html:\n            post_req['submitform'] = \"Continue\"\n            self.wait(2)\n\n        else:\n            mstime  = int(round(time.time() * 1000))\n            b64time = \"_\" + urlsafe_b64encode(str(mstime)).replace(\"=\", \"%3D\")\n\n            post_req.update({'i'         : b64time,\n                             'submitform': \"Decrypt+link\"})\n\n            if \"Password :\" in self.html:\n                post_req['pwd'] = self.getPassword()\n\n            if \"Security Code\" in self.html:\n                captcha_id   = re.search(r'/captcha\\.php\\?uid=(.+?)\"', self.html).group(1)\n                captcha_url  = \"http://www.dl-protect.com/captcha.php?uid=\" + captcha_id\n                captcha_code = self.decryptCaptcha(captcha_url, imgtype=\"gif\")\n\n                post_req['secure'] = captcha_code\n\n        self.html = self.load(self.pyfile.url, post=post_req)\n\n        for errmsg in (\"The password is incorrect\", \"The security code is incorrect\"):\n            if errmsg in self.html:\n                self.fail(_(errmsg[1:]))\n\n        return re.findall(r'<a href=\"([^/].+?)\" target=\"_blank\">', self.html)\n\n\ngetInfo = create_getInfo(DlProtectCom)\n", "path": "module/plugins/crypter/DlProtectCom.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport re\nimport time\n\nfrom base64 import urlsafe_b64encode\n\nfrom module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo\n\n\nclass DlProtectCom(SimpleCrypter):\n    __name__    = \"DlProtectCom\"\n    __type__    = \"crypter\"\n    __version__ = \"0.04\"\n\n    __pattern__ = r'https?://(?:www\\.)?dl-protect\\.com/((en|fr)/)?\\w+'\n    __config__  = [(\"use_premium\"       , \"bool\", \"Use premium account if available\"   , True),\n                   (\"use_subfolder\"     , \"bool\", \"Save package to subfolder\"          , True),\n                   (\"subfolder_per_pack\", \"bool\", \"Create a subfolder for each package\", True)]\n\n    __description__ = \"\"\"Dl-protect.com decrypter plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"Walter Purcaro\", \"vuolter@gmail.com\")]\n\n\n    COOKIES = [(\"dl-protect.com\", \"l\", \"en\")]\n\n    OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found'\n\n\n    def getLinks(self):\n        # Direct link with redirect\n        if not re.match(r\"https?://(?:www\\.)?dl-protect\\.com/.+\", self.req.http.lastEffectiveURL):\n            return [self.req.http.lastEffectiveURL]\n\n        post_req = {'key'       : re.search(r'name=\"key\" value=\"(.+?)\"', self.html).group(1),\n                    'submitform': \"\"}\n\n        if \"Please click on continue to see the links\" in self.html:\n            post_req['submitform'] = \"Continue\"\n            self.wait(2)\n\n        else:\n            mstime  = int(round(time.time() * 1000))\n            b64time = \"_\" + urlsafe_b64encode(str(mstime)).replace(\"=\", \"%3D\")\n\n            post_req.update({'i'         : b64time,\n                             'submitform': \"Decrypt+link\"})\n\n            if \"Password :\" in self.html:\n                post_req['pwd'] = self.getPassword()\n\n            if \"Security Code\" in self.html:\n                m = re.search(r'/captcha\\.php\\?key=(.+?)\"', self.html)\n                if m:\n                    captcha_code = self.decryptCaptcha(\"http://www.dl-protect.com/captcha.php?key=\" + m.group(1), imgtype=\"gif\")\n                    post_req['secure'] = captcha_code\n\n        self.html = self.load(self.pyfile.url, post=post_req)\n\n        for errmsg in (\"The password is incorrect\", \"The security code is incorrect\"):\n            if errmsg in self.html:\n                self.fail(_(errmsg[1:]))\n\n        return re.findall(r'<a href=\"([^/].+?)\" target=\"_blank\">', self.html)\n\n\ngetInfo = create_getInfo(DlProtectCom)\n", "path": "module/plugins/crypter/DlProtectCom.py"}]}