-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
plugins.wwenetwork: rewrite and fix plugin #6404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugins.wwenetwork: rewrite and fix plugin #6404
Conversation
c32403b
to
eb03712
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, appreciated. Looks very clean. 👍
Two minor things though that might be worth changing...
Considering that auth data is required and that you've included a few debug logs, I'm going to trust you that this plugin implementation is indeed correct, without having a look myself.
eb03712
to
25c3219
Compare
Thanks for the review! I have also made changes to the scheme for retrieving
|
Thanks. What about the non-optional Using the plugin without authentication also currently does this instead of failing gracefully:
With invalid auth data:
With no auth data and
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)),
),
|
As for After your review, I definitely got the 400 error once. I couldn't reproduce it again. Is it that this status code needs to be added as well?
|
I don't get a 400 status code response on that address with none, partial or invalid auth data. |
25c3219
to
28163ac
Compare
Thanks |
Closes: #5674
I can provide an account with an active subscription for testing purposes.