mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Comments are now added in functions
This commit is contained in:
@@ -10,8 +10,16 @@ enum SearchType {
|
||||
Channel = 'EgIQAg%253D%253D'
|
||||
}
|
||||
|
||||
/**
|
||||
* Type for YouTube returns
|
||||
*/
|
||||
export type YouTube = YouTubeVideo | YouTubeChannel | YouTubePlayList;
|
||||
|
||||
/**
|
||||
* Command to search from YouTube
|
||||
* @param search The query to search
|
||||
* @param options limit & type of YouTube search you want.
|
||||
* @returns YouTube type.
|
||||
*/
|
||||
export async function yt_search(search: string, options: ParseSearchInterface = {}): Promise<YouTube[]> {
|
||||
let url = 'https://www.youtube.com/results?search_query=' + search.replaceAll(' ', '+');
|
||||
options.type ??= 'video';
|
||||
|
||||
Reference in New Issue
Block a user