From dd2d05fff5ae4b614643cd3ccc0cf795d4e22787 Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Thu, 9 Sep 2021 15:33:49 +0530 Subject: [PATCH] search small bug --- package-lock.json | 4 ++-- package.json | 2 +- play-dl/YouTube/search.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e50a65..df43a16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "play-dl", - "version": "0.8.7", + "version": "0.8.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "play-dl", - "version": "0.8.7", + "version": "0.8.9", "license": "MIT", "dependencies": { "got": "^11.8.2" diff --git a/package.json b/package.json index 68feef7..5ea0059 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "play-dl", - "version": "0.8.7", + "version": "0.8.9", "description": "YouTube, SoundCloud, Spotify streaming for discord.js bots", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/play-dl/YouTube/search.ts b/play-dl/YouTube/search.ts index 010788f..b20c696 100644 --- a/play-dl/YouTube/search.ts +++ b/play-dl/YouTube/search.ts @@ -13,7 +13,8 @@ enum SearchType { export async function search(search :string, options? : ParseSearchInterface): Promise<(Video | Channel | PlayList)[]> { let url = 'https://www.youtube.com/results?search_query=' + search.replaceAll(' ', '+') - if(!options || options.type) options = { type : "video" } + if(!options) options = { type : "video"} + if(!options.type) options.type = "video" if(!url.match('&sp=')){ url += '&sp=' switch(options?.type){