prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Unable to validate result: <_sre.SRE_Match object; ... should be 'list' but is 'str'
  ### Checklist
  
  - [x] This is a bug report.
  - [ ] This is a feature request.
  - [ ] This is a plugin (improvement) request.
  - [ ] I have read the contribution guidelines.
  
  ### Description
  
  Hi, something's failing when trying to fetch a video from INE, mac OS 10.12.6:
  
  ```
  $ streamlink -o ./streamlink.mp4 https://streaming.ine.com/play/97c49b6f-5cda-4e66-859d-627ba2e9e26e/lab-setup 720p --loglevel debug --http-cookie laravel_session=<removed>
  [cli][debug] OS:         macOS 10.12.6
  [cli][debug] Python:     3.5.5
  [cli][debug] Streamlink: 0.12.1
  [cli][debug] Requests(2.18.1), Socks(1.6.7), Websocket(0.47.0)
  [cli][info] Found matching plugin ine for URL https://streaming.ine.com/play/97c49b6f-5cda-4e66-859d-627ba2e9e26e/lab-setup
  [plugin.ine][debug] Found video ID: 97c49b6f-5cda-4e66-859d-627ba2e9e26e
  [plugin.ine][debug] Loading player JS: https://content.jwplatform.com/players/gdH3hfpy-p4NBeNN0.js?exp=1527771621&amp;sig=<removed>
  error: Unable to validate result: <_sre.SRE_Match object; span=(100223, 101420), match='jwConfig = {\n  "aspectratio": "16:9",\n  "autost> does not equal None or Unable to validate key 'playlist': Type of '//content.jwplatform.com/v2/media/gdH3hfpy?token=<removed>' should be 'list' but is 'str'
  $ 
  $ python --version
  Python 3.5.5
  $ streamlink --version-check
  [cli][info] Your Streamlink version (0.12.1) is up to date!
  $ 
  ```
  Any ideas? Thanks!
  
  
  --- 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/ine.py`
  Content:
  ```
  1 from __future__ import print_function
  2 
  3 import json
  4 import re
  5 
  6 from streamlink.plugin import Plugin
  7 from streamlink.plugin.api import http
  8 from streamlink.plugin.api import validate
  9 from streamlink.stream import HLSStream
  10 
  11 
  12 class INE(Plugin):
  13     url_re = re.compile(r"""https://streaming.ine.com/play\#?/
  14             ([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/?
  15             (.*?)""", re.VERBOSE)
  16     play_url = "https://streaming.ine.com/play/{vid}/watch"
  17     js_re = re.compile(r'''script type="text/javascript" src="(https://content.jwplatform.com/players/.*?)"''')
  18     jwplayer_re = re.compile(r'''jwConfig\s*=\s*(\{.*\});''', re.DOTALL)
  19     setup_schema = validate.Schema(
  20         validate.transform(jwplayer_re.search),
  21         validate.any(
  22             None,
  23             validate.all(
  24                 validate.get(1),
  25                 validate.transform(json.loads),
  26                 {"playlist": [
  27                     {"sources": [{"file": validate.text,
  28                                   "type": validate.text}]}
  29                 ]}
  30             )
  31         )
  32     )
  33 
  34     @classmethod
  35     def can_handle_url(cls, url):
  36         return cls.url_re.match(url) is not None
  37 
  38     def _get_streams(self):
  39         vid = self.url_re.match(self.url).group(1)
  40         self.logger.debug("Found video ID: {0}", vid)
  41 
  42         page = http.get(self.play_url.format(vid=vid))
  43         js_url_m = self.js_re.search(page.text)
  44         if js_url_m:
  45             js_url = js_url_m.group(1)
  46             self.logger.debug("Loading player JS: {0}", js_url)
  47 
  48             res = http.get(js_url)
  49             data = self.setup_schema.validate(res.text)
  50             for source in data["playlist"][0]["sources"]:
  51                 if source["type"] == "hls":
  52                     return HLSStream.parse_variant_playlist(self.session, "https:" + source["file"])
  53 
  54 
  55 __plugin__ = INE
  56
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/src/streamlink/plugins/ine.py b/src/streamlink/plugins/ine.py
  --- a/src/streamlink/plugins/ine.py
  +++ b/src/streamlink/plugins/ine.py
  @@ -6,7 +6,8 @@
   from streamlink.plugin import Plugin
   from streamlink.plugin.api import http
   from streamlink.plugin.api import validate
  -from streamlink.stream import HLSStream
  +from streamlink.stream import HLSStream, HTTPStream
  +from streamlink.utils import update_scheme
   
   
   class INE(Plugin):
  @@ -23,10 +24,8 @@
               validate.all(
                   validate.get(1),
                   validate.transform(json.loads),
  -                {"playlist": [
  -                    {"sources": [{"file": validate.text,
  -                                  "type": validate.text}]}
  -                ]}
  +                {"playlist": str},
  +                validate.get("playlist")
               )
           )
       )
  @@ -46,10 +45,15 @@
               self.logger.debug("Loading player JS: {0}", js_url)
   
               res = http.get(js_url)
  -            data = self.setup_schema.validate(res.text)
  +            metadata_url = update_scheme(self.url, self.setup_schema.validate(res.text))
  +            data = http.json(http.get(metadata_url))
  +
               for source in data["playlist"][0]["sources"]:
  -                if source["type"] == "hls":
  -                    return HLSStream.parse_variant_playlist(self.session, "https:" + source["file"])
  +                if source["type"] == "application/vnd.apple.mpegurl":
  +                    for s in HLSStream.parse_variant_playlist(self.session, source["file"]).items():
  +                        yield s
  +                elif source["type"] == "video/mp4":
  +                    yield "{0}p".format(source["height"]), HTTPStream(self.session, source["file"])
   
   
   __plugin__ = INE
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/ine.py b/src/streamlink/plugins/ine.py\n--- a/src/streamlink/plugins/ine.py\n+++ b/src/streamlink/plugins/ine.py\n@@ -6,7 +6,8 @@\n from streamlink.plugin import Plugin\n from streamlink.plugin.api import http\n from streamlink.plugin.api import validate\n-from streamlink.stream import HLSStream\n+from streamlink.stream import HLSStream, HTTPStream\n+from streamlink.utils import update_scheme\n \n \n class INE(Plugin):\n@@ -23,10 +24,8 @@\n             validate.all(\n                 validate.get(1),\n                 validate.transform(json.loads),\n-                {\"playlist\": [\n-                    {\"sources\": [{\"file\": validate.text,\n-                                  \"type\": validate.text}]}\n-                ]}\n+                {\"playlist\": str},\n+                validate.get(\"playlist\")\n             )\n         )\n     )\n@@ -46,10 +45,15 @@\n             self.logger.debug(\"Loading player JS: {0}\", js_url)\n \n             res = http.get(js_url)\n-            data = self.setup_schema.validate(res.text)\n+            metadata_url = update_scheme(self.url, self.setup_schema.validate(res.text))\n+            data = http.json(http.get(metadata_url))\n+\n             for source in data[\"playlist\"][0][\"sources\"]:\n-                if source[\"type\"] == \"hls\":\n-                    return HLSStream.parse_variant_playlist(self.session, \"https:\" + source[\"file\"])\n+                if source[\"type\"] == \"application/vnd.apple.mpegurl\":\n+                    for s in HLSStream.parse_variant_playlist(self.session, source[\"file\"]).items():\n+                        yield s\n+                elif source[\"type\"] == \"video/mp4\":\n+                    yield \"{0}p\".format(source[\"height\"]), HTTPStream(self.session, source[\"file\"])\n \n \n __plugin__ = INE\n", "issue": "Unable to validate result: <_sre.SRE_Match object; ... should be 'list' but is 'str'\n### Checklist\r\n\r\n- [x] This is a bug report.\r\n- [ ] This is a feature request.\r\n- [ ] This is a plugin (improvement) request.\r\n- [ ] I have read the contribution guidelines.\r\n\r\n### Description\r\n\r\nHi, something's failing when trying to fetch a video from INE, mac OS 10.12.6:\r\n\r\n```\r\n$ streamlink -o ./streamlink.mp4 https://streaming.ine.com/play/97c49b6f-5cda-4e66-859d-627ba2e9e26e/lab-setup 720p --loglevel debug --http-cookie laravel_session=<removed>\r\n[cli][debug] OS:         macOS 10.12.6\r\n[cli][debug] Python:     3.5.5\r\n[cli][debug] Streamlink: 0.12.1\r\n[cli][debug] Requests(2.18.1), Socks(1.6.7), Websocket(0.47.0)\r\n[cli][info] Found matching plugin ine for URL https://streaming.ine.com/play/97c49b6f-5cda-4e66-859d-627ba2e9e26e/lab-setup\r\n[plugin.ine][debug] Found video ID: 97c49b6f-5cda-4e66-859d-627ba2e9e26e\r\n[plugin.ine][debug] Loading player JS: https://content.jwplatform.com/players/gdH3hfpy-p4NBeNN0.js?exp=1527771621&amp;sig=<removed>\r\nerror: Unable to validate result: <_sre.SRE_Match object; span=(100223, 101420), match='jwConfig = {\\n  \"aspectratio\": \"16:9\",\\n  \"autost> does not equal None or Unable to validate key 'playlist': Type of '//content.jwplatform.com/v2/media/gdH3hfpy?token=<removed>' should be 'list' but is 'str'\r\n$ \r\n$ python --version\r\nPython 3.5.5\r\n$ streamlink --version-check\r\n[cli][info] Your Streamlink version (0.12.1) is up to date!\r\n$ \r\n```\r\nAny ideas? Thanks!\r\n\n", "before_files": [{"content": "from __future__ import print_function\n\nimport json\nimport re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream import HLSStream\n\n\nclass INE(Plugin):\n    url_re = re.compile(r\"\"\"https://streaming.ine.com/play\\#?/\n            ([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/?\n            (.*?)\"\"\", re.VERBOSE)\n    play_url = \"https://streaming.ine.com/play/{vid}/watch\"\n    js_re = re.compile(r'''script type=\"text/javascript\" src=\"(https://content.jwplatform.com/players/.*?)\"''')\n    jwplayer_re = re.compile(r'''jwConfig\\s*=\\s*(\\{.*\\});''', re.DOTALL)\n    setup_schema = validate.Schema(\n        validate.transform(jwplayer_re.search),\n        validate.any(\n            None,\n            validate.all(\n                validate.get(1),\n                validate.transform(json.loads),\n                {\"playlist\": [\n                    {\"sources\": [{\"file\": validate.text,\n                                  \"type\": validate.text}]}\n                ]}\n            )\n        )\n    )\n\n    @classmethod\n    def can_handle_url(cls, url):\n        return cls.url_re.match(url) is not None\n\n    def _get_streams(self):\n        vid = self.url_re.match(self.url).group(1)\n        self.logger.debug(\"Found video ID: {0}\", vid)\n\n        page = http.get(self.play_url.format(vid=vid))\n        js_url_m = self.js_re.search(page.text)\n        if js_url_m:\n            js_url = js_url_m.group(1)\n            self.logger.debug(\"Loading player JS: {0}\", js_url)\n\n            res = http.get(js_url)\n            data = self.setup_schema.validate(res.text)\n            for source in data[\"playlist\"][0][\"sources\"]:\n                if source[\"type\"] == \"hls\":\n                    return HLSStream.parse_variant_playlist(self.session, \"https:\" + source[\"file\"])\n\n\n__plugin__ = INE\n", "path": "src/streamlink/plugins/ine.py"}], "after_files": [{"content": "from __future__ import print_function\n\nimport json\nimport re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream import HLSStream, HTTPStream\nfrom streamlink.utils import update_scheme\n\n\nclass INE(Plugin):\n    url_re = re.compile(r\"\"\"https://streaming.ine.com/play\\#?/\n            ([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/?\n            (.*?)\"\"\", re.VERBOSE)\n    play_url = \"https://streaming.ine.com/play/{vid}/watch\"\n    js_re = re.compile(r'''script type=\"text/javascript\" src=\"(https://content.jwplatform.com/players/.*?)\"''')\n    jwplayer_re = re.compile(r'''jwConfig\\s*=\\s*(\\{.*\\});''', re.DOTALL)\n    setup_schema = validate.Schema(\n        validate.transform(jwplayer_re.search),\n        validate.any(\n            None,\n            validate.all(\n                validate.get(1),\n                validate.transform(json.loads),\n                {\"playlist\": str},\n                validate.get(\"playlist\")\n            )\n        )\n    )\n\n    @classmethod\n    def can_handle_url(cls, url):\n        return cls.url_re.match(url) is not None\n\n    def _get_streams(self):\n        vid = self.url_re.match(self.url).group(1)\n        self.logger.debug(\"Found video ID: {0}\", vid)\n\n        page = http.get(self.play_url.format(vid=vid))\n        js_url_m = self.js_re.search(page.text)\n        if js_url_m:\n            js_url = js_url_m.group(1)\n            self.logger.debug(\"Loading player JS: {0}\", js_url)\n\n            res = http.get(js_url)\n            metadata_url = update_scheme(self.url, self.setup_schema.validate(res.text))\n            data = http.json(http.get(metadata_url))\n\n            for source in data[\"playlist\"][0][\"sources\"]:\n                if source[\"type\"] == \"application/vnd.apple.mpegurl\":\n                    for s in HLSStream.parse_variant_playlist(self.session, source[\"file\"]).items():\n                        yield s\n                elif source[\"type\"] == \"video/mp4\":\n                    yield \"{0}p\".format(source[\"height\"]), HTTPStream(self.session, source[\"file\"])\n\n\n__plugin__ = INE\n", "path": "src/streamlink/plugins/ine.py"}]}