prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Downloading from Oboom.com without premium ERROR
  It can't download the file. I get the Error "recaptcha html not found".
  Everything is up2date...:(
  
  
  --- 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/hoster/OboomCom.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 #
  3 # Test links:
  4 # https://www.oboom.com/B7CYZIEB/10Mio.dat
  5 
  6 import re
  7 
  8 from module.common.json_layer import json_loads
  9 from module.plugins.Hoster import Hoster
  10 from module.plugins.internal.CaptchaService import ReCaptcha
  11 
  12 
  13 class OboomCom(Hoster):
  14     __name__    = "OboomCom"
  15     __type__    = "hoster"
  16     __version__ = "0.31"
  17 
  18     __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P<ID>\w{8})'
  19 
  20     __description__ = """oboom.com hoster plugin"""
  21     __license__     = "GPLv3"
  22     __authors__     = [("stanley", "stanley.foerster@gmail.com")]
  23 
  24 
  25     RECAPTCHA_KEY = "6LdqpO0SAAAAAJGHXo63HyalP7H4qlRs_vff0kJX"
  26 
  27 
  28     def setup(self):
  29         self.chunkLimit = 1
  30         self.multiDL = self.resumeDownload = self.premium
  31 
  32 
  33     def process(self, pyfile):
  34         self.pyfile.url.replace(".com/#id=", ".com/#")
  35         self.pyfile.url.replace(".com/#/", ".com/#")
  36         self.getFileId(self.pyfile.url)
  37         self.getSessionToken()
  38         self.getFileInfo(self.sessionToken, self.fileId)
  39         self.pyfile.name = self.fileName
  40         self.pyfile.size = self.fileSize
  41         if not self.premium:
  42             self.solveCaptcha()
  43         self.getDownloadTicket()
  44         self.download("https://%s/1.0/dlh" % self.downloadDomain, get={"ticket": self.downloadTicket, "http_errors": 0})
  45 
  46 
  47     def loadUrl(self, url, get=None):
  48         if get is None:
  49             get = dict()
  50         return json_loads(self.load(url, get, decode=True))
  51 
  52 
  53     def getFileId(self, url):
  54         self.fileId = re.match(OboomCom.__pattern__, url).group('ID')
  55 
  56 
  57     def getSessionToken(self):
  58         if self.premium:
  59             accountInfo = self.account.getAccountInfo(self.user, True)
  60             if "session" in accountInfo:
  61                 self.sessionToken = accountInfo['session']
  62             else:
  63                 self.fail(_("Could not retrieve premium session"))
  64         else:
  65             apiUrl = "https://www.oboom.com/1.0/guestsession"
  66             result = self.loadUrl(apiUrl)
  67             if result[0] == 200:
  68                 self.sessionToken = result[1]
  69             else:
  70                 self.fail(_("Could not retrieve token for guest session. Error code: %s") % result[0])
  71 
  72 
  73     def solveCaptcha(self):
  74         recaptcha = ReCaptcha(self)
  75 
  76         for _i in xrange(5):
  77             response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY)
  78             apiUrl = "https://www.oboom.com/1.0/download/ticket"
  79             params = {"recaptcha_challenge_field": challenge,
  80                       "recaptcha_response_field": response,
  81                       "download_id": self.fileId,
  82                       "token": self.sessionToken}
  83             result = self.loadUrl(apiUrl, params)
  84 
  85             if result[0] == 200:
  86                 self.downloadToken = result[1]
  87                 self.downloadAuth = result[2]
  88                 self.correctCaptcha()
  89                 self.setWait(30)
  90                 self.wait()
  91                 break
  92 
  93             elif result[0] == 400:
  94                 if result[1] == "incorrect-captcha-sol":
  95                     self.invalidCaptcha()
  96                 elif result[1] == "captcha-timeout":
  97                     self.invalidCaptcha()
  98                 elif result[1] == "forbidden":
  99                     self.retry(5, 15 * 60, _("Service unavailable"))
  100 
  101             elif result[0] == 403:
  102                 if result[1] == -1:  # another download is running
  103                     self.setWait(15 * 60)
  104                 else:
  105                     self.setWait(result[1], True)
  106                 self.wait()
  107                 self.retry(5)
  108         else:
  109             self.invalidCaptcha()
  110             self.fail(_("Received invalid captcha 5 times"))
  111 
  112 
  113     def getFileInfo(self, token, fileId):
  114         apiUrl = "https://api.oboom.com/1.0/info"
  115         params = {"token": token, "items": fileId, "http_errors": 0}
  116 
  117         result = self.loadUrl(apiUrl, params)
  118         if result[0] == 200:
  119             item = result[1][0]
  120             if item['state'] == "online":
  121                 self.fileSize = item['size']
  122                 self.fileName = item['name']
  123             else:
  124                 self.offline()
  125         else:
  126             self.fail(_("Could not retrieve file info. Error code %s: %s") % (result[0], result[1]))
  127 
  128 
  129     def getDownloadTicket(self):
  130         apiUrl = "https://api.oboom.com/1/dl"
  131         params = {"item": self.fileId, "http_errors": 0}
  132         if self.premium:
  133             params['token'] = self.sessionToken
  134         else:
  135             params['token'] = self.downloadToken
  136             params['auth'] = self.downloadAuth
  137 
  138         result = self.loadUrl(apiUrl, params)
  139         if result[0] == 200:
  140             self.downloadDomain = result[1]
  141             self.downloadTicket = result[2]
  142         elif result[0] == 421:
  143             self.retry(wait_time=result[2] + 60, reason=_("Connection limit exceeded"))
  144         else:
  145             self.fail(_("Could not retrieve download ticket. Error code: %s") % result[0])
  146
  ```
  --- 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/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py
  --- a/module/plugins/hoster/OboomCom.py
  +++ b/module/plugins/hoster/OboomCom.py
  @@ -13,9 +13,9 @@
   class OboomCom(Hoster):
       __name__    = "OboomCom"
       __type__    = "hoster"
  -    __version__ = "0.31"
  +    __version__ = "0.32"
   
  -    __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P<ID>\w{8})'
  +    __pattern__ = r'https?://(?:www\.)?oboom\.com/(?:#(?:id=|/)?)?(?P<ID>\w{8})'
   
       __description__ = """oboom.com hoster plugin"""
       __license__     = "GPLv3"
  @@ -33,6 +33,7 @@
       def process(self, pyfile):
           self.pyfile.url.replace(".com/#id=", ".com/#")
           self.pyfile.url.replace(".com/#/", ".com/#")
  +        self.html = self.load(pyfile.url)
           self.getFileId(self.pyfile.url)
           self.getSessionToken()
           self.getFileInfo(self.sessionToken, self.fileId)
  
verification_info: {"golden_diff": "diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py\n--- a/module/plugins/hoster/OboomCom.py\n+++ b/module/plugins/hoster/OboomCom.py\n@@ -13,9 +13,9 @@\n class OboomCom(Hoster):\n     __name__    = \"OboomCom\"\n     __type__    = \"hoster\"\n-    __version__ = \"0.31\"\n+    __version__ = \"0.32\"\n \n-    __pattern__ = r'https?://(?:www\\.)?oboom\\.com/(#(id=|/)?)?(?P<ID>\\w{8})'\n+    __pattern__ = r'https?://(?:www\\.)?oboom\\.com/(?:#(?:id=|/)?)?(?P<ID>\\w{8})'\n \n     __description__ = \"\"\"oboom.com hoster plugin\"\"\"\n     __license__     = \"GPLv3\"\n@@ -33,6 +33,7 @@\n     def process(self, pyfile):\n         self.pyfile.url.replace(\".com/#id=\", \".com/#\")\n         self.pyfile.url.replace(\".com/#/\", \".com/#\")\n+        self.html = self.load(pyfile.url)\n         self.getFileId(self.pyfile.url)\n         self.getSessionToken()\n         self.getFileInfo(self.sessionToken, self.fileId)\n", "issue": "Downloading from Oboom.com without premium ERROR\nIt can't download the file. I get the Error \"recaptcha html not found\".\nEverything is up2date...:(\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Test links:\n# https://www.oboom.com/B7CYZIEB/10Mio.dat\n\nimport re\n\nfrom module.common.json_layer import json_loads\nfrom module.plugins.Hoster import Hoster\nfrom module.plugins.internal.CaptchaService import ReCaptcha\n\n\nclass OboomCom(Hoster):\n    __name__    = \"OboomCom\"\n    __type__    = \"hoster\"\n    __version__ = \"0.31\"\n\n    __pattern__ = r'https?://(?:www\\.)?oboom\\.com/(#(id=|/)?)?(?P<ID>\\w{8})'\n\n    __description__ = \"\"\"oboom.com hoster plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"stanley\", \"stanley.foerster@gmail.com\")]\n\n\n    RECAPTCHA_KEY = \"6LdqpO0SAAAAAJGHXo63HyalP7H4qlRs_vff0kJX\"\n\n\n    def setup(self):\n        self.chunkLimit = 1\n        self.multiDL = self.resumeDownload = self.premium\n\n\n    def process(self, pyfile):\n        self.pyfile.url.replace(\".com/#id=\", \".com/#\")\n        self.pyfile.url.replace(\".com/#/\", \".com/#\")\n        self.getFileId(self.pyfile.url)\n        self.getSessionToken()\n        self.getFileInfo(self.sessionToken, self.fileId)\n        self.pyfile.name = self.fileName\n        self.pyfile.size = self.fileSize\n        if not self.premium:\n            self.solveCaptcha()\n        self.getDownloadTicket()\n        self.download(\"https://%s/1.0/dlh\" % self.downloadDomain, get={\"ticket\": self.downloadTicket, \"http_errors\": 0})\n\n\n    def loadUrl(self, url, get=None):\n        if get is None:\n            get = dict()\n        return json_loads(self.load(url, get, decode=True))\n\n\n    def getFileId(self, url):\n        self.fileId = re.match(OboomCom.__pattern__, url).group('ID')\n\n\n    def getSessionToken(self):\n        if self.premium:\n            accountInfo = self.account.getAccountInfo(self.user, True)\n            if \"session\" in accountInfo:\n                self.sessionToken = accountInfo['session']\n            else:\n                self.fail(_(\"Could not retrieve premium session\"))\n        else:\n            apiUrl = \"https://www.oboom.com/1.0/guestsession\"\n            result = self.loadUrl(apiUrl)\n            if result[0] == 200:\n                self.sessionToken = result[1]\n            else:\n                self.fail(_(\"Could not retrieve token for guest session. Error code: %s\") % result[0])\n\n\n    def solveCaptcha(self):\n        recaptcha = ReCaptcha(self)\n\n        for _i in xrange(5):\n            response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY)\n            apiUrl = \"https://www.oboom.com/1.0/download/ticket\"\n            params = {\"recaptcha_challenge_field\": challenge,\n                      \"recaptcha_response_field\": response,\n                      \"download_id\": self.fileId,\n                      \"token\": self.sessionToken}\n            result = self.loadUrl(apiUrl, params)\n\n            if result[0] == 200:\n                self.downloadToken = result[1]\n                self.downloadAuth = result[2]\n                self.correctCaptcha()\n                self.setWait(30)\n                self.wait()\n                break\n\n            elif result[0] == 400:\n                if result[1] == \"incorrect-captcha-sol\":\n                    self.invalidCaptcha()\n                elif result[1] == \"captcha-timeout\":\n                    self.invalidCaptcha()\n                elif result[1] == \"forbidden\":\n                    self.retry(5, 15 * 60, _(\"Service unavailable\"))\n\n            elif result[0] == 403:\n                if result[1] == -1:  # another download is running\n                    self.setWait(15 * 60)\n                else:\n                    self.setWait(result[1], True)\n                self.wait()\n                self.retry(5)\n        else:\n            self.invalidCaptcha()\n            self.fail(_(\"Received invalid captcha 5 times\"))\n\n\n    def getFileInfo(self, token, fileId):\n        apiUrl = \"https://api.oboom.com/1.0/info\"\n        params = {\"token\": token, \"items\": fileId, \"http_errors\": 0}\n\n        result = self.loadUrl(apiUrl, params)\n        if result[0] == 200:\n            item = result[1][0]\n            if item['state'] == \"online\":\n                self.fileSize = item['size']\n                self.fileName = item['name']\n            else:\n                self.offline()\n        else:\n            self.fail(_(\"Could not retrieve file info. Error code %s: %s\") % (result[0], result[1]))\n\n\n    def getDownloadTicket(self):\n        apiUrl = \"https://api.oboom.com/1/dl\"\n        params = {\"item\": self.fileId, \"http_errors\": 0}\n        if self.premium:\n            params['token'] = self.sessionToken\n        else:\n            params['token'] = self.downloadToken\n            params['auth'] = self.downloadAuth\n\n        result = self.loadUrl(apiUrl, params)\n        if result[0] == 200:\n            self.downloadDomain = result[1]\n            self.downloadTicket = result[2]\n        elif result[0] == 421:\n            self.retry(wait_time=result[2] + 60, reason=_(\"Connection limit exceeded\"))\n        else:\n            self.fail(_(\"Could not retrieve download ticket. Error code: %s\") % result[0])\n", "path": "module/plugins/hoster/OboomCom.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Test links:\n# https://www.oboom.com/B7CYZIEB/10Mio.dat\n\nimport re\n\nfrom module.common.json_layer import json_loads\nfrom module.plugins.Hoster import Hoster\nfrom module.plugins.internal.CaptchaService import ReCaptcha\n\n\nclass OboomCom(Hoster):\n    __name__    = \"OboomCom\"\n    __type__    = \"hoster\"\n    __version__ = \"0.32\"\n\n    __pattern__ = r'https?://(?:www\\.)?oboom\\.com/(?:#(?:id=|/)?)?(?P<ID>\\w{8})'\n\n    __description__ = \"\"\"oboom.com hoster plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"stanley\", \"stanley.foerster@gmail.com\")]\n\n\n    RECAPTCHA_KEY = \"6LdqpO0SAAAAAJGHXo63HyalP7H4qlRs_vff0kJX\"\n\n\n    def setup(self):\n        self.chunkLimit = 1\n        self.multiDL = self.resumeDownload = self.premium\n\n\n    def process(self, pyfile):\n        self.pyfile.url.replace(\".com/#id=\", \".com/#\")\n        self.pyfile.url.replace(\".com/#/\", \".com/#\")\n        self.html = self.load(pyfile.url)\n        self.getFileId(self.pyfile.url)\n        self.getSessionToken()\n        self.getFileInfo(self.sessionToken, self.fileId)\n        self.pyfile.name = self.fileName\n        self.pyfile.size = self.fileSize\n        if not self.premium:\n            self.solveCaptcha()\n        self.getDownloadTicket()\n        self.download(\"https://%s/1.0/dlh\" % self.downloadDomain, get={\"ticket\": self.downloadTicket, \"http_errors\": 0})\n\n\n    def loadUrl(self, url, get=None):\n        if get is None:\n            get = dict()\n        return json_loads(self.load(url, get, decode=True))\n\n\n    def getFileId(self, url):\n        self.fileId = re.match(OboomCom.__pattern__, url).group('ID')\n\n\n    def getSessionToken(self):\n        if self.premium:\n            accountInfo = self.account.getAccountInfo(self.user, True)\n            if \"session\" in accountInfo:\n                self.sessionToken = accountInfo['session']\n            else:\n                self.fail(_(\"Could not retrieve premium session\"))\n        else:\n            apiUrl = \"https://www.oboom.com/1.0/guestsession\"\n            result = self.loadUrl(apiUrl)\n            if result[0] == 200:\n                self.sessionToken = result[1]\n            else:\n                self.fail(_(\"Could not retrieve token for guest session. Error code: %s\") % result[0])\n\n\n    def solveCaptcha(self):\n        recaptcha = ReCaptcha(self)\n\n        for _i in xrange(5):\n            response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY)\n            apiUrl = \"https://www.oboom.com/1.0/download/ticket\"\n            params = {\"recaptcha_challenge_field\": challenge,\n                      \"recaptcha_response_field\": response,\n                      \"download_id\": self.fileId,\n                      \"token\": self.sessionToken}\n            result = self.loadUrl(apiUrl, params)\n\n            if result[0] == 200:\n                self.downloadToken = result[1]\n                self.downloadAuth = result[2]\n                self.correctCaptcha()\n                self.setWait(30)\n                self.wait()\n                break\n\n            elif result[0] == 400:\n                if result[1] == \"incorrect-captcha-sol\":\n                    self.invalidCaptcha()\n                elif result[1] == \"captcha-timeout\":\n                    self.invalidCaptcha()\n                elif result[1] == \"forbidden\":\n                    self.retry(5, 15 * 60, _(\"Service unavailable\"))\n\n            elif result[0] == 403:\n                if result[1] == -1:  # another download is running\n                    self.setWait(15 * 60)\n                else:\n                    self.setWait(result[1], True)\n                self.wait()\n                self.retry(5)\n        else:\n            self.invalidCaptcha()\n            self.fail(_(\"Received invalid captcha 5 times\"))\n\n\n    def getFileInfo(self, token, fileId):\n        apiUrl = \"https://api.oboom.com/1.0/info\"\n        params = {\"token\": token, \"items\": fileId, \"http_errors\": 0}\n\n        result = self.loadUrl(apiUrl, params)\n        if result[0] == 200:\n            item = result[1][0]\n            if item['state'] == \"online\":\n                self.fileSize = item['size']\n                self.fileName = item['name']\n            else:\n                self.offline()\n        else:\n            self.fail(_(\"Could not retrieve file info. Error code %s: %s\") % (result[0], result[1]))\n\n\n    def getDownloadTicket(self):\n        apiUrl = \"https://api.oboom.com/1/dl\"\n        params = {\"item\": self.fileId, \"http_errors\": 0}\n        if self.premium:\n            params['token'] = self.sessionToken\n        else:\n            params['token'] = self.downloadToken\n            params['auth'] = self.downloadAuth\n\n        result = self.loadUrl(apiUrl, params)\n        if result[0] == 200:\n            self.downloadDomain = result[1]\n            self.downloadTicket = result[2]\n        elif result[0] == 421:\n            self.retry(wait_time=result[2] + 60, reason=_(\"Connection limit exceeded\"))\n        else:\n            self.fail(_(\"Could not retrieve download ticket. Error code: %s\") % result[0])\n", "path": "module/plugins/hoster/OboomCom.py"}]}