Search function fixed

This commit is contained in:
killer069
2021-10-21 14:54:53 +05:30
parent e69f466f53
commit f410483980
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=';