~.youtube
YouTube
YouTubeThumbnail
YouTube thumbnail data.
Create a new thumbnail container.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
The raw thumbnail data. |
YouTubePartialVideo
Partial YouTube video data.
Create a new partial YouTube video container.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
The raw video data. |
channel_id
property
channel_id: str | None
The ID of the channel that uploaded the video, if provided.
thumbnail
property
thumbnail: str | None
The URL of the primary thumbnail of the video, if provided.
thumbnails
property
thumbnails: list[YouTubeThumbnail]
A collection of all video thumbnails, if provided.
YouTubeSearchResult
Result of a YouTube search.
Create a new YouTube search result.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
The query used to search YouTube.
TYPE:
|
data
|
The raw data passed from |
YouTube
Utility class containing UX features for YouTube.
Warning
This is an experimental feature. This may change or be removed with or without notice at any time.
queue_from_playlist
async
staticmethod
queue_from_playlist(
player: AudioPlayer,
url: str,
*,
limit: int = None,
autoplay: bool = True,
shuffle: bool = False
) -> list[YouTubeAudioSource]
Queue audio from a YouTube playlist into an audio player queue.
| PARAMETER | DESCRIPTION |
|---|---|
player
|
The audio player to queue the audio in.
TYPE:
|
url
|
The YouTube playlist URL to add.
TYPE:
|
limit
|
If provided, the maximum amount of audio to queue.
TYPE:
|
autoplay
|
If provided, controls if the player should automatically play the first queued audio if the player isn't playing anything.
TYPE:
|
shuffle
|
If provided, if the queued audio should be shuffled instead of the order of the playlist.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[YouTubeAudioSource]
|
A reference to all audio added to the queue. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
Warning
This is an experimental feature. This may change or be removed with or without notice at any time.
search
async
staticmethod
search(
query: str, limit: int = 10
) -> YouTubeSearchResult | None
Asynchronously search YouTube via a query.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
The keywords/query to search YouTube with.
TYPE:
|
limit
|
The maximum amount of results to return.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
YouTubeSearchResult
|
The resulting search from the query, if successful. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
Warning
This is an experimental feature. This may change or be removed with or without notice at any time.
search_sync
staticmethod
search_sync(
query: str, limit: int = 10
) -> YouTubeSearchResult | None
Synchronously search YouTube via a query.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
The keywords/query to search YouTube with.
TYPE:
|
limit
|
The maximum amount of results to return.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
YouTubeSearchResult
|
The resulting search from the query, if successful. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
Warning
This is an experimental feature. This may change or be removed with or without notice at any time.