prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  catch a simple bug of handling url
  
  ### Checklist
  
  - [x] This is a bug report.
  
  ### Description
  
  catch a simple bug of returning url.  
  
  ### Version
  streamlink 0.9.0
  
  ### Unexpected behavior
  for example
  ```sh
  streamlink http://www.huya.com/1547946968 "best"
  ```
  it reports:
  requests.exceptions.MissingSchema: Invalid URL '//ws.streamhls.huya.com/huyalive/30765679-2523417567-10837995924416888832-2789253832-10057-A-1512526581-1_1200/playlist.m3u8': No schema supplied. Perhaps you meant http:////ws.streamhls.huya.com/huyalive/30765679-2523417567-10837995924416888832-2789253832-10057-A-1512526581-1_1200/playlist.m3u8?
  
  ### Expected behavior
  but if you replace with the m3u8 url above, by **removing // header**, it will work.
  The equivalent successful example are as follows:
  ```sh
  streamlink ws.streamhls.huya.com/huyalive/30765679-2523417567-10837995924416888832-2789253832-10057-A-1512526581-1_1200/playlist.m3u8 "best"
  ```
  
  </issue>
  <code>
  [start of src/streamlink/plugins/huya.py]
  1 import re
  2 
  3 from requests.adapters import HTTPAdapter
  4 
  5 from streamlink.plugin import Plugin
  6 from streamlink.plugin.api import http, validate
  7 from streamlink.stream import HLSStream
  8 from streamlink.plugin.api import useragents
  9 
  10 HUYA_URL = "http://m.huya.com/%s"
  11 
  12 _url_re = re.compile(r'http(s)?://(www\.)?huya.com/(?P<channel>[^/]+)', re.VERBOSE)
  13 _hls_re = re.compile(r'^\s*<video\s+id="html5player-video"\s+src="(?P<url>[^"]+)"', re.MULTILINE)
  14 
  15 _hls_schema = validate.Schema(
  16         validate.all(
  17             validate.transform(_hls_re.search),
  18             validate.any(
  19                 None,
  20                 validate.all(
  21                     validate.get('url'),
  22                     validate.transform(str)
  23                     )
  24                 )
  25             )
  26         )
  27 
  28 class Huya(Plugin):
  29     @classmethod
  30     def can_handle_url(self, url):
  31         return _url_re.match(url)
  32 
  33     def _get_streams(self):
  34         match = _url_re.match(self.url)
  35         channel = match.group("channel")
  36 
  37         http.headers.update({"User-Agent": useragents.IPAD})
  38         #Some problem with SSL on huya.com now, do not use https
  39 
  40         hls_url = http.get(HUYA_URL % channel, schema=_hls_schema)
  41         yield "live", HLSStream(self.session, hls_url)
  42 
  43 __plugin__ = Huya
  44
  [end of src/streamlink/plugins/huya.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/huya.py b/src/streamlink/plugins/huya.py
  --- a/src/streamlink/plugins/huya.py
  +++ b/src/streamlink/plugins/huya.py
  @@ -1,11 +1,10 @@
   import re
   
  -from requests.adapters import HTTPAdapter
  -
   from streamlink.plugin import Plugin
   from streamlink.plugin.api import http, validate
   from streamlink.stream import HLSStream
   from streamlink.plugin.api import useragents
  +from streamlink.utils import update_scheme
   
   HUYA_URL = "http://m.huya.com/%s"
   
  @@ -13,17 +12,18 @@
   _hls_re = re.compile(r'^\s*<video\s+id="html5player-video"\s+src="(?P<url>[^"]+)"', re.MULTILINE)
   
   _hls_schema = validate.Schema(
  -        validate.all(
  -            validate.transform(_hls_re.search),
  -            validate.any(
  -                None,
  -                validate.all(
  -                    validate.get('url'),
  -                    validate.transform(str)
  -                    )
  -                )
  +    validate.all(
  +        validate.transform(_hls_re.search),
  +        validate.any(
  +            None,
  +            validate.all(
  +                validate.get('url'),
  +                validate.transform(str)
               )
           )
  +    )
  +)
  +
   
   class Huya(Plugin):
       @classmethod
  @@ -35,9 +35,10 @@
           channel = match.group("channel")
   
           http.headers.update({"User-Agent": useragents.IPAD})
  -        #Some problem with SSL on huya.com now, do not use https
  +        # Some problem with SSL on huya.com now, do not use https
   
           hls_url = http.get(HUYA_URL % channel, schema=_hls_schema)
  -        yield "live", HLSStream(self.session, hls_url)
  +        yield "live", HLSStream(self.session, update_scheme("http://", hls_url))
  +
   
   __plugin__ = Huya
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/huya.py b/src/streamlink/plugins/huya.py\n--- a/src/streamlink/plugins/huya.py\n+++ b/src/streamlink/plugins/huya.py\n@@ -1,11 +1,10 @@\n import re\n \n-from requests.adapters import HTTPAdapter\n-\n from streamlink.plugin import Plugin\n from streamlink.plugin.api import http, validate\n from streamlink.stream import HLSStream\n from streamlink.plugin.api import useragents\n+from streamlink.utils import update_scheme\n \n HUYA_URL = \"http://m.huya.com/%s\"\n \n@@ -13,17 +12,18 @@\n _hls_re = re.compile(r'^\\s*<video\\s+id=\"html5player-video\"\\s+src=\"(?P<url>[^\"]+)\"', re.MULTILINE)\n \n _hls_schema = validate.Schema(\n-        validate.all(\n-            validate.transform(_hls_re.search),\n-            validate.any(\n-                None,\n-                validate.all(\n-                    validate.get('url'),\n-                    validate.transform(str)\n-                    )\n-                )\n+    validate.all(\n+        validate.transform(_hls_re.search),\n+        validate.any(\n+            None,\n+            validate.all(\n+                validate.get('url'),\n+                validate.transform(str)\n             )\n         )\n+    )\n+)\n+\n \n class Huya(Plugin):\n     @classmethod\n@@ -35,9 +35,10 @@\n         channel = match.group(\"channel\")\n \n         http.headers.update({\"User-Agent\": useragents.IPAD})\n-        #Some problem with SSL on huya.com now, do not use https\n+        # Some problem with SSL on huya.com now, do not use https\n \n         hls_url = http.get(HUYA_URL % channel, schema=_hls_schema)\n-        yield \"live\", HLSStream(self.session, hls_url)\n+        yield \"live\", HLSStream(self.session, update_scheme(\"http://\", hls_url))\n+\n \n __plugin__ = Huya\n", "issue": "catch a simple bug of handling url\n\r\n### Checklist\r\n\r\n- [x] This is a bug report.\r\n\r\n### Description\r\n\r\ncatch a simple bug of returning url.  \r\n\r\n### Version\r\nstreamlink 0.9.0\r\n\r\n### Unexpected behavior\r\nfor example\r\n```sh\r\nstreamlink http://www.huya.com/1547946968 \"best\"\r\n```\r\nit reports:\r\nrequests.exceptions.MissingSchema: Invalid URL '//ws.streamhls.huya.com/huyalive/30765679-2523417567-10837995924416888832-2789253832-10057-A-1512526581-1_1200/playlist.m3u8': No schema supplied. Perhaps you meant http:////ws.streamhls.huya.com/huyalive/30765679-2523417567-10837995924416888832-2789253832-10057-A-1512526581-1_1200/playlist.m3u8?\r\n\r\n### Expected behavior\r\nbut if you replace with the m3u8 url above, by **removing // header**, it will work.\r\nThe equivalent successful example are as follows:\r\n```sh\r\nstreamlink ws.streamhls.huya.com/huyalive/30765679-2523417567-10837995924416888832-2789253832-10057-A-1512526581-1_1200/playlist.m3u8 \"best\"\r\n```\n", "before_files": [{"content": "import re\n\nfrom requests.adapters import HTTPAdapter\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http, validate\nfrom streamlink.stream import HLSStream\nfrom streamlink.plugin.api import useragents\n\nHUYA_URL = \"http://m.huya.com/%s\"\n\n_url_re = re.compile(r'http(s)?://(www\\.)?huya.com/(?P<channel>[^/]+)', re.VERBOSE)\n_hls_re = re.compile(r'^\\s*<video\\s+id=\"html5player-video\"\\s+src=\"(?P<url>[^\"]+)\"', re.MULTILINE)\n\n_hls_schema = validate.Schema(\n        validate.all(\n            validate.transform(_hls_re.search),\n            validate.any(\n                None,\n                validate.all(\n                    validate.get('url'),\n                    validate.transform(str)\n                    )\n                )\n            )\n        )\n\nclass Huya(Plugin):\n    @classmethod\n    def can_handle_url(self, url):\n        return _url_re.match(url)\n\n    def _get_streams(self):\n        match = _url_re.match(self.url)\n        channel = match.group(\"channel\")\n\n        http.headers.update({\"User-Agent\": useragents.IPAD})\n        #Some problem with SSL on huya.com now, do not use https\n\n        hls_url = http.get(HUYA_URL % channel, schema=_hls_schema)\n        yield \"live\", HLSStream(self.session, hls_url)\n\n__plugin__ = Huya\n", "path": "src/streamlink/plugins/huya.py"}]}