prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  plugins.nbcnews: not live
  ### 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
  
  Every time it start the same video but on the site it is live. Something was changed on the site few days ago.
  
  ### Debug log
  
  ```text
  [cli][debug] OS:         Linux-6.1.0-7-amd64-x86_64-with-glibc2.36
  [cli][debug] Python:     3.11.2
  [cli][debug] Streamlink: 5.3.1+84.g7978e4ab
  [cli][debug] Dependencies:
  [cli][debug]  certifi: 2022.9.24
  [cli][debug]  isodate: 0.6.1
  [cli][debug]  lxml: 4.9.2
  [cli][debug]  pycountry: 22.3.5
  [cli][debug]  pycryptodome: 3.16.0
  [cli][debug]  PySocks: 1.7.1
  [cli][debug]  requests: 2.28.1
  [cli][debug]  urllib3: 1.26.12
  [cli][debug]  websocket-client: 1.2.3
  [cli][debug]  esprima: 4.0.1
  [cli][debug]  importlib-metadata: 4.12.0
  [cli][debug] Arguments:
  [cli][debug]  url=https://www.nbcnews.com/now/
  [cli][debug]  --loglevel=debug
  [cli][debug]  --player=mpv
  [cli][debug]  --default-stream=['best']
  [cli][info] Found matching plugin nbcnews for URL https://www.nbcnews.com/now/
  [plugins.nbcnews][debug] API ID: 2007524
  [utils.l10n][debug] Language code: ru_RU
  [cli][info] Available streams: 144p_alt (worst), 144p, 216p_alt, 216p, 288p_alt, 288p, 360p_alt, 360p, 504p_alt, 504p, 576p_alt, 576p, 720p_alt, 720p, 1080p_alt, 1080p (best)
  [cli][info] Opening stream: 1080p (hls)
  [cli][info] Starting player: mpv
  [stream.hls][debug] Reloading playlist
  [cli][debug] Pre-buffering 8192 bytes
  [stream.hls][debug] First Sequence: 1786423; Last Sequence: 1786722
  [stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 1786423; End Sequence: 1786722
  [stream.hls][debug] Adding segment 1786423 to queue
  ```
  
  
  --- 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/nbcnews.py`
  Content:
  ```
  1 """
  2 $description 24-hour world, US and local news channel, based in the United States of America.
  3 $url nbcnews.com
  4 $type live
  5 """
  6 
  7 import logging
  8 import re
  9 
  10 from streamlink.plugin import Plugin, pluginmatcher
  11 from streamlink.plugin.api import validate
  12 from streamlink.stream.hls import HLSStream
  13 
  14 
  15 log = logging.getLogger(__name__)
  16 
  17 
  18 @pluginmatcher(re.compile(
  19     r"https?://(?:www\.)?nbcnews\.com/now",
  20 ))
  21 class NBCNews(Plugin):
  22     URL_API = "https://api-leap.nbcsports.com/feeds/assets/{}?application=NBCNews&format=nbc-player&platform=desktop"
  23     URL_TOKEN = "https://tokens.playmakerservices.com/"
  24 
  25     title = "NBC News Now"
  26 
  27     def _get_streams(self):
  28         self.id = self.session.http.get(
  29             self.url,
  30             schema=validate.Schema(
  31                 validate.parse_html(),
  32                 validate.xml_xpath_string(".//script[@type='application/ld+json'][1]/text()"),
  33                 validate.none_or_all(
  34                     validate.parse_json(),
  35                     {"embedUrl": validate.url()},
  36                     validate.get("embedUrl"),
  37                     validate.transform(lambda embed_url: embed_url.split("/")[-1]),
  38                 ),
  39             ),
  40         )
  41         if self.id is None:
  42             return
  43         log.debug(f"API ID: {self.id}")
  44 
  45         stream = self.session.http.get(
  46             self.URL_API.format(self.id),
  47             schema=validate.Schema(
  48                 validate.parse_json(),
  49                 {
  50                     "videoSources": [{
  51                         "cdnSources": {
  52                             "primary": [{
  53                                 "sourceUrl": validate.url(path=validate.endswith(".m3u8")),
  54                             }],
  55                         },
  56                     }],
  57                 },
  58                 validate.get(("videoSources", 0, "cdnSources", "primary", 0, "sourceUrl")),
  59             ),
  60         )
  61 
  62         url = self.session.http.post(
  63             self.URL_TOKEN,
  64             json={
  65                 "requestorId": "nbcnews",
  66                 "pid": self.id,
  67                 "application": "NBCSports",
  68                 "version": "v1",
  69                 "platform": "desktop",
  70                 "token": "",
  71                 "resourceId": "",
  72                 "inPath": "false",
  73                 "authenticationType": "unauth",
  74                 "cdn": "akamai",
  75                 "url": stream,
  76             },
  77             schema=validate.Schema(
  78                 validate.parse_json(),
  79                 {
  80                     "akamai": [{
  81                         "tokenizedUrl": validate.url(),
  82                     }],
  83                 },
  84                 validate.get(("akamai", 0, "tokenizedUrl")),
  85             ),
  86         )
  87         return HLSStream.parse_variant_playlist(self.session, url)
  88 
  89 
  90 __plugin__ = NBCNews
  91
  ```
  --- 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/src/streamlink/plugins/nbcnews.py b/src/streamlink/plugins/nbcnews.py
  deleted file mode 100644
  --- a/src/streamlink/plugins/nbcnews.py
  +++ /dev/null
  @@ -1,90 +0,0 @@
  -"""
  -$description 24-hour world, US and local news channel, based in the United States of America.
  -$url nbcnews.com
  -$type live
  -"""
  -
  -import logging
  -import re
  -
  -from streamlink.plugin import Plugin, pluginmatcher
  -from streamlink.plugin.api import validate
  -from streamlink.stream.hls import HLSStream
  -
  -
  -log = logging.getLogger(__name__)
  -
  -
  -@pluginmatcher(re.compile(
  -    r"https?://(?:www\.)?nbcnews\.com/now",
  -))
  -class NBCNews(Plugin):
  -    URL_API = "https://api-leap.nbcsports.com/feeds/assets/{}?application=NBCNews&format=nbc-player&platform=desktop"
  -    URL_TOKEN = "https://tokens.playmakerservices.com/"
  -
  -    title = "NBC News Now"
  -
  -    def _get_streams(self):
  -        self.id = self.session.http.get(
  -            self.url,
  -            schema=validate.Schema(
  -                validate.parse_html(),
  -                validate.xml_xpath_string(".//script[@type='application/ld+json'][1]/text()"),
  -                validate.none_or_all(
  -                    validate.parse_json(),
  -                    {"embedUrl": validate.url()},
  -                    validate.get("embedUrl"),
  -                    validate.transform(lambda embed_url: embed_url.split("/")[-1]),
  -                ),
  -            ),
  -        )
  -        if self.id is None:
  -            return
  -        log.debug(f"API ID: {self.id}")
  -
  -        stream = self.session.http.get(
  -            self.URL_API.format(self.id),
  -            schema=validate.Schema(
  -                validate.parse_json(),
  -                {
  -                    "videoSources": [{
  -                        "cdnSources": {
  -                            "primary": [{
  -                                "sourceUrl": validate.url(path=validate.endswith(".m3u8")),
  -                            }],
  -                        },
  -                    }],
  -                },
  -                validate.get(("videoSources", 0, "cdnSources", "primary", 0, "sourceUrl")),
  -            ),
  -        )
  -
  -        url = self.session.http.post(
  -            self.URL_TOKEN,
  -            json={
  -                "requestorId": "nbcnews",
  -                "pid": self.id,
  -                "application": "NBCSports",
  -                "version": "v1",
  -                "platform": "desktop",
  -                "token": "",
  -                "resourceId": "",
  -                "inPath": "false",
  -                "authenticationType": "unauth",
  -                "cdn": "akamai",
  -                "url": stream,
  -            },
  -            schema=validate.Schema(
  -                validate.parse_json(),
  -                {
  -                    "akamai": [{
  -                        "tokenizedUrl": validate.url(),
  -                    }],
  -                },
  -                validate.get(("akamai", 0, "tokenizedUrl")),
  -            ),
  -        )
  -        return HLSStream.parse_variant_playlist(self.session, url)
  -
  -
  -__plugin__ = NBCNews
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/nbcnews.py b/src/streamlink/plugins/nbcnews.py\ndeleted file mode 100644\n--- a/src/streamlink/plugins/nbcnews.py\n+++ /dev/null\n@@ -1,90 +0,0 @@\n-\"\"\"\n-$description 24-hour world, US and local news channel, based in the United States of America.\n-$url nbcnews.com\n-$type live\n-\"\"\"\n-\n-import logging\n-import re\n-\n-from streamlink.plugin import Plugin, pluginmatcher\n-from streamlink.plugin.api import validate\n-from streamlink.stream.hls import HLSStream\n-\n-\n-log = logging.getLogger(__name__)\n-\n-\n-@pluginmatcher(re.compile(\n-    r\"https?://(?:www\\.)?nbcnews\\.com/now\",\n-))\n-class NBCNews(Plugin):\n-    URL_API = \"https://api-leap.nbcsports.com/feeds/assets/{}?application=NBCNews&format=nbc-player&platform=desktop\"\n-    URL_TOKEN = \"https://tokens.playmakerservices.com/\"\n-\n-    title = \"NBC News Now\"\n-\n-    def _get_streams(self):\n-        self.id = self.session.http.get(\n-            self.url,\n-            schema=validate.Schema(\n-                validate.parse_html(),\n-                validate.xml_xpath_string(\".//script[@type='application/ld+json'][1]/text()\"),\n-                validate.none_or_all(\n-                    validate.parse_json(),\n-                    {\"embedUrl\": validate.url()},\n-                    validate.get(\"embedUrl\"),\n-                    validate.transform(lambda embed_url: embed_url.split(\"/\")[-1]),\n-                ),\n-            ),\n-        )\n-        if self.id is None:\n-            return\n-        log.debug(f\"API ID: {self.id}\")\n-\n-        stream = self.session.http.get(\n-            self.URL_API.format(self.id),\n-            schema=validate.Schema(\n-                validate.parse_json(),\n-                {\n-                    \"videoSources\": [{\n-                        \"cdnSources\": {\n-                            \"primary\": [{\n-                                \"sourceUrl\": validate.url(path=validate.endswith(\".m3u8\")),\n-                            }],\n-                        },\n-                    }],\n-                },\n-                validate.get((\"videoSources\", 0, \"cdnSources\", \"primary\", 0, \"sourceUrl\")),\n-            ),\n-        )\n-\n-        url = self.session.http.post(\n-            self.URL_TOKEN,\n-            json={\n-                \"requestorId\": \"nbcnews\",\n-                \"pid\": self.id,\n-                \"application\": \"NBCSports\",\n-                \"version\": \"v1\",\n-                \"platform\": \"desktop\",\n-                \"token\": \"\",\n-                \"resourceId\": \"\",\n-                \"inPath\": \"false\",\n-                \"authenticationType\": \"unauth\",\n-                \"cdn\": \"akamai\",\n-                \"url\": stream,\n-            },\n-            schema=validate.Schema(\n-                validate.parse_json(),\n-                {\n-                    \"akamai\": [{\n-                        \"tokenizedUrl\": validate.url(),\n-                    }],\n-                },\n-                validate.get((\"akamai\", 0, \"tokenizedUrl\")),\n-            ),\n-        )\n-        return HLSStream.parse_variant_playlist(self.session, url)\n-\n-\n-__plugin__ = NBCNews\n", "issue": "plugins.nbcnews: not live\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\nEvery time it start the same video but on the site it is live. Something was changed on the site few days ago.\n\n### Debug log\n\n```text\n[cli][debug] OS:         Linux-6.1.0-7-amd64-x86_64-with-glibc2.36\r\n[cli][debug] Python:     3.11.2\r\n[cli][debug] Streamlink: 5.3.1+84.g7978e4ab\r\n[cli][debug] Dependencies:\r\n[cli][debug]  certifi: 2022.9.24\r\n[cli][debug]  isodate: 0.6.1\r\n[cli][debug]  lxml: 4.9.2\r\n[cli][debug]  pycountry: 22.3.5\r\n[cli][debug]  pycryptodome: 3.16.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.2.3\r\n[cli][debug]  esprima: 4.0.1\r\n[cli][debug]  importlib-metadata: 4.12.0\r\n[cli][debug] Arguments:\r\n[cli][debug]  url=https://www.nbcnews.com/now/\r\n[cli][debug]  --loglevel=debug\r\n[cli][debug]  --player=mpv\r\n[cli][debug]  --default-stream=['best']\r\n[cli][info] Found matching plugin nbcnews for URL https://www.nbcnews.com/now/\r\n[plugins.nbcnews][debug] API ID: 2007524\r\n[utils.l10n][debug] Language code: ru_RU\r\n[cli][info] Available streams: 144p_alt (worst), 144p, 216p_alt, 216p, 288p_alt, 288p, 360p_alt, 360p, 504p_alt, 504p, 576p_alt, 576p, 720p_alt, 720p, 1080p_alt, 1080p (best)\r\n[cli][info] Opening stream: 1080p (hls)\r\n[cli][info] Starting player: mpv\r\n[stream.hls][debug] Reloading playlist\r\n[cli][debug] Pre-buffering 8192 bytes\r\n[stream.hls][debug] First Sequence: 1786423; Last Sequence: 1786722\r\n[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 1786423; End Sequence: 1786722\r\n[stream.hls][debug] Adding segment 1786423 to queue\n```\n\n", "before_files": [{"content": "\"\"\"\n$description 24-hour world, US and local news channel, based in the United States of America.\n$url nbcnews.com\n$type live\n\"\"\"\n\nimport logging\nimport re\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream.hls import HLSStream\n\n\nlog = logging.getLogger(__name__)\n\n\n@pluginmatcher(re.compile(\n    r\"https?://(?:www\\.)?nbcnews\\.com/now\",\n))\nclass NBCNews(Plugin):\n    URL_API = \"https://api-leap.nbcsports.com/feeds/assets/{}?application=NBCNews&format=nbc-player&platform=desktop\"\n    URL_TOKEN = \"https://tokens.playmakerservices.com/\"\n\n    title = \"NBC News Now\"\n\n    def _get_streams(self):\n        self.id = self.session.http.get(\n            self.url,\n            schema=validate.Schema(\n                validate.parse_html(),\n                validate.xml_xpath_string(\".//script[@type='application/ld+json'][1]/text()\"),\n                validate.none_or_all(\n                    validate.parse_json(),\n                    {\"embedUrl\": validate.url()},\n                    validate.get(\"embedUrl\"),\n                    validate.transform(lambda embed_url: embed_url.split(\"/\")[-1]),\n                ),\n            ),\n        )\n        if self.id is None:\n            return\n        log.debug(f\"API ID: {self.id}\")\n\n        stream = self.session.http.get(\n            self.URL_API.format(self.id),\n            schema=validate.Schema(\n                validate.parse_json(),\n                {\n                    \"videoSources\": [{\n                        \"cdnSources\": {\n                            \"primary\": [{\n                                \"sourceUrl\": validate.url(path=validate.endswith(\".m3u8\")),\n                            }],\n                        },\n                    }],\n                },\n                validate.get((\"videoSources\", 0, \"cdnSources\", \"primary\", 0, \"sourceUrl\")),\n            ),\n        )\n\n        url = self.session.http.post(\n            self.URL_TOKEN,\n            json={\n                \"requestorId\": \"nbcnews\",\n                \"pid\": self.id,\n                \"application\": \"NBCSports\",\n                \"version\": \"v1\",\n                \"platform\": \"desktop\",\n                \"token\": \"\",\n                \"resourceId\": \"\",\n                \"inPath\": \"false\",\n                \"authenticationType\": \"unauth\",\n                \"cdn\": \"akamai\",\n                \"url\": stream,\n            },\n            schema=validate.Schema(\n                validate.parse_json(),\n                {\n                    \"akamai\": [{\n                        \"tokenizedUrl\": validate.url(),\n                    }],\n                },\n                validate.get((\"akamai\", 0, \"tokenizedUrl\")),\n            ),\n        )\n        return HLSStream.parse_variant_playlist(self.session, url)\n\n\n__plugin__ = NBCNews\n", "path": "src/streamlink/plugins/nbcnews.py"}], "after_files": [{"content": null, "path": "src/streamlink/plugins/nbcnews.py"}]}