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",
|
"name": "play-dl",
|
||||||
"version": "0.8.7",
|
"version": "0.8.9",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "play-dl",
|
"name": "play-dl",
|
||||||
"version": "0.8.7",
|
"version": "0.8.9",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"got": "^11.8.2"
|
"got": "^11.8.2"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "play-dl",
|
"name": "play-dl",
|
||||||
"version": "0.8.7",
|
"version": "0.8.9",
|
||||||
"description": "YouTube, SoundCloud, Spotify streaming for discord.js bots",
|
"description": "YouTube, SoundCloud, Spotify streaming for discord.js bots",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
|||||||
@ -13,7 +13,8 @@ enum SearchType {
|
|||||||
|
|
||||||
export async function search(search :string, options? : ParseSearchInterface): Promise<(Video | Channel | PlayList)[]> {
|
export async function search(search :string, options? : ParseSearchInterface): Promise<(Video | Channel | PlayList)[]> {
|
||||||
let url = 'https://www.youtube.com/results?search_query=' + search.replaceAll(' ', '+')
|
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=')){
|
if(!url.match('&sp=')){
|
||||||
url += '&sp='
|
url += '&sp='
|
||||||
switch(options?.type){
|
switch(options?.type){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user