Type of SoundCloud
type for Spotify Classes
Type for YouTube returns
Type for YouTube Stream
Attaches paused, playing, autoPaused Listeners to discordjs voice AudioPlayer.
Useful if you don't want extra data to be downloaded by play-dl.
discordjs voice AudioPlayer
Authorization interface for Spotify, SoundCloud and YouTube.
Either stores info in .data
folder or shows relevant data to be used in setToken
function.
const play = require('play-dl')
play.authorization()
Just run the above command and you will get a interface asking some questions.
Function uses data from video_basic_info and deciphers it if it contains signatures.
Data - InfoData
boolean
- To decipher only audio formats only.
Deciphered Video Info InfoData
Fetches the information for a track, playlist or album on Deezer
The track, playlist or album URL
A DeezerTrack, DeezerPlaylist or DeezerAlbum object depending on the provided URL.
Searches Deezer for tracks using the specified metadata.
The metadata and limit for the search
100
, defaults to 10
.An array of tracks matching the metadata
Validates a Deezer URL
The URL to validate
The type of the URL either 'track'
, 'playlist'
, 'album'
, 'search'
or false
.
false
means that the provided URL was a wrongly formatted or an unsupported Deezer URL.
Extract ID of YouTube url.
ID or url of YouTube
ID of video or playlist.
Gets Free SoundCloud Client ID.
Use this in beginning of your code to add SoundCloud support.
play.getFreeClientID().then((clientID) => play.setToken({
soundcloud : {
client_id : clientID
}
}))
client ID
Checks if spotify token is expired or not.
Update token if returned false.
if (play.is_expired()) {
await play.refreshToken()
}
boolean
Gets YouTube playlist info from a playlist url.
Example
const playlist = await play.playlist_info('youtube playlist url')
const playlist = await play.playlist_info('youtube playlist url', { incomplete : true })
Playlist URL
Playlist Info Options
boolean
incomplete : When this is set to false
(default) this function will throw an error
if the playlist contains hidden videos.
If it is set to true
, it parses the playlist skipping the hidden videos,
only visible videos are included in the resulting {@link YouTubePlaylist}.YouTube Playlist
Refreshes Token
if (play.is_expired()) {
await play.refreshToken()
}
boolean
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Searches through a particular source and gives respective info.
Example
const searched = await play.search('Rick Roll', { source : { youtube : "video" } }) // YouTube Video Search
const searched = await play.search('Rick Roll', { limit : 1 }) // YouTube Video Search but returns only 1 video.
const searched = await play.search('Rick Roll', { source : { spotify : "track" } }) // Spotify Track Search
const searched = await play.search('Rick Roll', { source : { soundcloud : "tracks" } }) // SoundCloud Track Search
const searched = await play.search('Rick Roll', { source : { deezer : "track" } }) // Deezer Track Search
string to search.
number
limit : No of searches you want to have.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"boolean
unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to false
[ YouTube search only. ]
!!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
Unblurred images will likely have different dimensions than specified in the YouTubeThumbnail objects.boolean
fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to true
. [ for Deezer
Only ]Object
source : Contains type of source and type of result you want to have
```tsArray of YouTube or Spotify or SoundCloud or Deezer type
Sets
i> YouTube :- cookies.
ii> SoundCloud :- client ID.
iii> Spotify :- client ID, client secret, refresh token, market.
iv> Useragents :- array of string.
locally in memory.
Example :
play.setToken({
youtube : {
cookie : "Your Cookies"
}
}) // YouTube Cookies
await play.setToken({
spotify : {
client_id: 'ID',
client_secret: 'secret',
refresh_token: 'token',
market: 'US'
}
}) // Await this only when setting data for spotify
play.setToken({
useragent: ['Your User-agent']
}) // Use this to avoid 429 errors.
Validates a soundcloud url
soundcloud url
false | 'track' | 'playlist'
Gets info from a soundcloud url.
let sound = await play.soundcloud('soundcloud url')
// sound.type === "track" | "playlist" | "user"
if (sound.type === "track") {
spot = spot as play.SoundCloudTrack
// Code with SoundCloud track class.
}
soundcloud url
Validate Spotify url
Spotify URL
'track' | 'playlist' | 'album' | 'search' | false
Gets Spotify url details.
let spot = await play.spotify('spotify url')
// spot.type === "track" | "playlist" | "album"
if (spot.type === "track") {
spot = spot as play.SpotifyTrack
// Code with spotify track class.
}
Spotify Url
A SpotifyTrack or SpotifyPlaylist or SpotifyAlbum
Creates a Stream [ YouTube or SoundCloud ] class from a url for playing.
Example
const source = await play.stream('youtube video URL') // YouTube Video Stream
const source = await play.stream('soundcloud track URL') // SoundCloud Track Stream
const source = await play.stream('youtube video URL', { seek : 45 }) // Seeks 45 seconds (approx.) in YouTube Video Stream
const resource = createAudioResource(source.stream, {
inputType : source.type
}) // Use discordjs voice createAudioResource function.
Video / Track URL
number
seek : No of seconds to seek in stream.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"number
quality : Quality number. [ 0 = Lowest, 1 = Medium, 2 = Highest ]boolean
htmldata : given data is html data or notnumber
precache : No of segments of data to store before looping [YouTube Live Stream only]. [ Defaults to 3 ]boolean
discordPlayerCompatibility : Conversion of Webm to Opus [ Defaults to false ]A YouTubeStream or SoundCloudStream Stream to play
Creates a Stream [ YouTube or SoundCloud ] class from a url for playing.
Example
const source = await play.stream('youtube video URL') // YouTube Video Stream
const source = await play.stream('soundcloud track URL') // SoundCloud Track Stream
const source = await play.stream('youtube video URL', { seek : 45 }) // Seeks 45 seconds (approx.) in YouTube Video Stream
const resource = createAudioResource(source.stream, {
inputType : source.type
}) // Use discordjs voice createAudioResource function.
Video / Track URL
number
seek : No of seconds to seek in stream.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"number
quality : Quality number. [ 0 = Lowest, 1 = Medium, 2 = Highest ]boolean
htmldata : given data is html data or notnumber
precache : No of segments of data to store before looping [YouTube Live Stream only]. [ Defaults to 3 ]boolean
discordPlayerCompatibility : Conversion of Webm to Opus [ Defaults to false ]A YouTubeStream or SoundCloudStream Stream to play
Creates a Stream [ YouTube or SoundCloud ] class from video or track info for playing.
Example
const info = await video_info('youtube URL')
const source = await play.stream_from_info(info) // YouTube Video Stream
const soundInfo = await play.soundcloud('SoundCloud URL')
const source = await play.stream_from_info(soundInfo) // SoundCloud Track Stream
const source = await play.stream_from_info(info, { seek : 45 }) // Seeks 45 seconds (approx.) in YouTube Video Stream
const resource = createAudioResource(source.stream, {
inputType : source.type
}) // Use discordjs voice createAudioResource function.
YouTube video info OR SoundCloud track Class
number
seek : No of seconds to seek in stream.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"number
quality : Quality number. [ 0 = Lowest, 1 = Medium, 2 = Highest ]boolean
htmldata : given data is html data or notnumber
precache : No of segments of data to store before looping [YouTube Live Stream only]. [ Defaults to 3 ]boolean
discordPlayerCompatibility : Conversion of Webm to Opus[ Defaults to false ]A YouTubeStream or SoundCloudStream Stream to play
Creates a Stream [ YouTube or SoundCloud ] class from video or track info for playing.
Example
const info = await video_info('youtube URL')
const source = await play.stream_from_info(info) // YouTube Video Stream
const soundInfo = await play.soundcloud('SoundCloud URL')
const source = await play.stream_from_info(soundInfo) // SoundCloud Track Stream
const source = await play.stream_from_info(info, { seek : 45 }) // Seeks 45 seconds (approx.) in YouTube Video Stream
const resource = createAudioResource(source.stream, {
inputType : source.type
}) // Use discordjs voice createAudioResource function.
YouTube video info OR SoundCloud track Class
number
seek : No of seconds to seek in stream.string
language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"number
quality : Quality number. [ 0 = Lowest, 1 = Medium, 2 = Highest ]boolean
htmldata : given data is html data or notnumber
precache : No of segments of data to store before looping [YouTube Live Stream only]. [ Defaults to 3 ]boolean
discordPlayerCompatibility : Conversion of Webm to Opus[ Defaults to false ]A YouTubeStream or SoundCloudStream Stream to play
Validates url that play-dl supports.
so
- SoundCloudsp
- Spotifydz
- Deezeryt
- YouTubeURL
'so_playlist' / 'so_track' | 'sp_track' | 'sp_album' | 'sp_playlist' | 'dz_track' | 'dz_playlist' | 'dz_album' | 'yt_video' | 'yt_playlist' | 'search' | false
Basic function to get data from a YouTube url or ID.
Example
const video = await play.video_basic_info('youtube video url')
const res = ... // Any https package get function.
const video = await play.video_basic_info(res.body, { htmldata : true })
YouTube url or ID or html body data
Video Info Options
boolean
htmldata : given data is html data or notVideo Basic Info InfoData.
Gets data from YouTube url or ID or html body data and deciphers it.
video_basic_info + decipher_info = video_info
Example
const video = await play.video_info('youtube video url')
const res = ... // Any https package get function.
const video = await play.video_info(res.body, { htmldata : true })
YouTube url or ID or html body data
Video Info Options
boolean
htmldata : given data is html data or notDeciphered Video Info InfoData.
Validate YouTube URL or ID.
CAUTION : If your search word is 11 or 12 characters long, you might get it validated as video ID.
To avoid above, add one more condition to yt_validate
if (url.startsWith('https') && yt_validate(url) === 'video') {
// YouTube Video Url.
}
YouTube URL OR ID
'playlist' | 'video' | 'search' | false
Generated using TypeDoc
Shared type for Deezer tracks, playlists and albums