Merge branch 'master' into 391/improve-youtube-support

This commit is contained in:
Fabio Manganiello 2024-07-13 00:41:46 +02:00
commit 81fb1a47c3
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 13 additions and 0 deletions

Binary file not shown.

View file

@ -360,6 +360,19 @@ class YoutubePlugin(Plugin):
json={'playlistId': id}, 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 @action
def subscribe(self, channel_id: str): def subscribe(self, channel_id: str):
""" """