search small bug
This commit is contained in:
parent
41bd844a2d
commit
dd2d05fff5
4
package-lock.json
generated
4
package-lock.json
generated
@ -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"
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user