[youtube] Added youtube.is_subscribed action.

This commit is contained in:
Fabio Manganiello 2024-07-13 00:41:12 +02:00
parent c7f12e0bd8
commit 24b5b3ba14
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -360,6 +360,19 @@ class YoutubePlugin(Plugin):
json={'playlistId': id},
)
@action
def is_subscribed(self, channel_id: str) -> bool:
"""
Check if the user is subscribed to a channel.
:param channel_id: YouTube channel ID.
:return: True if the user is subscribed to the channel, False otherwise.
"""
return self._request(
'subscribed',
params={'channelId': channel_id},
).get('subscribed', False)
@action
def subscribe(self, channel_id: str):
"""