Repository: streamlink/streamlink

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!



Discussion:

Resolving patch:
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 @@ class INE(Plugin):
             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 @@ def _get_streams(self):
             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


Test patch: