prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  bfmtv - No playable streams found on this URL
  <!--
  Thanks for reporting a plugin issue!
  USE THE TEMPLATE. Otherwise your plugin issue may be rejected.
  
  First, see the contribution guidelines:
  https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink
  
  Also check the list of open and closed plugin issues:
  https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22
  
  Please see the text preview to avoid unnecessary formatting errors.
  -->
  
  
  ## Plugin Issue
  
  <!-- Replace [ ] with [x] in order to check the box -->
  - [x] This is a plugin issue and I have read the contribution guidelines.
  
  
  ### Description
  
  <!-- Explain the plugin issue as thoroughly as you can. -->
  There is no playable streams for bfmtv
  
  ### Reproduction steps / Explicit stream URLs to test
  
  <!-- How can we reproduce this? Please note the exact steps below using the list format supplied. If you need more steps please add them. -->
  
  `streamlink https://www.bfmtv.com/en-direct/ best`
  
  or `streamlink https://www.bfmtv.com/paris/en-direct/ best`
  or any other channels supported by this plugin
  
  
  ### Log output
  
  <!--
  TEXT LOG OUTPUT IS REQUIRED for a plugin issue!
  Use the `--loglevel debug` parameter and avoid using parameters which suppress log output.
  https://streamlink.github.io/cli.html#cmdoption-l
  
  Make sure to **remove usernames and passwords**
  You can copy the output to https://gist.github.com/ or paste it below.
  
  Don't post screenshots of the log output and instead copy the text from your terminal application.
  -->
  
  ```
  streamlink --loglevel debug https://www.bfmtv.com/en-direct/ best
  [cli][debug] OS:         Linux-5.8.15-201.fc32.x86_64-x86_64-with-glibc2.2.5
  [cli][debug] Python:     3.8.6
  [cli][debug] Streamlink: 1.7.0
  [cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
  [cli][info] Found matching plugin bfmtv for URL https://www.bfmtv.com/en-direct/
  error: No playable streams found on this URL: https://www.bfmtv.com/en-direct/
  ```
  
  
  ### Additional comments, etc.
  
  As a workaround you can use their dailymotion stream: `streamlink https://www.dailymotion.com/embed/video/xgz4t1 best`
  
  </issue>
  <code>
  [start of src/streamlink/plugins/bfmtv.py]
  1 import re
  2 
  3 from streamlink.plugin import Plugin
  4 from streamlink.plugins.brightcove import BrightcovePlayer
  5 from streamlink.stream import HLSStream
  6 
  7 
  8 class BFMTV(Plugin):
  9     _url_re = re.compile(r'https://.+\.(?:bfmtv|01net)\.com')
  10     _brightcove_video_re = re.compile(
  11         r'data-holder="video(?P<video_id>[0-9]+)" data-account="(?P<account_id>[0-9]+)"'
  12     )
  13     _brightcove_video_alt_re = re.compile(
  14         r'data-account="(?P<account_id>[0-9]+).*?data-video-id="(?P<video_id>[0-9]+)"',
  15         re.DOTALL
  16     )
  17     _embed_video_url_re = re.compile(
  18         r"\$YOPLAYER\('liveStitching', {.+?file: '(?P<video_url>[^\"]+?)'.+?}\);",
  19         re.DOTALL
  20     )
  21 
  22     @classmethod
  23     def can_handle_url(cls, url):
  24         return BFMTV._url_re.match(url)
  25 
  26     def _get_streams(self):
  27         # Retrieve URL page and search for Brightcove video data
  28         res = self.session.http.get(self.url)
  29         match = self._brightcove_video_re.search(res.text) or self._brightcove_video_alt_re.search(res.text)
  30         if match is not None:
  31             account_id = match.group('account_id')
  32             video_id = match.group('video_id')
  33             player = BrightcovePlayer(self.session, account_id)
  34             for stream in player.get_streams(video_id):
  35                 yield stream
  36         else:
  37             # Try to get the stream URL in the page
  38             match = self._embed_video_url_re.search(res.text)
  39             if match is not None:
  40                 video_url = match.group('video_url')
  41                 if '.m3u8' in video_url:
  42                     yield from HLSStream.parse_variant_playlist(self.session, video_url).items()
  43 
  44 
  45 __plugin__ = BFMTV
  46
  [end of src/streamlink/plugins/bfmtv.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/bfmtv.py b/src/streamlink/plugins/bfmtv.py
  --- a/src/streamlink/plugins/bfmtv.py
  +++ b/src/streamlink/plugins/bfmtv.py
  @@ -1,45 +1,46 @@
  +import logging
   import re
   
   from streamlink.plugin import Plugin
   from streamlink.plugins.brightcove import BrightcovePlayer
  -from streamlink.stream import HLSStream
  +
  +log = logging.getLogger(__name__)
   
   
   class BFMTV(Plugin):
       _url_re = re.compile(r'https://.+\.(?:bfmtv|01net)\.com')
  +    _dailymotion_url = 'https://www.dailymotion.com/embed/video/{}'
       _brightcove_video_re = re.compile(
  -        r'data-holder="video(?P<video_id>[0-9]+)" data-account="(?P<account_id>[0-9]+)"'
  -    )
  -    _brightcove_video_alt_re = re.compile(
  -        r'data-account="(?P<account_id>[0-9]+).*?data-video-id="(?P<video_id>[0-9]+)"',
  +        r'accountid="(?P<account_id>[0-9]+).*?videoid="(?P<video_id>[0-9]+)"',
           re.DOTALL
       )
  -    _embed_video_url_re = re.compile(
  -        r"\$YOPLAYER\('liveStitching', {.+?file: '(?P<video_url>[^\"]+?)'.+?}\);",
  +    _embed_video_id_re = re.compile(
  +        r'<iframe.*?src=".*?/(?P<video_id>\w+)"',
           re.DOTALL
       )
   
       @classmethod
       def can_handle_url(cls, url):
  -        return BFMTV._url_re.match(url)
  +        return cls._url_re.match(url) is not None
   
       def _get_streams(self):
           # Retrieve URL page and search for Brightcove video data
           res = self.session.http.get(self.url)
  -        match = self._brightcove_video_re.search(res.text) or self._brightcove_video_alt_re.search(res.text)
  +        match = self._brightcove_video_re.search(res.text)
           if match is not None:
               account_id = match.group('account_id')
  +            log.debug(f'Account ID: {account_id}')
               video_id = match.group('video_id')
  +            log.debug(f'Video ID: {video_id}')
               player = BrightcovePlayer(self.session, account_id)
  -            for stream in player.get_streams(video_id):
  -                yield stream
  +            yield from player.get_streams(video_id)
           else:
  -            # Try to get the stream URL in the page
  -            match = self._embed_video_url_re.search(res.text)
  +            # Try to find the Dailymotion video ID
  +            match = self._embed_video_id_re.search(res.text)
               if match is not None:
  -                video_url = match.group('video_url')
  -                if '.m3u8' in video_url:
  -                    yield from HLSStream.parse_variant_playlist(self.session, video_url).items()
  +                video_id = match.group('video_id')
  +                log.debug(f'Video ID: {video_id}')
  +                yield from self.session.streams(self._dailymotion_url.format(video_id)).items()
   
   
   __plugin__ = BFMTV
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/bfmtv.py b/src/streamlink/plugins/bfmtv.py\n--- a/src/streamlink/plugins/bfmtv.py\n+++ b/src/streamlink/plugins/bfmtv.py\n@@ -1,45 +1,46 @@\n+import logging\n import re\n \n from streamlink.plugin import Plugin\n from streamlink.plugins.brightcove import BrightcovePlayer\n-from streamlink.stream import HLSStream\n+\n+log = logging.getLogger(__name__)\n \n \n class BFMTV(Plugin):\n     _url_re = re.compile(r'https://.+\\.(?:bfmtv|01net)\\.com')\n+    _dailymotion_url = 'https://www.dailymotion.com/embed/video/{}'\n     _brightcove_video_re = re.compile(\n-        r'data-holder=\"video(?P<video_id>[0-9]+)\" data-account=\"(?P<account_id>[0-9]+)\"'\n-    )\n-    _brightcove_video_alt_re = re.compile(\n-        r'data-account=\"(?P<account_id>[0-9]+).*?data-video-id=\"(?P<video_id>[0-9]+)\"',\n+        r'accountid=\"(?P<account_id>[0-9]+).*?videoid=\"(?P<video_id>[0-9]+)\"',\n         re.DOTALL\n     )\n-    _embed_video_url_re = re.compile(\n-        r\"\\$YOPLAYER\\('liveStitching', {.+?file: '(?P<video_url>[^\\\"]+?)'.+?}\\);\",\n+    _embed_video_id_re = re.compile(\n+        r'<iframe.*?src=\".*?/(?P<video_id>\\w+)\"',\n         re.DOTALL\n     )\n \n     @classmethod\n     def can_handle_url(cls, url):\n-        return BFMTV._url_re.match(url)\n+        return cls._url_re.match(url) is not None\n \n     def _get_streams(self):\n         # Retrieve URL page and search for Brightcove video data\n         res = self.session.http.get(self.url)\n-        match = self._brightcove_video_re.search(res.text) or self._brightcove_video_alt_re.search(res.text)\n+        match = self._brightcove_video_re.search(res.text)\n         if match is not None:\n             account_id = match.group('account_id')\n+            log.debug(f'Account ID: {account_id}')\n             video_id = match.group('video_id')\n+            log.debug(f'Video ID: {video_id}')\n             player = BrightcovePlayer(self.session, account_id)\n-            for stream in player.get_streams(video_id):\n-                yield stream\n+            yield from player.get_streams(video_id)\n         else:\n-            # Try to get the stream URL in the page\n-            match = self._embed_video_url_re.search(res.text)\n+            # Try to find the Dailymotion video ID\n+            match = self._embed_video_id_re.search(res.text)\n             if match is not None:\n-                video_url = match.group('video_url')\n-                if '.m3u8' in video_url:\n-                    yield from HLSStream.parse_variant_playlist(self.session, video_url).items()\n+                video_id = match.group('video_id')\n+                log.debug(f'Video ID: {video_id}')\n+                yield from self.session.streams(self._dailymotion_url.format(video_id)).items()\n \n \n __plugin__ = BFMTV\n", "issue": "bfmtv - No playable streams found on this URL\n<!--\r\nThanks for reporting a plugin issue!\r\nUSE THE TEMPLATE. Otherwise your plugin issue may be rejected.\r\n\r\nFirst, see the contribution guidelines:\r\nhttps://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink\r\n\r\nAlso check the list of open and closed plugin issues:\r\nhttps://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22\r\n\r\nPlease see the text preview to avoid unnecessary formatting errors.\r\n-->\r\n\r\n\r\n## Plugin Issue\r\n\r\n<!-- Replace [ ] with [x] in order to check the box -->\r\n- [x] This is a plugin issue and I have read the contribution guidelines.\r\n\r\n\r\n### Description\r\n\r\n<!-- Explain the plugin issue as thoroughly as you can. -->\r\nThere is no playable streams for bfmtv\r\n\r\n### Reproduction steps / Explicit stream URLs to test\r\n\r\n<!-- How can we reproduce this? Please note the exact steps below using the list format supplied. If you need more steps please add them. -->\r\n\r\n`streamlink https://www.bfmtv.com/en-direct/ best`\r\n\r\nor `streamlink https://www.bfmtv.com/paris/en-direct/ best`\r\nor any other channels supported by this plugin\r\n\r\n\r\n### Log output\r\n\r\n<!--\r\nTEXT LOG OUTPUT IS REQUIRED for a plugin issue!\r\nUse the `--loglevel debug` parameter and avoid using parameters which suppress log output.\r\nhttps://streamlink.github.io/cli.html#cmdoption-l\r\n\r\nMake sure to **remove usernames and passwords**\r\nYou can copy the output to https://gist.github.com/ or paste it below.\r\n\r\nDon't post screenshots of the log output and instead copy the text from your terminal application.\r\n-->\r\n\r\n```\r\nstreamlink --loglevel debug https://www.bfmtv.com/en-direct/ best\r\n[cli][debug] OS:         Linux-5.8.15-201.fc32.x86_64-x86_64-with-glibc2.2.5\r\n[cli][debug] Python:     3.8.6\r\n[cli][debug] Streamlink: 1.7.0\r\n[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)\r\n[cli][info] Found matching plugin bfmtv for URL https://www.bfmtv.com/en-direct/\r\nerror: No playable streams found on this URL: https://www.bfmtv.com/en-direct/\r\n```\r\n\r\n\r\n### Additional comments, etc.\r\n\r\nAs a workaround you can use their dailymotion stream: `streamlink https://www.dailymotion.com/embed/video/xgz4t1 best`\n", "before_files": [{"content": "import re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugins.brightcove import BrightcovePlayer\nfrom streamlink.stream import HLSStream\n\n\nclass BFMTV(Plugin):\n    _url_re = re.compile(r'https://.+\\.(?:bfmtv|01net)\\.com')\n    _brightcove_video_re = re.compile(\n        r'data-holder=\"video(?P<video_id>[0-9]+)\" data-account=\"(?P<account_id>[0-9]+)\"'\n    )\n    _brightcove_video_alt_re = re.compile(\n        r'data-account=\"(?P<account_id>[0-9]+).*?data-video-id=\"(?P<video_id>[0-9]+)\"',\n        re.DOTALL\n    )\n    _embed_video_url_re = re.compile(\n        r\"\\$YOPLAYER\\('liveStitching', {.+?file: '(?P<video_url>[^\\\"]+?)'.+?}\\);\",\n        re.DOTALL\n    )\n\n    @classmethod\n    def can_handle_url(cls, url):\n        return BFMTV._url_re.match(url)\n\n    def _get_streams(self):\n        # Retrieve URL page and search for Brightcove video data\n        res = self.session.http.get(self.url)\n        match = self._brightcove_video_re.search(res.text) or self._brightcove_video_alt_re.search(res.text)\n        if match is not None:\n            account_id = match.group('account_id')\n            video_id = match.group('video_id')\n            player = BrightcovePlayer(self.session, account_id)\n            for stream in player.get_streams(video_id):\n                yield stream\n        else:\n            # Try to get the stream URL in the page\n            match = self._embed_video_url_re.search(res.text)\n            if match is not None:\n                video_url = match.group('video_url')\n                if '.m3u8' in video_url:\n                    yield from HLSStream.parse_variant_playlist(self.session, video_url).items()\n\n\n__plugin__ = BFMTV\n", "path": "src/streamlink/plugins/bfmtv.py"}]}