We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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"
```

--- 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/huya.py`
Content:
```
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 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()

```

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

{"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"}], "after_files": [{"content": "import re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http, validate\nfrom streamlink.stream import HLSStream\nfrom streamlink.plugin.api import useragents\nfrom streamlink.utils import update_scheme\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\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, update_scheme(\"http://\", hls_url))\n\n\n__plugin__ = Huya\n", "path": "src/streamlink/plugins/huya.py"}]}