Search Function order is fixed.
This commit is contained in:
Killer069
2021-10-21 14:57:19 +05:30
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ export type YouTube = YouTubeVideo | YouTubeChannel | YouTubePlayList;
* @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(' ', '+');
let url = 'https://www.youtube.com/results?search_query=' + search;
options.type ??= 'video';
if (!url.match('&sp=')) {
url += '&sp=';