add_listener

AsyncYouTubeNotifier.add_listener(func: Callable[[Video], Coroutine[Any, Any, Any]], kind: NotificationKind, channel_ids: str | Iterable[str] = None) Self

Add a listener for push notifications.

Parameters:
  • func – The listener function to add.

  • kind – The kind of notification to listen for.

  • channel_ids – The channel ID(s) to listen for. If not provided, the listener will be called for all channels.

Returns:

The YouTubeNotifier instance to allow for method chaining.

Raises:

ValueError – If the channel ID is ‘_all’.