UNPKG

ytmusic_api_unofficial

Version:

A simple API to get music from YouTube Music

81 lines 3.14 kB
import { all_TYPES, AvailableCountries, AvailableCountriesCodes, AvailableFormat, AvailableQuality, AvailableTypes, countries, countriesCodes, optionsType } from "./utils/default"; import Music from "./classes/Music"; import Artist from "./classes/Artist"; import Playlist from "./classes/Playlist"; import Player from "./classes/Player"; import StreamPlayer from "./classes/StreamPlayer"; import Duration from "./classes/Duration"; import Album from "./classes/Album"; /** * Require for DOC API */ export { Thumbnail } from "./classes/Thumbnail"; export { Artist, Duration, Album, Music, Playlist, Player, StreamPlayer, AvailableTypes, optionsType, AvailableCountries, AvailableFormat, AvailableQuality, all_TYPES, countries, countriesCodes, AvailableCountriesCodes }; /** * Search for a query in YouTube Music * @param query - ex: "Hello Adele" * @param filter - ex: "SONG" (Check available types) * @param option - You can change country code. This parameter can be used to get a more precise result depending on location demand * @example * ```JS * const search = await client.search("Hello Adele", "SONG") * console.log(search) * ``` */ export declare function search(query: string, filter?: AvailableTypes, option?: optionsType): Promise<{ query: string; filter: AvailableTypes; content: Music[] | Artist[] | Playlist[]; }>; /** * Get music from YouTube Music by URL or ID or search query (Warning: search query length must be different from 11 characters) * @param query - ex: "Hello Adele" or https://music.youtube.com/watch?v=abc * @example * const get = await client.get("Hello Adele") * return: * ```json * { * "thumbnails": [ * { * "url": "https://lh3.googleusercontent.com/...", * "width": 60, * "height": 60 * } * ], * "id": "dQw4w9WgXcQ", * "title": "Never Gonna Give You Up", * "artists": [{ * "name": "Rick Astley", * "id": "MPREb_5eN7fQq3J9_" * }], * "resultType": "song", * "videoType": "MUSIC_VIDEO_TYPE_ATV" * // Other properties * } * ``` */ export declare function get(query: string): Promise<Music | Artist | Playlist | null>; /** * Get chart music from YouTube Music by country or global * @param country - The country code (Check available countries) */ export declare function charts(country?: AvailableCountries): Promise<Playlist>; /** * Get a Download link of a music * @param query - The music ID or URL * @param format - The format of the music (Check available formats) * @param quality - The quality of the music (Check available qualities) * @example */ export declare function download(query: string, format?: AvailableFormat, quality?: AvailableQuality): Promise<Player>; /** * getPlayers is a function that returns the available players (music, video) in all qualities * @param query - The music ID or URL */ export declare function getPlayers(query: string): Promise<StreamPlayer>; /** * @hideconstructor * @param format - The format of the music (Check available formats) */ export declare function getUrlDecodeT(format: any): Promise<string>; //# sourceMappingURL=index.d.ts.map