Module "lib/endpoints/Search"
Functions
Const search
- search(cookie: string, args: any, query: string, options?: undefined | { filter?: undefined | string; max?: undefined | number }): Promise<Array<{ album?: Text; author?: Text; id?: undefined | string; thumbnails: Thumbnail[]; title: Text; tracksCount?: undefined | number; type: "song" | "album" | "playlist" | "video" | "artist"; url: string }> | Error>
-
Parameters
-
cookie: string
-
args: any
-
query: string
-
Optional options: undefined | { filter?: undefined | string; max?: undefined | number }
Returns Promise<Array<{ album?: Text; author?: Text; id?: undefined | string; thumbnails: Thumbnail[]; title: Text; tracksCount?: undefined | number; type: "song" | "album" | "playlist" | "video" | "artist"; url: string }> | Error>
Search
const api = new YTMUSIC(cookie) const data = await api.createPlaylist('Summer Songs', 'PUBLIC', 'Some songs for summer') const songs = await api.search('Hot stuff') await api.addToPlaylist([songs[0].id], playlist.id)