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){