prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  plugins.rtvs: No playable streams found on
  ### 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
  
  rtvs plugin - stream not work
  
  ### Debug log
  
  ```text
  PS C:\Users\My> streamlink https://www.rtvs.sk/televizia/live-24 --loglevel debug
  [cli][debug] OS:         Windows 10
  [cli][debug] Python:     3.11.2
  [cli][debug] Streamlink: 5.3.1
  [cli][debug] Dependencies:
  [cli][debug]  certifi: 2022.12.7
  [cli][debug]  isodate: 0.6.1
  [cli][debug]  lxml: 4.9.2
  [cli][debug]  pycountry: 22.3.5
  [cli][debug]  pycryptodome: 3.17
  [cli][debug]  PySocks: 1.7.1
  [cli][debug]  requests: 2.28.2
  [cli][debug]  urllib3: 1.26.14
  [cli][debug]  websocket-client: 1.5.1
  [cli][debug] Arguments:
  [cli][debug]  url=https://www.rtvs.sk/televizia/live-24
  [cli][debug]  --loglevel=debug
  [cli][debug]  --ffmpeg-ffmpeg=C:\Program Files\Streamlink\ffmpeg\ffmpeg.exe
  [cli][info] Found matching plugin rtvs for URL https://www.rtvs.sk/televizia/live-24
  error: No playable streams found on this URL: https://www.rtvs.sk/televizia/live-24
  ```
  
  
  </issue>
  <code>
  [start of src/streamlink/plugins/rtvs.py]
  1 """
  2 $description Live TV channels from RTVS, a Slovak public, state-owned broadcaster.
  3 $url rtvs.sk
  4 $type live
  5 $region Slovakia
  6 """
  7 
  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 from streamlink.utils.parse import parse_json
  14 
  15 
  16 @pluginmatcher(re.compile(
  17     r"https?://www\.rtvs\.sk/televizia/live-[\w-]+",
  18 ))
  19 class Rtvs(Plugin):
  20     _re_channel_id = re.compile(r"'stream':\s*'live-(\d+)'")
  21 
  22     def _get_streams(self):
  23         res = self.session.http.get(self.url)
  24         m = self._re_channel_id.search(res.text)
  25         if not m:
  26             return
  27 
  28         res = self.session.http.get(
  29             "https://www.rtvs.sk/json/live5f.json",
  30             params={
  31                 "c": m.group(1),
  32                 "b": "mozilla",
  33                 "p": "win",
  34                 "f": "0",
  35                 "d": "1",
  36             },
  37         )
  38         videos = parse_json(res.text, schema=validate.Schema({
  39             "clip": {
  40                 "sources": [{
  41                     "src": validate.url(),
  42                     "type": str,
  43                 }],
  44             }},
  45             validate.get(("clip", "sources")),
  46             validate.filter(lambda n: n["type"] == "application/x-mpegurl"),
  47         ))
  48         for video in videos:
  49             yield from HLSStream.parse_variant_playlist(self.session, video["src"]).items()
  50 
  51 
  52 __plugin__ = Rtvs
  53
  [end of src/streamlink/plugins/rtvs.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/rtvs.py b/src/streamlink/plugins/rtvs.py
  --- a/src/streamlink/plugins/rtvs.py
  +++ b/src/streamlink/plugins/rtvs.py
  @@ -6,47 +6,52 @@
   """
   
   import re
  +from urllib.parse import urlparse
   
   from streamlink.plugin import Plugin, pluginmatcher
   from streamlink.plugin.api import validate
   from streamlink.stream.hls import HLSStream
  -from streamlink.utils.parse import parse_json
   
   
   @pluginmatcher(re.compile(
  -    r"https?://www\.rtvs\.sk/televizia/live-[\w-]+",
  +    r"https?://www\.rtvs\.sk/televizia/(?:live-|sport)",
   ))
   class Rtvs(Plugin):
  -    _re_channel_id = re.compile(r"'stream':\s*'live-(\d+)'")
  -
       def _get_streams(self):
  -        res = self.session.http.get(self.url)
  -        m = self._re_channel_id.search(res.text)
  -        if not m:
  +        channel = self.session.http.get(self.url, schema=validate.Schema(
  +            validate.parse_html(),
  +            validate.xml_xpath_string(".//iframe[@id='player_live']//@src"),
  +            validate.url(path=validate.startswith("/embed/live/")),
  +            validate.transform(lambda embed: urlparse(embed).path[len("/embed/live/"):]),
  +        ))
  +        if not channel:
               return
   
  -        res = self.session.http.get(
  +        videos = self.session.http.get(
               "https://www.rtvs.sk/json/live5f.json",
               params={
  -                "c": m.group(1),
  +                "c": channel,
                   "b": "mozilla",
                   "p": "win",
                   "f": "0",
                   "d": "1",
               },
  +            schema=validate.Schema(
  +                validate.parse_json(),
  +                {
  +                    "clip": {
  +                        "sources": [{
  +                            "src": validate.url(),
  +                            "type": str,
  +                        }],
  +                    },
  +                },
  +                validate.get(("clip", "sources")),
  +                validate.filter(lambda n: n["type"] == "application/x-mpegurl"),
  +            ),
           )
  -        videos = parse_json(res.text, schema=validate.Schema({
  -            "clip": {
  -                "sources": [{
  -                    "src": validate.url(),
  -                    "type": str,
  -                }],
  -            }},
  -            validate.get(("clip", "sources")),
  -            validate.filter(lambda n: n["type"] == "application/x-mpegurl"),
  -        ))
           for video in videos:
  -            yield from HLSStream.parse_variant_playlist(self.session, video["src"]).items()
  +            return HLSStream.parse_variant_playlist(self.session, video["src"])
   
   
   __plugin__ = Rtvs
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/rtvs.py b/src/streamlink/plugins/rtvs.py\n--- a/src/streamlink/plugins/rtvs.py\n+++ b/src/streamlink/plugins/rtvs.py\n@@ -6,47 +6,52 @@\n \"\"\"\n \n import re\n+from urllib.parse import urlparse\n \n from streamlink.plugin import Plugin, pluginmatcher\n from streamlink.plugin.api import validate\n from streamlink.stream.hls import HLSStream\n-from streamlink.utils.parse import parse_json\n \n \n @pluginmatcher(re.compile(\n-    r\"https?://www\\.rtvs\\.sk/televizia/live-[\\w-]+\",\n+    r\"https?://www\\.rtvs\\.sk/televizia/(?:live-|sport)\",\n ))\n class Rtvs(Plugin):\n-    _re_channel_id = re.compile(r\"'stream':\\s*'live-(\\d+)'\")\n-\n     def _get_streams(self):\n-        res = self.session.http.get(self.url)\n-        m = self._re_channel_id.search(res.text)\n-        if not m:\n+        channel = self.session.http.get(self.url, schema=validate.Schema(\n+            validate.parse_html(),\n+            validate.xml_xpath_string(\".//iframe[@id='player_live']//@src\"),\n+            validate.url(path=validate.startswith(\"/embed/live/\")),\n+            validate.transform(lambda embed: urlparse(embed).path[len(\"/embed/live/\"):]),\n+        ))\n+        if not channel:\n             return\n \n-        res = self.session.http.get(\n+        videos = self.session.http.get(\n             \"https://www.rtvs.sk/json/live5f.json\",\n             params={\n-                \"c\": m.group(1),\n+                \"c\": channel,\n                 \"b\": \"mozilla\",\n                 \"p\": \"win\",\n                 \"f\": \"0\",\n                 \"d\": \"1\",\n             },\n+            schema=validate.Schema(\n+                validate.parse_json(),\n+                {\n+                    \"clip\": {\n+                        \"sources\": [{\n+                            \"src\": validate.url(),\n+                            \"type\": str,\n+                        }],\n+                    },\n+                },\n+                validate.get((\"clip\", \"sources\")),\n+                validate.filter(lambda n: n[\"type\"] == \"application/x-mpegurl\"),\n+            ),\n         )\n-        videos = parse_json(res.text, schema=validate.Schema({\n-            \"clip\": {\n-                \"sources\": [{\n-                    \"src\": validate.url(),\n-                    \"type\": str,\n-                }],\n-            }},\n-            validate.get((\"clip\", \"sources\")),\n-            validate.filter(lambda n: n[\"type\"] == \"application/x-mpegurl\"),\n-        ))\n         for video in videos:\n-            yield from HLSStream.parse_variant_playlist(self.session, video[\"src\"]).items()\n+            return HLSStream.parse_variant_playlist(self.session, video[\"src\"])\n \n \n __plugin__ = Rtvs\n", "issue": "plugins.rtvs: No playable streams found on\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\nrtvs plugin - stream not work\n\n### Debug log\n\n```text\nPS C:\\Users\\My> streamlink https://www.rtvs.sk/televizia/live-24 --loglevel debug\r\n[cli][debug] OS:         Windows 10\r\n[cli][debug] Python:     3.11.2\r\n[cli][debug] Streamlink: 5.3.1\r\n[cli][debug] Dependencies:\r\n[cli][debug]  certifi: 2022.12.7\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.17\r\n[cli][debug]  PySocks: 1.7.1\r\n[cli][debug]  requests: 2.28.2\r\n[cli][debug]  urllib3: 1.26.14\r\n[cli][debug]  websocket-client: 1.5.1\r\n[cli][debug] Arguments:\r\n[cli][debug]  url=https://www.rtvs.sk/televizia/live-24\r\n[cli][debug]  --loglevel=debug\r\n[cli][debug]  --ffmpeg-ffmpeg=C:\\Program Files\\Streamlink\\ffmpeg\\ffmpeg.exe\r\n[cli][info] Found matching plugin rtvs for URL https://www.rtvs.sk/televizia/live-24\r\nerror: No playable streams found on this URL: https://www.rtvs.sk/televizia/live-24\n```\n\n", "before_files": [{"content": "\"\"\"\n$description Live TV channels from RTVS, a Slovak public, state-owned broadcaster.\n$url rtvs.sk\n$type live\n$region Slovakia\n\"\"\"\n\nimport re\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream.hls import HLSStream\nfrom streamlink.utils.parse import parse_json\n\n\n@pluginmatcher(re.compile(\n    r\"https?://www\\.rtvs\\.sk/televizia/live-[\\w-]+\",\n))\nclass Rtvs(Plugin):\n    _re_channel_id = re.compile(r\"'stream':\\s*'live-(\\d+)'\")\n\n    def _get_streams(self):\n        res = self.session.http.get(self.url)\n        m = self._re_channel_id.search(res.text)\n        if not m:\n            return\n\n        res = self.session.http.get(\n            \"https://www.rtvs.sk/json/live5f.json\",\n            params={\n                \"c\": m.group(1),\n                \"b\": \"mozilla\",\n                \"p\": \"win\",\n                \"f\": \"0\",\n                \"d\": \"1\",\n            },\n        )\n        videos = parse_json(res.text, schema=validate.Schema({\n            \"clip\": {\n                \"sources\": [{\n                    \"src\": validate.url(),\n                    \"type\": str,\n                }],\n            }},\n            validate.get((\"clip\", \"sources\")),\n            validate.filter(lambda n: n[\"type\"] == \"application/x-mpegurl\"),\n        ))\n        for video in videos:\n            yield from HLSStream.parse_variant_playlist(self.session, video[\"src\"]).items()\n\n\n__plugin__ = Rtvs\n", "path": "src/streamlink/plugins/rtvs.py"}]}