forked from platypush/platypush
[youtube] Added youtube.is_subscribed
action.
This commit is contained in:
parent
c7f12e0bd8
commit
24b5b3ba14
1 changed files with 13 additions and 0 deletions
|
@ -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):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue