ytmusic_api_unofficial
Advanced tools
Comparing version 1.3.0 to 1.3.2
@@ -9,4 +9,5 @@ import { Album, Home, Music, Playlist } from "../models/"; | ||
* @param type - Type of search | ||
* @param onlyBest - Is a boolean parameter that could be used to limit the search results to only the best matches | ||
*/ | ||
export declare function search(query: string, type?: string | TypeSearch_param): Promise<(Search | Array<Music | Album>)>; | ||
export declare function search(query: string, type?: string | TypeSearch_param, onlyBest?: boolean): Promise<(Search | Array<Music | Album>)>; | ||
/** | ||
@@ -35,2 +36,8 @@ * Get the home page (NOT WORKING) | ||
export declare function GetDataPl(id: string): Promise<any>; | ||
/** | ||
* @beta | ||
* @param query | ||
*/ | ||
export declare function getSuggestSearch(query: string): Promise<any>; | ||
export declare function getTrending(country?: string): Promise<any>; | ||
//# sourceMappingURL=searchManager.d.ts.map |
@@ -15,3 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GetDataPl = exports.GetDataVid = exports.getPlaylist = exports.get = exports.relative = exports.getPage = exports.search = void 0; | ||
exports.getTrending = exports.getSuggestSearch = exports.GetDataPl = exports.GetDataVid = exports.getPlaylist = exports.get = exports.relative = exports.getPage = exports.search = void 0; | ||
const requestManager_1 = require("../utils/requestManager"); | ||
@@ -26,2 +26,3 @@ const models_1 = require("../models/"); | ||
const Search_1 = __importDefault(require("../models/Search")); | ||
const Trending_1 = __importDefault(require("../models/Trending")); | ||
/** | ||
@@ -31,4 +32,5 @@ * Search music, video or other with query | ||
* @param type - Type of search | ||
* @param onlyBest - Is a boolean parameter that could be used to limit the search results to only the best matches | ||
*/ | ||
function search(query, type = TypeSearch_1.TypeSearch[0]) { | ||
function search(query, type = TypeSearch_1.TypeSearch[0], onlyBest = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -59,3 +61,6 @@ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
return resolve([new models_1.Music((0, extract_1.extract_dataFromGetData)(yield GetDataVid(url.searchParams.get('v') || '')))]); | ||
const datavid = yield GetDataVid(url.searchParams.get('v') || '').catch((e) => { | ||
reject(new errors_1.YTjsErrorError(errorCodes_1.default.VIDEO_NOT_FOUND, { id: url.searchParams.get('v') })); | ||
}); | ||
return resolve([new models_1.Music((0, extract_1.extract_dataFromGetData)(datavid))]); | ||
} | ||
@@ -73,3 +78,6 @@ catch (e) { | ||
let id = query.match(/^(?:https?:\/\/)?(?:www\.)?.*(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/watch\?.+&v=))([\w-]{11})(?:.+)?$|(^.{11}$)/); | ||
return resolve([new models_1.Music((0, extract_1.extract_dataFromGetData)(yield GetDataVid((id === null || id === void 0 ? void 0 : id[1]) || (id === null || id === void 0 ? void 0 : id[0]) || '')))]); | ||
const datavid = yield GetDataVid((id === null || id === void 0 ? void 0 : id[1]) || (id === null || id === void 0 ? void 0 : id[0]) || '').catch((e) => { | ||
reject(new errors_1.YTjsErrorError(errorCodes_1.default.VIDEO_NOT_FOUND, { id: (id === null || id === void 0 ? void 0 : id[1]) || (id === null || id === void 0 ? void 0 : id[0]) || '' })); | ||
}); | ||
return resolve([new models_1.Music((0, extract_1.extract_dataFromGetData)(datavid))]); | ||
} | ||
@@ -88,3 +96,9 @@ const music_data = yield (0, requestManager_1.requestToYtApi)('search', { | ||
for (item of data) { | ||
searchs.push(new models_1.Music((0, extract_1.extract_dataFromGetData)(yield GetDataVid(((_b = (_a = item.musicResponsiveListItemRenderer) === null || _a === void 0 ? void 0 : _a.playlistItemData) === null || _b === void 0 ? void 0 : _b.videoId) || ((_c = item.musicResponsiveListItemRenderer) === null || _c === void 0 ? void 0 : _c.onTap.watchEndpoint.videoId))))); | ||
let id = ((_b = (_a = item.musicResponsiveListItemRenderer) === null || _a === void 0 ? void 0 : _a.playlistItemData) === null || _b === void 0 ? void 0 : _b.videoId) || ((_c = item.musicResponsiveListItemRenderer) === null || _c === void 0 ? void 0 : _c.onTap.watchEndpoint.videoId); | ||
if (!id) | ||
continue; | ||
const datavid = yield GetDataVid(id).catch((e) => { | ||
reject(new errors_1.YTjsErrorError(errorCodes_1.default.VIDEO_NOT_FOUND, { id })); | ||
}); | ||
searchs.push(new models_1.Music((0, extract_1.extract_dataFromGetData)(datavid))); | ||
} | ||
@@ -94,20 +108,18 @@ } | ||
let i = 0; | ||
for (const bestItems of ((_f = (_e = (_d = music_data.data.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.filter((item) => { var _a, _b, _c; return ((_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.musicCardShelfRenderer) === null || _a === void 0 ? void 0 : _a.header.musicCardShelfHeaderBasicRenderer) === null || _b === void 0 ? void 0 : _b.title.runs[0]) === null || _c === void 0 ? void 0 : _c.text) === 'Top result'; })) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.musicCardShelfRenderer) === null || _f === void 0 ? void 0 : _f.contents) || []) { | ||
if ((_h = (_g = bestItems === null || bestItems === void 0 ? void 0 : bestItems.musicResponsiveListItemRenderer) === null || _g === void 0 ? void 0 : _g.playlistItemData) === null || _h === void 0 ? void 0 : _h.videoId) | ||
searchs.push(new models_1.Music((0, extract_1.extract_dataFromGetData)(yield GetDataVid((_j = bestItems.musicResponsiveListItemRenderer.playlistItemData) === null || _j === void 0 ? void 0 : _j.videoId), i === 0))); | ||
else if ((_m = (_l = (_k = bestItems === null || bestItems === void 0 ? void 0 : bestItems.musicTwoRowItemRenderer) === null || _k === void 0 ? void 0 : _k.navigationEndpoint) === null || _l === void 0 ? void 0 : _l.browseEndpoint) === null || _m === void 0 ? void 0 : _m.browseId) | ||
searchs.push(new models_1.Album((0, extract_1.extract_dataFromPlaylist)(yield GetDataPl((_q = (_p = (_o = bestItems.musicTwoRowItemRenderer) === null || _o === void 0 ? void 0 : _o.navigationEndpoint) === null || _p === void 0 ? void 0 : _p.browseEndpoint) === null || _q === void 0 ? void 0 : _q.browseId)))); | ||
i++; | ||
if ((_h = (_g = (_f = (_e = (_d = music_data.data.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.filter((item) => { var _a, _b, _c; return ((_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.musicCardShelfRenderer) === null || _a === void 0 ? void 0 : _a.header.musicCardShelfHeaderBasicRenderer) === null || _b === void 0 ? void 0 : _b.title.runs[0]) === null || _c === void 0 ? void 0 : _c.text) === 'Top result'; })) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.musicCardShelfRenderer.title.runs[0]) === null || _f === void 0 ? void 0 : _f.navigationEndpoint) === null || _g === void 0 ? void 0 : _g.watchEndpoint) === null || _h === void 0 ? void 0 : _h.videoId) { | ||
let id = (_m = (_l = (_k = (_j = music_data.data.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.filter((item) => { var _a, _b, _c; return ((_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.musicCardShelfRenderer) === null || _a === void 0 ? void 0 : _a.header.musicCardShelfHeaderBasicRenderer) === null || _b === void 0 ? void 0 : _b.title.runs[0]) === null || _c === void 0 ? void 0 : _c.text) === 'Top result'; })) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.musicCardShelfRenderer.title.runs[0]) === null || _l === void 0 ? void 0 : _l.navigationEndpoint) === null || _m === void 0 ? void 0 : _m.watchEndpoint.videoId; | ||
const datavid = yield GetDataVid(id).catch((e) => { | ||
reject(new errors_1.YTjsErrorError(errorCodes_1.default.VIDEO_NOT_FOUND, { id })); | ||
}); | ||
searchs.push(new models_1.Music((0, extract_1.extract_dataFromGetData)(datavid, true))); | ||
if (onlyBest) | ||
return resolve(new Search_1.default(query, searchs)); | ||
} | ||
if ((_v = (_u = (_t = (_s = (_r = music_data.data.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.filter((item) => { var _a, _b, _c; return ((_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.musicCardShelfRenderer) === null || _a === void 0 ? void 0 : _a.header.musicCardShelfHeaderBasicRenderer) === null || _b === void 0 ? void 0 : _b.title.runs[0]) === null || _c === void 0 ? void 0 : _c.text) === 'Top result'; })) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.musicCardShelfRenderer.title.runs[0]) === null || _t === void 0 ? void 0 : _t.navigationEndpoint) === null || _u === void 0 ? void 0 : _u.watchEndpoint) === null || _v === void 0 ? void 0 : _v.videoId) { | ||
searchs.push(new models_1.Music((0, extract_1.extract_dataFromGetData)(yield GetDataVid((_z = (_y = (_x = (_w = music_data.data.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.filter((item) => { var _a, _b, _c; return ((_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.musicCardShelfRenderer) === null || _a === void 0 ? void 0 : _a.header.musicCardShelfHeaderBasicRenderer) === null || _b === void 0 ? void 0 : _b.title.runs[0]) === null || _c === void 0 ? void 0 : _c.text) === 'Top result'; })) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.musicCardShelfRenderer.title.runs[0]) === null || _y === void 0 ? void 0 : _y.navigationEndpoint) === null || _z === void 0 ? void 0 : _z.watchEndpoint.videoId), true))); | ||
} | ||
//for (const item of music_data.data) | ||
for (const item of music_data.data.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.filter((item) => { var _a, _b, _c; return (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.musicShelfRenderer) === null || _a === void 0 ? void 0 : _a.title) === null || _b === void 0 ? void 0 : _b.runs[0]) === null || _c === void 0 ? void 0 : _c.text.includes(typeSearch.ytID); })) { | ||
if ((_1 = (_0 = item.musicShelfRenderer) === null || _0 === void 0 ? void 0 : _0.contents) === null || _1 === void 0 ? void 0 : _1.length) { | ||
if ((_p = (_o = item.musicShelfRenderer) === null || _o === void 0 ? void 0 : _o.contents) === null || _p === void 0 ? void 0 : _p.length) { | ||
for (const music of item.musicShelfRenderer.contents) { | ||
// Get type of music | ||
if ((item.musicShelfRenderer.title.runs[0].text === 'Songs' || item.musicShelfRenderer.title.runs[0].text === 'Videos') && ((_3 = (_2 = music.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint) === null || _2 === void 0 ? void 0 : _2.watchEndpoint) === null || _3 === void 0 ? void 0 : _3.videoId)) { | ||
if ((item.musicShelfRenderer.title.runs[0].text === 'Songs' || item.musicShelfRenderer.title.runs[0].text === 'Videos') && ((_r = (_q = music.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint) === null || _q === void 0 ? void 0 : _q.watchEndpoint) === null || _r === void 0 ? void 0 : _r.videoId)) { | ||
try { | ||
searchs.push((yield this.search(`https://music.youtube.com/watch?v=${(_5 = (_4 = music.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint) === null || _4 === void 0 ? void 0 : _4.watchEndpoint) === null || _5 === void 0 ? void 0 : _5.videoId}`, 'MUSIC'))[0]); | ||
searchs.push((yield this.search(`https://music.youtube.com/watch?v=${(_t = (_s = music.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint) === null || _s === void 0 ? void 0 : _s.watchEndpoint) === null || _t === void 0 ? void 0 : _t.videoId}`, 'MUSIC'))[0]); | ||
} | ||
@@ -124,2 +136,14 @@ catch (e) { | ||
} | ||
for (const bestItems of ((_w = (_v = (_u = music_data.data.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.filter((item) => { var _a, _b, _c; return ((_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.musicCardShelfRenderer) === null || _a === void 0 ? void 0 : _a.header.musicCardShelfHeaderBasicRenderer) === null || _b === void 0 ? void 0 : _b.title.runs[0]) === null || _c === void 0 ? void 0 : _c.text) === 'Top result'; })) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.musicCardShelfRenderer) === null || _w === void 0 ? void 0 : _w.contents) || []) { | ||
if ((_y = (_x = bestItems === null || bestItems === void 0 ? void 0 : bestItems.musicResponsiveListItemRenderer) === null || _x === void 0 ? void 0 : _x.playlistItemData) === null || _y === void 0 ? void 0 : _y.videoId) { | ||
const id = (_z = bestItems.musicResponsiveListItemRenderer.playlistItemData) === null || _z === void 0 ? void 0 : _z.videoId; | ||
const datavid = yield GetDataVid(id).catch((e) => { | ||
reject(new errors_1.YTjsErrorError(errorCodes_1.default.VIDEO_NOT_FOUND, { id })); | ||
}); | ||
searchs.push(new models_1.Music((0, extract_1.extract_dataFromGetData)(datavid, i === 0))); | ||
} | ||
else if ((_2 = (_1 = (_0 = bestItems === null || bestItems === void 0 ? void 0 : bestItems.musicTwoRowItemRenderer) === null || _0 === void 0 ? void 0 : _0.navigationEndpoint) === null || _1 === void 0 ? void 0 : _1.browseEndpoint) === null || _2 === void 0 ? void 0 : _2.browseId) | ||
searchs.push(new models_1.Album((0, extract_1.extract_dataFromPlaylist)(yield GetDataPl((_5 = (_4 = (_3 = bestItems.musicTwoRowItemRenderer) === null || _3 === void 0 ? void 0 : _3.navigationEndpoint) === null || _4 === void 0 ? void 0 : _4.browseEndpoint) === null || _5 === void 0 ? void 0 : _5.browseId)))); | ||
i++; | ||
} | ||
} | ||
@@ -323,3 +347,3 @@ if (!searchs.length) | ||
else | ||
reject(new errors_1.YTjsErrorError(errorCodes_1.default.VIDEO_NOT_FOUND, id)); | ||
reject(new errors_1.YTjsErrorError(errorCodes_1.default.VIDEO_NOT_FOUND, { id })); | ||
}).catch(reject); | ||
@@ -339,2 +363,37 @@ }); | ||
exports.GetDataPl = GetDataPl; | ||
/** | ||
* @beta | ||
* @param query | ||
*/ | ||
function getSuggestSearch(query) { | ||
return new Promise((resolve, reject) => { | ||
return reject(new errors_1.YTjsErrorError(errorCodes_1.default.CURRENTLY_NOT_SUPPORTED)); | ||
(0, requestManager_1.requestToYtApi)('music/get_search_suggestions', { | ||
"input": query | ||
}).then((res) => { | ||
console.log(res.data.contents[0].searchSuggestionsSectionRenderer.contents); | ||
}).catch(reject); | ||
}); | ||
} | ||
exports.getSuggestSearch = getSuggestSearch; | ||
function getTrending(country = "ZZ") { | ||
return new Promise((resolve, reject) => { | ||
return reject(new errors_1.YTjsErrorError(errorCodes_1.default.CURRENTLY_NOT_SUPPORTED)); | ||
country = country.toUpperCase(); | ||
(0, requestManager_1.requestToYtApi)('browse', { | ||
browseId: "FEmusic_charts", | ||
formData: { | ||
selectedValues: [country] | ||
} | ||
}).then((res) => __awaiter(this, void 0, void 0, function* () { | ||
var _a; | ||
res.data.songs = []; | ||
for (let song of (_a = res.data.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents) === null || _a === void 0 ? void 0 : _a[1].musicCarouselShelfRenderer.contents) { | ||
res.data.songs.push((yield index_1.searchManager.get(song.musicTwoRowItemRenderer.navigationEndpoint.watchEndpoint.videoId))); | ||
} | ||
resolve(new Trending_1.default(res.data)); | ||
})).catch(reject); | ||
}); | ||
} | ||
exports.getTrending = getTrending; | ||
//# sourceMappingURL=searchManager.js.map |
@@ -16,3 +16,4 @@ import Album from './Album'; | ||
import StreamPlayers from "./StreamPlayers"; | ||
export { Album, Artist, Artwork, Download, DownloadFile, Duration, Home, Lyrics, Music, Music_list, Playlist, NoLyrics, Search, Music_model, StreamPlayers }; | ||
import Trending from "./Trending"; | ||
export { Album, Artist, Artwork, Download, DownloadFile, Duration, Home, Lyrics, Music, Music_list, Playlist, NoLyrics, Search, Music_model, Trending, StreamPlayers }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StreamPlayers = exports.Music_model = exports.Search = exports.NoLyrics = exports.Playlist = exports.Music_list = exports.Music = exports.Lyrics = exports.Home = exports.Duration = exports.DownloadFile = exports.Download = exports.Artwork = exports.Artist = exports.Album = void 0; | ||
exports.StreamPlayers = exports.Trending = exports.Music_model = exports.Search = exports.NoLyrics = exports.Playlist = exports.Music_list = exports.Music = exports.Lyrics = exports.Home = exports.Duration = exports.DownloadFile = exports.Download = exports.Artwork = exports.Artist = exports.Album = void 0; | ||
const Album_1 = __importDefault(require("./Album")); | ||
@@ -38,2 +38,4 @@ exports.Album = Album_1.default; | ||
exports.StreamPlayers = StreamPlayers_1.default; | ||
const Trending_1 = __importDefault(require("./Trending")); | ||
exports.Trending = Trending_1.default; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,4 @@ import * as DownloadType from './DownloadType'; | ||
import * as TypePage from './TypePage'; | ||
export { DownloadType, DownloadQuality, TypeSearch, TypePage }; | ||
import * as AvailableCountry from "./AvailableCountry"; | ||
export { DownloadType, DownloadQuality, TypeSearch, TypePage, AvailableCountry }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TypePage = exports.TypeSearch = exports.DownloadQuality = exports.DownloadType = void 0; | ||
exports.AvailableCountry = exports.TypePage = exports.TypeSearch = exports.DownloadQuality = exports.DownloadType = void 0; | ||
const DownloadType = __importStar(require("./DownloadType")); | ||
@@ -36,2 +36,4 @@ exports.DownloadType = DownloadType; | ||
exports.TypePage = TypePage; | ||
const AvailableCountry = __importStar(require("./AvailableCountry")); | ||
exports.AvailableCountry = AvailableCountry; | ||
//# sourceMappingURL=index.js.map |
@@ -85,10 +85,17 @@ "use strict"; | ||
function extract_dataFromPlaylist(data) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w; | ||
let artists = [], date = 0, name = '', id; | ||
for (let item of ((_b = (_a = data.header.musicDetailHeaderRenderer) === null || _a === void 0 ? void 0 : _a.subtitle) === null || _b === void 0 ? void 0 : _b.runs) || []) { | ||
if (!(data === null || data === void 0 ? void 0 : data.header)) | ||
return { | ||
name: null, | ||
id: null, | ||
artists: [], | ||
date: null | ||
}; | ||
for (let item of ((_c = (_b = (_a = data.header) === null || _a === void 0 ? void 0 : _a.musicDetailHeaderRenderer) === null || _b === void 0 ? void 0 : _b.subtitle) === null || _c === void 0 ? void 0 : _c.runs) || []) { | ||
// Check if the item is an artist | ||
if (((_g = (_f = (_e = (_d = (_c = item.navigationEndpoint) === null || _c === void 0 ? void 0 : _c.browseEndpoint) === null || _d === void 0 ? void 0 : _d.browseEndpointContextSupportedConfigs) === null || _e === void 0 ? void 0 : _e.browseEndpointContextMusicConfig) === null || _f === void 0 ? void 0 : _f.pageType) === null || _g === void 0 ? void 0 : _g.includes('ARTIST')) || ((_m = (_l = (_k = (_j = (_h = item.navigationEndpoint) === null || _h === void 0 ? void 0 : _h.browseEndpoint) === null || _j === void 0 ? void 0 : _j.browseEndpointContextSupportedConfigs) === null || _k === void 0 ? void 0 : _k.browseEndpointContextMusicConfig) === null || _l === void 0 ? void 0 : _l.pageType) === null || _m === void 0 ? void 0 : _m.includes('USER'))) { | ||
if (((_h = (_g = (_f = (_e = (_d = item.navigationEndpoint) === null || _d === void 0 ? void 0 : _d.browseEndpoint) === null || _e === void 0 ? void 0 : _e.browseEndpointContextSupportedConfigs) === null || _f === void 0 ? void 0 : _f.browseEndpointContextMusicConfig) === null || _g === void 0 ? void 0 : _g.pageType) === null || _h === void 0 ? void 0 : _h.includes('ARTIST')) || ((_o = (_m = (_l = (_k = (_j = item.navigationEndpoint) === null || _j === void 0 ? void 0 : _j.browseEndpoint) === null || _k === void 0 ? void 0 : _k.browseEndpointContextSupportedConfigs) === null || _l === void 0 ? void 0 : _l.browseEndpointContextMusicConfig) === null || _m === void 0 ? void 0 : _m.pageType) === null || _o === void 0 ? void 0 : _o.includes('USER'))) { | ||
artists.push(new models_1.Artist({ | ||
name: item.text, | ||
id: (_p = (_o = item.navigationEndpoint) === null || _o === void 0 ? void 0 : _o.browseEndpoint) === null || _p === void 0 ? void 0 : _p.browseId | ||
id: (_q = (_p = item.navigationEndpoint) === null || _p === void 0 ? void 0 : _p.browseEndpoint) === null || _q === void 0 ? void 0 : _q.browseId | ||
})); | ||
@@ -105,4 +112,4 @@ // Check if the item is a date | ||
name: data.header.musicDetailHeaderRenderer.title.runs[0].text, | ||
description: (_t = (_s = (_r = (_q = data.header.musicDetailHeaderRenderer) === null || _q === void 0 ? void 0 : _q.description) === null || _r === void 0 ? void 0 : _r.runs) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.text, | ||
id: (_v = (_u = data.responseContext) === null || _u === void 0 ? void 0 : _u.serviceTrackingParams) === null || _v === void 0 ? void 0 : _v.find((e) => e.service === 'GFEEDBACK').params.find((e) => e.key === 'browse_id').value.split('/').pop(), | ||
description: (_u = (_t = (_s = (_r = data.header.musicDetailHeaderRenderer) === null || _r === void 0 ? void 0 : _r.description) === null || _s === void 0 ? void 0 : _s.runs) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.text, | ||
id: (_w = (_v = data.responseContext) === null || _v === void 0 ? void 0 : _v.serviceTrackingParams) === null || _w === void 0 ? void 0 : _w.find((e) => e.service === 'GFEEDBACK').params.find((e) => e.key === 'browse_id').value.split('/').pop(), | ||
artists: artists, | ||
@@ -109,0 +116,0 @@ date: date |
@@ -59,3 +59,3 @@ "use strict"; | ||
else | ||
return encodeURI(YTmusic_API_URL + url); | ||
return encodeURI(YTmusic_API_URL + url + '?prettyPrint=false'); | ||
} | ||
@@ -62,0 +62,0 @@ function makeHeaders(headers) { |
{ | ||
"name": "ytmusic_api_unofficial", | ||
"version": "1.3.0", | ||
"version": "1.3.2", | ||
"description": "A simple API to get music from YouTube Music", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
205454
144
2422
3
4