Thanks.
What about the non-optional id and title concerns?
Using the plugin without authentication also currently does this instead of failing gracefully:
$ streamlink https://network.wwe.com/live/278763
Enter wwenetwork email:
Enter wwenetwork password:
[cli][info] Found matching plugin wwenetwork for URL https://network.wwe.com/live/278763
error: Unable to open URL: https://dce-frontoffice.imggaming.com/api/v2/login (422 Client Error: for url: https://dce-frontoffice.imggaming.com/api/v2/login)
With invalid auth data:
$ streamlink https://network.wwe.com/live/278763
Enter wwenetwork email: invalid
Enter wwenetwork password:
[cli][info] Found matching plugin wwenetwork for URL https://network.wwe.com/live/278763
error: Unable to validate response text: ValidationError(AnySchema):
ValidationError(dict):
Unable to validate value of key 'messages'
Context(ListSchema):
Length of list (3) does not match expectation (1)
ValidationError(dict):
Key 'authorisationToken' not found in <{'status': 404, 'code': 'NOT_FOUND', 'messages': ['fail...>
With no auth data and 422 added to acceptable_status:
$ streamlink https://network.wwe.com/live/278763
Enter wwenetwork email:
Enter wwenetwork password:
[cli][info] Found matching plugin wwenetwork for URL https://network.wwe.com/live/278763
error: Unable to validate response text: ValidationError(AnySchema):
ValidationError(dict):
Unable to validate value of key 'messages'
Context(ListSchema):
Length of list (2) does not match expectation (1)
ValidationError(dict):
Key 'authorisationToken' not found in <{'status': 422, 'code': '422', 'messages': ['passwordIs...>
diff --git a/src/streamlink/plugins/wwenetwork.py b/src/streamlink/plugins/wwenetwork.py index ea1f4869..86414e49 100644 --- a/src/streamlink/plugins/wwenetwork.py +++ b/src/streamlink/plugins/wwenetwork.py @@ -52,14 +52,14 @@ class WWENetwork(Plugin): def _login(self, email, password): success, data = self.session.http.post( self._API_LOGIN_URL, - acceptable_status=(200, 401, 404), + acceptable_status=(200, 401, 404, 422), json={"id": email, "secret": password}, headers=self._API_HEADERS, schema=validate.Schema( validate.parse_json(), validate.any( validate.all( - {"messages": validate.list(str)}, + {"messages": [str]}, validate.get(("messages", 0)), validate.transform(lambda data: (False, data)), ), @@ -88,7 +88,7 @@ class WWENetwork(Plugin): validate.parse_json(), validate.any( validate.all( - {"messages": validate.list(str)}, + {"messages": [str]}, validate.get(("messages", 0)), validate.transform(lambda message: (False, message)), ),
$ streamlink https://network.wwe.com/live/278763
Enter wwenetwork email:
Enter wwenetwork password:
[cli][info] Found matching plugin wwenetwork for URL https://network.wwe.com/live/278763
[plugins.wwenetwork][error] passwordIsRequired
error: No playable streams found on this URL: https://network.wwe.com/live/278763
$ streamlink https://network.wwe.com/live/278763
Enter wwenetwork email: invalid
Enter wwenetwork password:
[cli][info] Found matching plugin wwenetwork for URL https://network.wwe.com/live/278763
[plugins.wwenetwork][error] failedAuthentication
error: No playable streams found on this URL: https://network.wwe.com/live/278763