Exceptions¶
- exception ayt_api.exceptions.YoutubeExceptions[source]¶
Bases:
BaseException
Base exception for errors regarding the YouTube API.
- exception ayt_api.exceptions.ResourceNotFound[source]¶
Bases:
YoutubeExceptions
Base exceptions for errors relating to a missing YouTube resource.
- exception ayt_api.exceptions.AuthException[source]¶
Bases:
YoutubeExceptions
Base exceptions for errors related to authorisation.
Added in version 0.4.0.
- exception ayt_api.exceptions.OAuth2Exception[source]¶
Bases:
AuthException
Base exceptions for errors related to OAuth2.
Added in version 0.4.0.
- exception ayt_api.exceptions.PlaylistNotFound(playlist_id: str | list[str])[source]¶
Bases:
ResourceNotFound
Raises if the specified playlist id does not exist on YouTube.
- exception ayt_api.exceptions.VideoNotFound(video_id: str | list[str])[source]¶
Bases:
ResourceNotFound
Raises if the specified video id does not exist on YouTube.
- exception ayt_api.exceptions.ChannelNotFound(channel_id: str | list[str] = None)[source]¶
Bases:
ResourceNotFound
Raises if the specified channel id or username does not exist on YouTube.
- exception ayt_api.exceptions.CommentNotFound(comment_id: str | list[str])[source]¶
Bases:
ResourceNotFound
Raises if the specified comment id does not exist on YouTube.
- exception ayt_api.exceptions.VideoCategoryNotFound(category_id: str | list[str])[source]¶
Bases:
ResourceNotFound
Raises if the specified video category id does not exist on YouTube.
- exception ayt_api.exceptions.WatermarkNotFound(message: str = None)[source]¶
Bases:
ResourceNotFound
Raises if there is no watermark set for a channel
Added in version 0.4.0.
- exception ayt_api.exceptions.InvalidMetadata(metadata: dict, message='The the data in the dictionary provided is invalid')[source]¶
Bases:
YoutubeExceptions
Raises when invalid metadata is given.
- exception ayt_api.exceptions.MissingDataFromMetadata(missing_data: str, metadata: dict, exception: Exception)[source]¶
Bases:
InvalidMetadata
Raises when the metadata in the response is malformed.
- exception ayt_api.exceptions.InvalidInput(invalid_input)[source]¶
Bases:
YoutubeExceptions
Raises if an argument in a function is invalid or empty.
- input¶
The invalid input that was provided.
- Type:
Any
- exception ayt_api.exceptions.InvalidKey[source]¶
Bases:
AuthException
Exception that’s raised when an invalid API key is passed.
- exception ayt_api.exceptions.InvalidToken[source]¶
Bases:
OAuth2Exception
Exception that’s raised when an OAuth token is invalid, expired or one is needed.
Added in version 0.4.0.
- exception ayt_api.exceptions.NoAuth[source]¶
Bases:
AuthException
Exception that is raised when neither an api key nor an oauth token is provided to
AsyncYoutubeAPI
.Added in version 0.4.0.
- exception ayt_api.exceptions.NoSession[source]¶
Bases:
OAuth2Exception
Raises when performing an operation that needs an
OAuth2Session
instance when there isn’t one.Added in version 0.4.0.
- exception ayt_api.exceptions.APITimeout(timeout_set: ClientTimeout)[source]¶
Bases:
YoutubeExceptions
Exception that’s raised when the api does not respond within the timeout set.