We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
plugins.cdnbg: can't load tv.bnt.bg/bnt3 (Unable to validate response text)
### Checklist

- [X] This is a plugin issue and not a different kind of issue
- [X] [I have read the contribution guidelines](https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink)
- [X] [I have checked the list of open and recently closed plugin issues](https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22)
- [X] [I have checked the commit log of the master branch](https://github.com/streamlink/streamlink/commits/master)

### Streamlink version

Latest build from the master branch

### Description

Can't load tv.bnt.bg/bnt3 or any of this tv.bnt.bg/bnt2 and tv.bnt.bg/bnt.

### Debug log

```text
streamlink --loglevel debug "http://tv.bnt.bg/bnt3" best
[cli][debug] OS:         Linux-5.15.0-56-generic-x86_64-with-glibc2.29
[cli][debug] Python:     3.8.10
[cli][debug] Streamlink: 5.1.2+9.g5639a065
[cli][debug] Dependencies:
[cli][debug]  certifi: 2020.12.5
[cli][debug]  isodate: 0.6.1
[cli][debug]  lxml: 4.9.1
[cli][debug]  pycountry: 22.3.5
[cli][debug]  pycryptodome: 3.15.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.28.1
[cli][debug]  urllib3: 1.26.12
[cli][debug]  websocket-client: 1.4.1
[cli][debug] Arguments:
[cli][debug]  url=http://tv.bnt.bg/bnt3
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][info] Found matching plugin cdnbg for URL http://tv.bnt.bg/bnt3
[plugins.cdnbg][debug] Found iframe: https://i.cdn.bg/live/OQ70Ds9Lcp
error: Unable to validate response text: ValidationError(AnySchema):
  ValidationError(RegexSchema):
    Pattern 'sdata\\.src.*?=.*?(?P<q>[\\"\'])(?P<url>http.*?)(?P=q)' did not match <'<!doctype html>\n<html>\n\n<head>\n\n    <meta charset...>
  ValidationError(RegexSchema):
    Pattern <'(src|file): (?P<q>[\\"\'])(?P<url>(https?:)?//.+?m3u8....> did not match <'<!doctype html>\n<html>\n\n<head>\n\n    <meta charset...>
  ValidationError(RegexSchema):
    Pattern 'video src=(?P<url>http[^ ]+m3u8[^ ]*)' did not match <'<!doctype html>\n<html>\n\n<head>\n\n    <meta charset...>
  ValidationError(RegexSchema):
    Pattern 'source src=\\"(?P<url>[^\\"]+m3u8[^\\"]*)\\"' did not match <'<!doctype html>\n<html>\n\n<head>\n\n    <meta charset...>
  ValidationError(RegexSchema):
    Pattern '(?P<url>[^\\"]+geoblock[^\\"]+)' did not match <'<!doctype html>\n<html>\n\n<head>\n\n    <meta charset...>
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/streamlink/plugins/cdnbg.py`
Content:
```
1 """
2 $description Bulgarian CDN hosting live content for various websites in Bulgaria.
3 $url armymedia.bg
4 $url bgonair.bg
5 $url bloombergtv.bg
6 $url bnt.bg
7 $url live.bstv.bg
8 $url i.cdn.bg
9 $url nova.bg
10 $url mu-vi.tv
11 $type live
12 $region Bulgaria
13 """
14 
15 import logging
16 import re
17 from urllib.parse import urlparse
18 
19 from streamlink.plugin import Plugin, pluginmatcher
20 from streamlink.plugin.api import validate
21 from streamlink.stream.hls import HLSStream
22 from streamlink.utils.url import update_scheme
23 
24 log = logging.getLogger(__name__)
25 
26 
27 @pluginmatcher(re.compile(r"""
28     https?://(?:www\.)?(?:
29         armymedia\.bg
30         |
31         bgonair\.bg/tvonline
32         |
33         bloombergtv\.bg/video
34         |
35         (?:tv\.)?bnt\.bg/\w+(?:/\w+)?
36         |
37         live\.bstv\.bg
38         |
39         i\.cdn\.bg/live/
40         |
41         nova\.bg/live
42         |
43         mu-vi\.tv/LiveStreams/pages/Live\.aspx
44     )/?
45 """, re.VERBOSE))
46 class CDNBG(Plugin):
47     @staticmethod
48     def _find_url(regex: re.Pattern) -> validate.all:
49         return validate.all(
50             validate.regex(regex),
51             validate.get("url"),
52         )
53 
54     def _get_streams(self):
55         if "cdn.bg" in urlparse(self.url).netloc:
56             iframe_url = self.url
57             h = self.session.get_option("http-headers")
58             if not h or not h.get("Referer"):
59                 log.error("Missing Referer for iframe URL, use --http-header \"Referer=URL\" ")
60                 return
61             _referer = h.get("Referer")
62         else:
63             _referer = self.url
64             iframe_url = self.session.http.get(self.url, schema=validate.Schema(
65                 validate.any(
66                     self._find_url(
67                         re.compile(r"'src',\s*'(?P<url>https?://i\.cdn\.bg/live/\w+)'\);")
68                     ),
69                     validate.all(
70                         validate.parse_html(),
71                         validate.xml_xpath_string(".//iframe[contains(@src,'cdn.bg')][1]/@src")
72                     )
73                 )
74             ))
75 
76         if not iframe_url:
77             return
78 
79         iframe_url = update_scheme("https://", iframe_url, force=False)
80         log.debug(f"Found iframe: {iframe_url}")
81 
82         stream_url = self.session.http.get(
83             iframe_url,
84             headers={"Referer": _referer},
85             schema=validate.Schema(
86                 validate.any(
87                     self._find_url(
88                         re.compile(r"sdata\.src.*?=.*?(?P<q>[\"'])(?P<url>http.*?)(?P=q)")
89                     ),
90                     self._find_url(
91                         re.compile(r"(src|file): (?P<q>[\"'])(?P<url>(https?:)?//.+?m3u8.*?)(?P=q)")
92                     ),
93                     self._find_url(
94                         re.compile(r"video src=(?P<url>http[^ ]+m3u8[^ ]*)")
95                     ),
96                     self._find_url(
97                         re.compile(r"source src=\"(?P<url>[^\"]+m3u8[^\"]*)\"")
98                     ),
99                     # GEOBLOCKED
100                     self._find_url(
101                         re.compile(r"(?P<url>[^\"]+geoblock[^\"]+)")
102                     ),
103                 )
104             )
105         )
106         if "geoblock" in stream_url:
107             log.error("Geo-restricted content")
108             return
109 
110         return HLSStream.parse_variant_playlist(
111             self.session,
112             update_scheme(iframe_url, stream_url),
113             headers={"Referer": "https://i.cdn.bg/"},
114         )
115 
116 
117 __plugin__ = CDNBG
118
```
--- 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()

```

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
@@ -85,7 +85,7 @@
             schema=validate.Schema(
                 validate.any(
                     self._find_url(
-                        re.compile(r"sdata\.src.*?=.*?(?P<q>[\"'])(?P<url>http.*?)(?P=q)")
+                        re.compile(r"sdata\.src.*?=.*?(?P<q>[\"'])(?P<url>.*?)(?P=q)")
                     ),
                     self._find_url(
                         re.compile(r"(src|file): (?P<q>[\"'])(?P<url>(https?:)?//.+?m3u8.*?)(?P=q)")

{"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@@ -85,7 +85,7 @@\n             schema=validate.Schema(\n                 validate.any(\n                     self._find_url(\n-                        re.compile(r\"sdata\\.src.*?=.*?(?P<q>[\\\"'])(?P<url>http.*?)(?P=q)\")\n+                        re.compile(r\"sdata\\.src.*?=.*?(?P<q>[\\\"'])(?P<url>.*?)(?P=q)\")\n                     ),\n                     self._find_url(\n                         re.compile(r\"(src|file): (?P<q>[\\\"'])(?P<url>(https?:)?//.+?m3u8.*?)(?P=q)\")\n", "issue": "plugins.cdnbg: can't load tv.bnt.bg/bnt3 (Unable to validate response text)\n### Checklist\n\n- [X] This is a plugin issue and not a different kind of issue\n- [X] [I have read the contribution guidelines](https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink)\n- [X] [I have checked the list of open and recently closed plugin issues](https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22)\n- [X] [I have checked the commit log of the master branch](https://github.com/streamlink/streamlink/commits/master)\n\n### Streamlink version\n\nLatest build from the master branch\n\n### Description\n\nCan't load tv.bnt.bg/bnt3 or any of this tv.bnt.bg/bnt2 and tv.bnt.bg/bnt.\n\n### Debug log\n\n```text\nstreamlink --loglevel debug \"http://tv.bnt.bg/bnt3\" best\r\n[cli][debug] OS:         Linux-5.15.0-56-generic-x86_64-with-glibc2.29\r\n[cli][debug] Python:     3.8.10\r\n[cli][debug] Streamlink: 5.1.2+9.g5639a065\r\n[cli][debug] Dependencies:\r\n[cli][debug]  certifi: 2020.12.5\r\n[cli][debug]  isodate: 0.6.1\r\n[cli][debug]  lxml: 4.9.1\r\n[cli][debug]  pycountry: 22.3.5\r\n[cli][debug]  pycryptodome: 3.15.0\r\n[cli][debug]  PySocks: 1.7.1\r\n[cli][debug]  requests: 2.28.1\r\n[cli][debug]  urllib3: 1.26.12\r\n[cli][debug]  websocket-client: 1.4.1\r\n[cli][debug] Arguments:\r\n[cli][debug]  url=http://tv.bnt.bg/bnt3\r\n[cli][debug]  stream=['best']\r\n[cli][debug]  --loglevel=debug\r\n[cli][info] Found matching plugin cdnbg for URL http://tv.bnt.bg/bnt3\r\n[plugins.cdnbg][debug] Found iframe: https://i.cdn.bg/live/OQ70Ds9Lcp\r\nerror: Unable to validate response text: ValidationError(AnySchema):\r\n  ValidationError(RegexSchema):\r\n    Pattern 'sdata\\\\.src.*?=.*?(?P<q>[\\\\\"\\'])(?P<url>http.*?)(?P=q)' did not match <'<!doctype html>\\n<html>\\n\\n<head>\\n\\n    <meta charset...>\r\n  ValidationError(RegexSchema):\r\n    Pattern <'(src|file): (?P<q>[\\\\\"\\'])(?P<url>(https?:)?//.+?m3u8....> did not match <'<!doctype html>\\n<html>\\n\\n<head>\\n\\n    <meta charset...>\r\n  ValidationError(RegexSchema):\r\n    Pattern 'video src=(?P<url>http[^ ]+m3u8[^ ]*)' did not match <'<!doctype html>\\n<html>\\n\\n<head>\\n\\n    <meta charset...>\r\n  ValidationError(RegexSchema):\r\n    Pattern 'source src=\\\\\"(?P<url>[^\\\\\"]+m3u8[^\\\\\"]*)\\\\\"' did not match <'<!doctype html>\\n<html>\\n\\n<head>\\n\\n    <meta charset...>\r\n  ValidationError(RegexSchema):\r\n    Pattern '(?P<url>[^\\\\\"]+geoblock[^\\\\\"]+)' did not match <'<!doctype html>\\n<html>\\n\\n<head>\\n\\n    <meta charset...>\n```\n\n", "before_files": [{"content": "\"\"\"\n$description Bulgarian CDN hosting live content for various websites in Bulgaria.\n$url armymedia.bg\n$url bgonair.bg\n$url bloombergtv.bg\n$url bnt.bg\n$url live.bstv.bg\n$url i.cdn.bg\n$url nova.bg\n$url mu-vi.tv\n$type live\n$region Bulgaria\n\"\"\"\n\nimport logging\nimport re\nfrom urllib.parse import urlparse\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream.hls import HLSStream\nfrom streamlink.utils.url import update_scheme\n\nlog = logging.getLogger(__name__)\n\n\n@pluginmatcher(re.compile(r\"\"\"\n    https?://(?:www\\.)?(?:\n        armymedia\\.bg\n        |\n        bgonair\\.bg/tvonline\n        |\n        bloombergtv\\.bg/video\n        |\n        (?:tv\\.)?bnt\\.bg/\\w+(?:/\\w+)?\n        |\n        live\\.bstv\\.bg\n        |\n        i\\.cdn\\.bg/live/\n        |\n        nova\\.bg/live\n        |\n        mu-vi\\.tv/LiveStreams/pages/Live\\.aspx\n    )/?\n\"\"\", re.VERBOSE))\nclass CDNBG(Plugin):\n    @staticmethod\n    def _find_url(regex: re.Pattern) -> validate.all:\n        return validate.all(\n            validate.regex(regex),\n            validate.get(\"url\"),\n        )\n\n    def _get_streams(self):\n        if \"cdn.bg\" in urlparse(self.url).netloc:\n            iframe_url = self.url\n            h = self.session.get_option(\"http-headers\")\n            if not h or not h.get(\"Referer\"):\n                log.error(\"Missing Referer for iframe URL, use --http-header \\\"Referer=URL\\\" \")\n                return\n            _referer = h.get(\"Referer\")\n        else:\n            _referer = self.url\n            iframe_url = self.session.http.get(self.url, schema=validate.Schema(\n                validate.any(\n                    self._find_url(\n                        re.compile(r\"'src',\\s*'(?P<url>https?://i\\.cdn\\.bg/live/\\w+)'\\);\")\n                    ),\n                    validate.all(\n                        validate.parse_html(),\n                        validate.xml_xpath_string(\".//iframe[contains(@src,'cdn.bg')][1]/@src\")\n                    )\n                )\n            ))\n\n        if not iframe_url:\n            return\n\n        iframe_url = update_scheme(\"https://\", iframe_url, force=False)\n        log.debug(f\"Found iframe: {iframe_url}\")\n\n        stream_url = self.session.http.get(\n            iframe_url,\n            headers={\"Referer\": _referer},\n            schema=validate.Schema(\n                validate.any(\n                    self._find_url(\n                        re.compile(r\"sdata\\.src.*?=.*?(?P<q>[\\\"'])(?P<url>http.*?)(?P=q)\")\n                    ),\n                    self._find_url(\n                        re.compile(r\"(src|file): (?P<q>[\\\"'])(?P<url>(https?:)?//.+?m3u8.*?)(?P=q)\")\n                    ),\n                    self._find_url(\n                        re.compile(r\"video src=(?P<url>http[^ ]+m3u8[^ ]*)\")\n                    ),\n                    self._find_url(\n                        re.compile(r\"source src=\\\"(?P<url>[^\\\"]+m3u8[^\\\"]*)\\\"\")\n                    ),\n                    # GEOBLOCKED\n                    self._find_url(\n                        re.compile(r\"(?P<url>[^\\\"]+geoblock[^\\\"]+)\")\n                    ),\n                )\n            )\n        )\n        if \"geoblock\" in stream_url:\n            log.error(\"Geo-restricted content\")\n            return\n\n        return HLSStream.parse_variant_playlist(\n            self.session,\n            update_scheme(iframe_url, stream_url),\n            headers={\"Referer\": \"https://i.cdn.bg/\"},\n        )\n\n\n__plugin__ = CDNBG\n", "path": "src/streamlink/plugins/cdnbg.py"}], "after_files": [{"content": "\"\"\"\n$description Bulgarian CDN hosting live content for various websites in Bulgaria.\n$url armymedia.bg\n$url bgonair.bg\n$url bloombergtv.bg\n$url bnt.bg\n$url live.bstv.bg\n$url i.cdn.bg\n$url nova.bg\n$url mu-vi.tv\n$type live\n$region Bulgaria\n\"\"\"\n\nimport logging\nimport re\nfrom urllib.parse import urlparse\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream.hls import HLSStream\nfrom streamlink.utils.url import update_scheme\n\nlog = logging.getLogger(__name__)\n\n\n@pluginmatcher(re.compile(r\"\"\"\n    https?://(?:www\\.)?(?:\n        armymedia\\.bg\n        |\n        bgonair\\.bg/tvonline\n        |\n        bloombergtv\\.bg/video\n        |\n        (?:tv\\.)?bnt\\.bg/\\w+(?:/\\w+)?\n        |\n        live\\.bstv\\.bg\n        |\n        i\\.cdn\\.bg/live/\n        |\n        nova\\.bg/live\n        |\n        mu-vi\\.tv/LiveStreams/pages/Live\\.aspx\n    )/?\n\"\"\", re.VERBOSE))\nclass CDNBG(Plugin):\n    @staticmethod\n    def _find_url(regex: re.Pattern) -> validate.all:\n        return validate.all(\n            validate.regex(regex),\n            validate.get(\"url\"),\n        )\n\n    def _get_streams(self):\n        if \"cdn.bg\" in urlparse(self.url).netloc:\n            iframe_url = self.url\n            h = self.session.get_option(\"http-headers\")\n            if not h or not h.get(\"Referer\"):\n                log.error(\"Missing Referer for iframe URL, use --http-header \\\"Referer=URL\\\" \")\n                return\n            _referer = h.get(\"Referer\")\n        else:\n            _referer = self.url\n            iframe_url = self.session.http.get(self.url, schema=validate.Schema(\n                validate.any(\n                    self._find_url(\n                        re.compile(r\"'src',\\s*'(?P<url>https?://i\\.cdn\\.bg/live/\\w+)'\\);\")\n                    ),\n                    validate.all(\n                        validate.parse_html(),\n                        validate.xml_xpath_string(\".//iframe[contains(@src,'cdn.bg')][1]/@src\")\n                    )\n                )\n            ))\n\n        if not iframe_url:\n            return\n\n        iframe_url = update_scheme(\"https://\", iframe_url, force=False)\n        log.debug(f\"Found iframe: {iframe_url}\")\n\n        stream_url = self.session.http.get(\n            iframe_url,\n            headers={\"Referer\": _referer},\n            schema=validate.Schema(\n                validate.any(\n                    self._find_url(\n                        re.compile(r\"sdata\\.src.*?=.*?(?P<q>[\\\"'])(?P<url>.*?)(?P=q)\")\n                    ),\n                    self._find_url(\n                        re.compile(r\"(src|file): (?P<q>[\\\"'])(?P<url>(https?:)?//.+?m3u8.*?)(?P=q)\")\n                    ),\n                    self._find_url(\n                        re.compile(r\"video src=(?P<url>http[^ ]+m3u8[^ ]*)\")\n                    ),\n                    self._find_url(\n                        re.compile(r\"source src=\\\"(?P<url>[^\\\"]+m3u8[^\\\"]*)\\\"\")\n                    ),\n                    # GEOBLOCKED\n                    self._find_url(\n                        re.compile(r\"(?P<url>[^\\\"]+geoblock[^\\\"]+)\")\n                    ),\n                )\n            )\n        )\n        if \"geoblock\" in stream_url:\n            log.error(\"Geo-restricted content\")\n            return\n\n        return HLSStream.parse_variant_playlist(\n            self.session,\n            update_scheme(iframe_url, stream_url),\n            headers={\"Referer\": \"https://i.cdn.bg/\"},\n        )\n\n\n__plugin__ = CDNBG\n", "path": "src/streamlink/plugins/cdnbg.py"}]}