-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
plugins.afreeca: rename to soop #6247
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
Conversation
Thanks for the PR. Considering that they completely rebranded, it doesn't make sense keeping the "afreeca" plugin name. So, could you please
|
3d45a7d
to
909ede1
Compare
I've made the changes based on the feedback you gave me. In Korea, it is referred to as 'soop' rather than 'sooplive,' so I changed the plugin name to I was wondering if there's any way to alias the plugin name so that users don't find it inconvenient when they have to change |
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.
so I changed the plugin name to
soop
👍
I was wondering if there's any way to alias the plugin name so that users don't find it inconvenient when they have to change
--afreeca-username
to--soop-username
?
Plugin arguments currently don't support aliases (similar to the argparse module). This requires adding duplicates and suppressing them, so they're not listed in the docs, man page and help output. Their values then need to be set in place of the regular arguments if they are missing.
However, the values of suppressed arguments currently get discarded/ignored when set, because there wasn't a use-case for this yet. I've just changed this behavior in #6249 which I just opened. You'll have to rebase your PR onto the new HEAD of master once #6249 got merged in order to test this.
Another limitation of suppressed plugin arguments is that any argument requirements will be ignored, so if only --afreeca-username
is set, it won't ask for a value of --afreeca-password
/--soop-password
.
Here's a diff that would add support for the old arguments:
diff --git a/src/streamlink/plugins/soop.py b/src/streamlink/plugins/soop.py
index d41eb7e9..073a2d23 100644
--- a/src/streamlink/plugins/soop.py
+++ b/src/streamlink/plugins/soop.py
@@ -8,6 +8,7 @@ $metadata author
$metadata title
"""
+import argparse
import logging
import re
@@ -60,7 +61,37 @@ class SoopHLSStream(HLSStream):
metavar="STREAM_PASSWORD",
help="The password for the stream.",
)
+@pluginargument(
+ "afreeca-username",
+ argument_name="afreeca-username",
+ sensitive=True,
+ help=argparse.SUPPRESS,
+)
+@pluginargument(
+ "afreeca-password",
+ argument_name="afreeca-password",
+ sensitive=True,
+ help=argparse.SUPPRESS,
+)
+@pluginargument(
+ "afreeca-purge-credentials",
+ argument_name="afreeca-purge-credentials",
+ action="store_true",
+ help=argparse.SUPPRESS,
+)
+@pluginargument(
+ "afreeca-stream-password",
+ argument_name="afreeca-stream-password",
+ help=argparse.SUPPRESS,
+)
class Soop(Plugin):
+ _OPTIONS_DEPRECATED = {
+ "afreeca-username": "username",
+ "afreeca-password": "password",
+ "afreeca-purge-credentials": "purge-credentials",
+ "afreeca-stream-password": "stream-password",
+ }
+
_re_bno = re.compile(r"window\.nBroadNo\s*=\s*(?P<bno>\d+);")
CHANNEL_API_URL = "https://live.sooplive.co.kr/afreeca/player_live_api.php"
@@ -99,6 +130,11 @@ class Soop(Plugin):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
+
+ for opt_deprecated, opt_name in self._OPTIONS_DEPRECATED.items():
+ if (opt_value := self.options.get(opt_deprecated)) and not self.options.get(opt_name):
+ self.options.set(opt_name, opt_value)
+
self._authed = (
self.session.http.cookies.get("PdboxBbs")
and self.session.http.cookies.get("PdboxSaveTicket")
I'll have a look at adding plugin argument aliases in the future, so plugins don't have to deal with this nonsense.
@minibox24 Could you please quickly check and see if the authentication is working for these kinds of streams: If everything's working, then we can merge this. Thanks. |
I tested it, and everything works fine. |
Resolves #6246
Worked on changing hosts as
afreecatv.com
was rebranded tosooplive.co.kr
.Fixed login functionality that was not working due to this.