prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Plugin LivecodingTV fails to load on Python 3.6.0b2 on Windows 10 x64
  Just running streamlink raises the following error on my system with a fresh install:
  
  ```
  C:\WINDOWS\system32>streamlink
  Failed to load plugin livecodingtv:
    File "c:\program files\python36\lib\imp.py", line 234, in load_module
      return load_source(name, filename, file)
    File "c:\program files\python36\lib\imp.py", line 172, in load_source
      module = _load(spec)
    File "<frozen importlib._bootstrap>", line 675, in _load
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 677, in exec_module
    File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
    File "c:\program files\python36\lib\site-packages\streamlink\plugins\livecodingtv.py", line 9, in <module>
      _url_re = re.compile('http(s)?://(?:\w+.)?\livecoding\.tv')
    File "c:\program files\python36\lib\re.py", line 233, in compile
      return _compile(pattern, flags)
    File "c:\program files\python36\lib\re.py", line 301, in _compile
      p = sre_compile.compile(pattern, flags)
    File "c:\program files\python36\lib\sre_compile.py", line 562, in compile
      p = sre_parse.parse(p, flags)
    File "c:\program files\python36\lib\sre_parse.py", line 856, in parse
      p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False)
    File "c:\program files\python36\lib\sre_parse.py", line 415, in _parse_sub
      itemsappend(_parse(source, state, verbose))
    File "c:\program files\python36\lib\sre_parse.py", line 501, in _parse
      code = _escape(source, this, state)
    File "c:\program files\python36\lib\sre_parse.py", line 401, in _escape
      raise source.error("bad escape %s" % escape, len(escape))
  sre_constants.error: bad escape \l at position 20
  
  usage: streamlink [OPTIONS] [URL] [STREAM]
  
  Use -h/--help to see the available options or read the manual at http://docs.streamlink.io/
  
  C:\WINDOWS\system32>python --version
  Python 3.6.0b2
  ```
  
  
  </issue>
  <code>
  [start of src/streamlink/plugins/livecodingtv.py]
  1 import re
  2 from streamlink.plugin import Plugin
  3 from streamlink.stream import RTMPStream, HTTPStream
  4 from streamlink.plugin.api import http
  5 
  6 
  7 _vod_re = re.compile('\"(http(s)?://.*\.mp4\?t=.*)\"')
  8 _rtmp_re = re.compile('rtmp://[^"]+/(?P<channel>\w+)+[^/"]+')
  9 _url_re = re.compile('http(s)?://(?:\w+.)?\livecoding\.tv')
  10 
  11 
  12 class LivecodingTV(Plugin):
  13     @classmethod
  14     def can_handle_url(cls, url):
  15         return _url_re.match(url)
  16 
  17     def _get_streams(self):
  18         res = http.get(self.url)
  19         match = _rtmp_re.search(res.content.decode('utf-8'))
  20         if match:
  21             params = {
  22                 "rtmp": match.group(0),
  23                 "pageUrl": self.url,
  24                 "live": True,
  25             }
  26             yield 'live', RTMPStream(self.session, params)
  27             return
  28 
  29         match = _vod_re.search(res.content.decode('utf-8'))
  30         if match:
  31             yield 'vod', HTTPStream(self.session, match.group(1))
  32 
  33 __plugin__ = LivecodingTV
  34
  [end of src/streamlink/plugins/livecodingtv.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/livecodingtv.py b/src/streamlink/plugins/livecodingtv.py
  --- a/src/streamlink/plugins/livecodingtv.py
  +++ b/src/streamlink/plugins/livecodingtv.py
  @@ -1,12 +1,20 @@
   import re
   from streamlink.plugin import Plugin
  +from streamlink.stream import HLSStream
   from streamlink.stream import RTMPStream, HTTPStream
   from streamlink.plugin.api import http
   
   
  -_vod_re = re.compile('\"(http(s)?://.*\.mp4\?t=.*)\"')
  -_rtmp_re = re.compile('rtmp://[^"]+/(?P<channel>\w+)+[^/"]+')
  -_url_re = re.compile('http(s)?://(?:\w+.)?\livecoding\.tv')
  +_streams_re = re.compile(r"""
  +    src:\s+"(
  +        rtmp://.*?\?t=.*?|                      # RTMP stream
  +        https?://.*?playlist.m3u8.*?\?t=.*?|    # HLS stream
  +        https?://.*?manifest.mpd.*?\?t=.*?|     # DASH stream
  +        https?://.*?.mp4\?t=.*?                 # HTTP stream
  +        )".*?
  +     type:\s+"(.*?)"                            # which stream type it is
  +     """, re.M | re.DOTALL | re.VERBOSE)
  +_url_re = re.compile(r"http(s)?://(?:\w+\.)?livecoding\.tv")
   
   
   class LivecodingTV(Plugin):
  @@ -16,18 +24,19 @@
   
       def _get_streams(self):
           res = http.get(self.url)
  -        match = _rtmp_re.search(res.content.decode('utf-8'))
  -        if match:
  -            params = {
  -                "rtmp": match.group(0),
  -                "pageUrl": self.url,
  -                "live": True,
  -            }
  -            yield 'live', RTMPStream(self.session, params)
  -            return
  -
  -        match = _vod_re.search(res.content.decode('utf-8'))
  -        if match:
  -            yield 'vod', HTTPStream(self.session, match.group(1))
  +        match = _streams_re.findall(res.content.decode('utf-8'))
  +        for url, stream_type in match:
  +            if stream_type == "rtmp/mp4" and RTMPStream.is_usable(self.session):
  +                params = {
  +                    "rtmp": url,
  +                    "pageUrl": self.url,
  +                    "live": True,
  +                }
  +                yield 'live', RTMPStream(self.session, params)
  +            elif stream_type == "application/x-mpegURL":
  +                for s in HLSStream.parse_variant_playlist(self.session, url).items():
  +                    yield s
  +            elif stream_type == "video/mp4":
  +                yield 'vod', HTTPStream(self.session, url)
   
   __plugin__ = LivecodingTV
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/livecodingtv.py b/src/streamlink/plugins/livecodingtv.py\n--- a/src/streamlink/plugins/livecodingtv.py\n+++ b/src/streamlink/plugins/livecodingtv.py\n@@ -1,12 +1,20 @@\n import re\n from streamlink.plugin import Plugin\n+from streamlink.stream import HLSStream\n from streamlink.stream import RTMPStream, HTTPStream\n from streamlink.plugin.api import http\n \n \n-_vod_re = re.compile('\\\"(http(s)?://.*\\.mp4\\?t=.*)\\\"')\n-_rtmp_re = re.compile('rtmp://[^\"]+/(?P<channel>\\w+)+[^/\"]+')\n-_url_re = re.compile('http(s)?://(?:\\w+.)?\\livecoding\\.tv')\n+_streams_re = re.compile(r\"\"\"\n+    src:\\s+\"(\n+        rtmp://.*?\\?t=.*?|                      # RTMP stream\n+        https?://.*?playlist.m3u8.*?\\?t=.*?|    # HLS stream\n+        https?://.*?manifest.mpd.*?\\?t=.*?|     # DASH stream\n+        https?://.*?.mp4\\?t=.*?                 # HTTP stream\n+        )\".*?\n+     type:\\s+\"(.*?)\"                            # which stream type it is\n+     \"\"\", re.M | re.DOTALL | re.VERBOSE)\n+_url_re = re.compile(r\"http(s)?://(?:\\w+\\.)?livecoding\\.tv\")\n \n \n class LivecodingTV(Plugin):\n@@ -16,18 +24,19 @@\n \n     def _get_streams(self):\n         res = http.get(self.url)\n-        match = _rtmp_re.search(res.content.decode('utf-8'))\n-        if match:\n-            params = {\n-                \"rtmp\": match.group(0),\n-                \"pageUrl\": self.url,\n-                \"live\": True,\n-            }\n-            yield 'live', RTMPStream(self.session, params)\n-            return\n-\n-        match = _vod_re.search(res.content.decode('utf-8'))\n-        if match:\n-            yield 'vod', HTTPStream(self.session, match.group(1))\n+        match = _streams_re.findall(res.content.decode('utf-8'))\n+        for url, stream_type in match:\n+            if stream_type == \"rtmp/mp4\" and RTMPStream.is_usable(self.session):\n+                params = {\n+                    \"rtmp\": url,\n+                    \"pageUrl\": self.url,\n+                    \"live\": True,\n+                }\n+                yield 'live', RTMPStream(self.session, params)\n+            elif stream_type == \"application/x-mpegURL\":\n+                for s in HLSStream.parse_variant_playlist(self.session, url).items():\n+                    yield s\n+            elif stream_type == \"video/mp4\":\n+                yield 'vod', HTTPStream(self.session, url)\n \n __plugin__ = LivecodingTV\n", "issue": "Plugin LivecodingTV fails to load on Python 3.6.0b2 on Windows 10 x64\nJust running streamlink raises the following error on my system with a fresh install:\n\n```\nC:\\WINDOWS\\system32>streamlink\nFailed to load plugin livecodingtv:\n  File \"c:\\program files\\python36\\lib\\imp.py\", line 234, in load_module\n    return load_source(name, filename, file)\n  File \"c:\\program files\\python36\\lib\\imp.py\", line 172, in load_source\n    module = _load(spec)\n  File \"<frozen importlib._bootstrap>\", line 675, in _load\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\n  File \"<frozen importlib._bootstrap_external>\", line 677, in exec_module\n  File \"<frozen importlib._bootstrap>\", line 205, in _call_with_frames_removed\n  File \"c:\\program files\\python36\\lib\\site-packages\\streamlink\\plugins\\livecodingtv.py\", line 9, in <module>\n    _url_re = re.compile('http(s)?://(?:\\w+.)?\\livecoding\\.tv')\n  File \"c:\\program files\\python36\\lib\\re.py\", line 233, in compile\n    return _compile(pattern, flags)\n  File \"c:\\program files\\python36\\lib\\re.py\", line 301, in _compile\n    p = sre_compile.compile(pattern, flags)\n  File \"c:\\program files\\python36\\lib\\sre_compile.py\", line 562, in compile\n    p = sre_parse.parse(p, flags)\n  File \"c:\\program files\\python36\\lib\\sre_parse.py\", line 856, in parse\n    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False)\n  File \"c:\\program files\\python36\\lib\\sre_parse.py\", line 415, in _parse_sub\n    itemsappend(_parse(source, state, verbose))\n  File \"c:\\program files\\python36\\lib\\sre_parse.py\", line 501, in _parse\n    code = _escape(source, this, state)\n  File \"c:\\program files\\python36\\lib\\sre_parse.py\", line 401, in _escape\n    raise source.error(\"bad escape %s\" % escape, len(escape))\nsre_constants.error: bad escape \\l at position 20\n\nusage: streamlink [OPTIONS] [URL] [STREAM]\n\nUse -h/--help to see the available options or read the manual at http://docs.streamlink.io/\n\nC:\\WINDOWS\\system32>python --version\nPython 3.6.0b2\n```\n\n", "before_files": [{"content": "import re\nfrom streamlink.plugin import Plugin\nfrom streamlink.stream import RTMPStream, HTTPStream\nfrom streamlink.plugin.api import http\n\n\n_vod_re = re.compile('\\\"(http(s)?://.*\\.mp4\\?t=.*)\\\"')\n_rtmp_re = re.compile('rtmp://[^\"]+/(?P<channel>\\w+)+[^/\"]+')\n_url_re = re.compile('http(s)?://(?:\\w+.)?\\livecoding\\.tv')\n\n\nclass LivecodingTV(Plugin):\n    @classmethod\n    def can_handle_url(cls, url):\n        return _url_re.match(url)\n\n    def _get_streams(self):\n        res = http.get(self.url)\n        match = _rtmp_re.search(res.content.decode('utf-8'))\n        if match:\n            params = {\n                \"rtmp\": match.group(0),\n                \"pageUrl\": self.url,\n                \"live\": True,\n            }\n            yield 'live', RTMPStream(self.session, params)\n            return\n\n        match = _vod_re.search(res.content.decode('utf-8'))\n        if match:\n            yield 'vod', HTTPStream(self.session, match.group(1))\n\n__plugin__ = LivecodingTV\n", "path": "src/streamlink/plugins/livecodingtv.py"}]}