prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  cdnbg can't open new BNT links
  ## Bug Report
  - [x] This is a bug report and I have read the contribution guidelines.
  
  
  ### Description
  There have been changes to the bnt.bg live channel links, which have made them unrecognizable by the cdnbg plugin.
  **Note:** Streamlink can still open these links, which are now hidden away in a small part of the website and are not protected by an SSL certificate:
  ```
  http://tv.bnt.bg/bnt1
  http://tv.bnt.bg/bnt2
  http://tv.bnt.bg/bnt3
  http://tv.bnt.bg/bnt4
  ```
  
  **Other plugin issues:**
  1. https://mmtvmusic.com/live/ has moved away to another service provider and hence can be deleted from cdnbg. Can't be opened with anything else atm.
  2. https://chernomore.bg/ can be removed - the owner of the media group closed down the newspaper and television and converted the website into an information agency.
  ### Expected / Actual behavior
  When I input them through CLI, they should open.
  
  
  ### Reproduction steps / Explicit stream URLs to test
  ```
  streamlink https://bnt.bg/live best
  streamlink https://bnt.bg/live/bnt1 best
  streamlink https://bnt.bg/live/bnt2 best
  streamlink https://bnt.bg/live/bnt3 best
  streamlink https://bnt.bg/live/bnt4 best
  ```
  
  
  ### Log output
  ```
  C:\Users\XXXX> streamlink https://bnt.bg/live/bnt1 best --loglevel debug
  [cli][debug] OS:             Windows 7
  [cli][debug] Python:       3.6.6
  [cli][debug] Streamlink:  1.6.0
  [cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
  error: No plugin can handle URL: https://bnt.bg/live/bnt1
  ```
  
  </issue>
  <code>
  [start of src/streamlink/plugins/cdnbg.py]
  1 import logging
  2 import re
  3 
  4 from streamlink.compat import urlparse
  5 from streamlink.plugin import Plugin
  6 from streamlink.plugin.api import useragents
  7 from streamlink.plugin.api import validate
  8 from streamlink.stream import HLSStream
  9 from streamlink.utils import update_scheme
  10 
  11 log = logging.getLogger(__name__)
  12 
  13 
  14 class CDNBG(Plugin):
  15     url_re = re.compile(r"""
  16         https?://(?:www\.)?(?:
  17             tv\.bnt\.bg/\w+(?:/\w+)?|
  18             nova\.bg/live|
  19             bgonair\.bg/tvonline|
  20             mmtvmusic\.com/live|
  21             mu-vi\.tv/LiveStreams/pages/Live\.aspx|
  22             live\.bstv\.bg|
  23             bloombergtv.bg/video|
  24             armymedia.bg|
  25             chernomore.bg|
  26             i.cdn.bg/live/
  27         )/?
  28     """, re.VERBOSE)
  29     iframe_re = re.compile(r"iframe .*?src=\"((?:https?(?::|&#58;))?//(?:\w+\.)?cdn.bg/live[^\"]+)\"", re.DOTALL)
  30     sdata_re = re.compile(r"sdata\.src.*?=.*?(?P<q>[\"'])(?P<url>http.*?)(?P=q)")
  31     hls_file_re = re.compile(r"(src|file): (?P<q>[\"'])(?P<url>(https?:)?//.+?m3u8.*?)(?P=q)")
  32     hls_src_re = re.compile(r"video src=(?P<url>http[^ ]+m3u8[^ ]*)")
  33 
  34     stream_schema = validate.Schema(
  35         validate.any(
  36             validate.all(validate.transform(sdata_re.search), validate.get("url")),
  37             validate.all(validate.transform(hls_file_re.search), validate.get("url")),
  38             validate.all(validate.transform(hls_src_re.search), validate.get("url")),
  39         )
  40     )
  41 
  42     @classmethod
  43     def can_handle_url(cls, url):
  44         return cls.url_re.match(url) is not None
  45 
  46     def find_iframe(self, url):
  47         self.session.http.headers.update({"User-Agent": useragents.CHROME})
  48         res = self.session.http.get(self.url)
  49         p = urlparse(url)
  50         for iframe_url in self.iframe_re.findall(res.text):
  51             if "googletagmanager" not in iframe_url:
  52                 log.debug("Found iframe: {0}", iframe_url)
  53                 iframe_url = iframe_url.replace("&#58;", ":")
  54                 if iframe_url.startswith("//"):
  55                     return "{0}:{1}".format(p.scheme, iframe_url)
  56                 else:
  57                     return iframe_url
  58 
  59     def _get_streams(self):
  60         if "i.cdn.bg/live/" in self.url:
  61             iframe_url = self.url
  62         else:
  63             iframe_url = self.find_iframe(self.url)
  64 
  65         if iframe_url:
  66             res = self.session.http.get(iframe_url, headers={"Referer": self.url})
  67             stream_url = update_scheme(self.url, self.stream_schema.validate(res.text))
  68             log.warning("SSL Verification disabled.")
  69             return HLSStream.parse_variant_playlist(self.session,
  70                                                     stream_url,
  71                                                     verify=False)
  72 
  73 
  74 __plugin__ = CDNBG
  75
  [end of src/streamlink/plugins/cdnbg.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/streamlink/plugins/cdnbg.py b/src/streamlink/plugins/cdnbg.py
  --- a/src/streamlink/plugins/cdnbg.py
  +++ b/src/streamlink/plugins/cdnbg.py
  @@ -14,16 +14,14 @@
   class CDNBG(Plugin):
       url_re = re.compile(r"""
           https?://(?:www\.)?(?:
  -            tv\.bnt\.bg/\w+(?:/\w+)?|
  -            nova\.bg/live|
  +            armymedia\.bg|
               bgonair\.bg/tvonline|
  -            mmtvmusic\.com/live|
  -            mu-vi\.tv/LiveStreams/pages/Live\.aspx|
  +            bloombergtv\.bg/video|
  +            (?:tv\.)?bnt\.bg/\w+(?:/\w+)?|
               live\.bstv\.bg|
  -            bloombergtv.bg/video|
  -            armymedia.bg|
  -            chernomore.bg|
  -            i.cdn.bg/live/
  +            i\.cdn\.bg/live/|
  +            nova\.bg/live|
  +            mu-vi\.tv/LiveStreams/pages/Live\.aspx
           )/?
       """, re.VERBOSE)
       iframe_re = re.compile(r"iframe .*?src=\"((?:https?(?::|&#58;))?//(?:\w+\.)?cdn.bg/live[^\"]+)\"", re.DOTALL)
  @@ -52,7 +50,7 @@
                   log.debug("Found iframe: {0}", iframe_url)
                   iframe_url = iframe_url.replace("&#58;", ":")
                   if iframe_url.startswith("//"):
  -                    return "{0}:{1}".format(p.scheme, iframe_url)
  +                    return update_scheme(p.scheme, iframe_url)
                   else:
                       return iframe_url
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/cdnbg.py b/src/streamlink/plugins/cdnbg.py\n--- a/src/streamlink/plugins/cdnbg.py\n+++ b/src/streamlink/plugins/cdnbg.py\n@@ -14,16 +14,14 @@\n class CDNBG(Plugin):\n     url_re = re.compile(r\"\"\"\n         https?://(?:www\\.)?(?:\n-            tv\\.bnt\\.bg/\\w+(?:/\\w+)?|\n-            nova\\.bg/live|\n+            armymedia\\.bg|\n             bgonair\\.bg/tvonline|\n-            mmtvmusic\\.com/live|\n-            mu-vi\\.tv/LiveStreams/pages/Live\\.aspx|\n+            bloombergtv\\.bg/video|\n+            (?:tv\\.)?bnt\\.bg/\\w+(?:/\\w+)?|\n             live\\.bstv\\.bg|\n-            bloombergtv.bg/video|\n-            armymedia.bg|\n-            chernomore.bg|\n-            i.cdn.bg/live/\n+            i\\.cdn\\.bg/live/|\n+            nova\\.bg/live|\n+            mu-vi\\.tv/LiveStreams/pages/Live\\.aspx\n         )/?\n     \"\"\", re.VERBOSE)\n     iframe_re = re.compile(r\"iframe .*?src=\\\"((?:https?(?::|&#58;))?//(?:\\w+\\.)?cdn.bg/live[^\\\"]+)\\\"\", re.DOTALL)\n@@ -52,7 +50,7 @@\n                 log.debug(\"Found iframe: {0}\", iframe_url)\n                 iframe_url = iframe_url.replace(\"&#58;\", \":\")\n                 if iframe_url.startswith(\"//\"):\n-                    return \"{0}:{1}\".format(p.scheme, iframe_url)\n+                    return update_scheme(p.scheme, iframe_url)\n                 else:\n                     return iframe_url\n", "issue": "cdnbg can't open new BNT links\n## Bug Report\r\n- [x] This is a bug report and I have read the contribution guidelines.\r\n\r\n\r\n### Description\r\nThere have been changes to the bnt.bg live channel links, which have made them unrecognizable by the cdnbg plugin.\r\n**Note:** Streamlink can still open these links, which are now hidden away in a small part of the website and are not protected by an SSL certificate:\r\n```\r\nhttp://tv.bnt.bg/bnt1\r\nhttp://tv.bnt.bg/bnt2\r\nhttp://tv.bnt.bg/bnt3\r\nhttp://tv.bnt.bg/bnt4\r\n```\r\n\r\n**Other plugin issues:**\r\n1. https://mmtvmusic.com/live/ has moved away to another service provider and hence can be deleted from cdnbg. Can't be opened with anything else atm.\r\n2. https://chernomore.bg/ can be removed - the owner of the media group closed down the newspaper and television and converted the website into an information agency.\r\n### Expected / Actual behavior\r\nWhen I input them through CLI, they should open.\r\n\r\n\r\n### Reproduction steps / Explicit stream URLs to test\r\n```\r\nstreamlink https://bnt.bg/live best\r\nstreamlink https://bnt.bg/live/bnt1 best\r\nstreamlink https://bnt.bg/live/bnt2 best\r\nstreamlink https://bnt.bg/live/bnt3 best\r\nstreamlink https://bnt.bg/live/bnt4 best\r\n```\r\n\r\n\r\n### Log output\r\n```\r\nC:\\Users\\XXXX> streamlink https://bnt.bg/live/bnt1 best --loglevel debug\r\n[cli][debug] OS:             Windows 7\r\n[cli][debug] Python:       3.6.6\r\n[cli][debug] Streamlink:  1.6.0\r\n[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)\r\nerror: No plugin can handle URL: https://bnt.bg/live/bnt1\r\n```\n", "before_files": [{"content": "import logging\nimport re\n\nfrom streamlink.compat import urlparse\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import useragents\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream import HLSStream\nfrom streamlink.utils import update_scheme\n\nlog = logging.getLogger(__name__)\n\n\nclass CDNBG(Plugin):\n    url_re = re.compile(r\"\"\"\n        https?://(?:www\\.)?(?:\n            tv\\.bnt\\.bg/\\w+(?:/\\w+)?|\n            nova\\.bg/live|\n            bgonair\\.bg/tvonline|\n            mmtvmusic\\.com/live|\n            mu-vi\\.tv/LiveStreams/pages/Live\\.aspx|\n            live\\.bstv\\.bg|\n            bloombergtv.bg/video|\n            armymedia.bg|\n            chernomore.bg|\n            i.cdn.bg/live/\n        )/?\n    \"\"\", re.VERBOSE)\n    iframe_re = re.compile(r\"iframe .*?src=\\\"((?:https?(?::|&#58;))?//(?:\\w+\\.)?cdn.bg/live[^\\\"]+)\\\"\", re.DOTALL)\n    sdata_re = re.compile(r\"sdata\\.src.*?=.*?(?P<q>[\\\"'])(?P<url>http.*?)(?P=q)\")\n    hls_file_re = re.compile(r\"(src|file): (?P<q>[\\\"'])(?P<url>(https?:)?//.+?m3u8.*?)(?P=q)\")\n    hls_src_re = re.compile(r\"video src=(?P<url>http[^ ]+m3u8[^ ]*)\")\n\n    stream_schema = validate.Schema(\n        validate.any(\n            validate.all(validate.transform(sdata_re.search), validate.get(\"url\")),\n            validate.all(validate.transform(hls_file_re.search), validate.get(\"url\")),\n            validate.all(validate.transform(hls_src_re.search), validate.get(\"url\")),\n        )\n    )\n\n    @classmethod\n    def can_handle_url(cls, url):\n        return cls.url_re.match(url) is not None\n\n    def find_iframe(self, url):\n        self.session.http.headers.update({\"User-Agent\": useragents.CHROME})\n        res = self.session.http.get(self.url)\n        p = urlparse(url)\n        for iframe_url in self.iframe_re.findall(res.text):\n            if \"googletagmanager\" not in iframe_url:\n                log.debug(\"Found iframe: {0}\", iframe_url)\n                iframe_url = iframe_url.replace(\"&#58;\", \":\")\n                if iframe_url.startswith(\"//\"):\n                    return \"{0}:{1}\".format(p.scheme, iframe_url)\n                else:\n                    return iframe_url\n\n    def _get_streams(self):\n        if \"i.cdn.bg/live/\" in self.url:\n            iframe_url = self.url\n        else:\n            iframe_url = self.find_iframe(self.url)\n\n        if iframe_url:\n            res = self.session.http.get(iframe_url, headers={\"Referer\": self.url})\n            stream_url = update_scheme(self.url, self.stream_schema.validate(res.text))\n            log.warning(\"SSL Verification disabled.\")\n            return HLSStream.parse_variant_playlist(self.session,\n                                                    stream_url,\n                                                    verify=False)\n\n\n__plugin__ = CDNBG\n", "path": "src/streamlink/plugins/cdnbg.py"}]}