New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-youtube-music

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-youtube-music - npm Package Compare versions

Comparing version 0.10.2 to 0.10.3

2

dist/index.js

@@ -1,1 +0,1 @@

var D=Object.defineProperty,W=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var v=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))j.call(t,r)&&v(e,r,t[r]);if(w)for(var r of w(t))_.call(t,r)&&v(e,r,t[r]);return e},d=(e,t)=>W(e,N(t));var p=(e,t,r)=>new Promise((s,n)=>{var i=l=>{try{m(r.next(l))}catch(u){n(u)}},o=l=>{try{m(r.throw(l))}catch(u){n(u)}},m=l=>l.done?s(l.value):Promise.resolve(l.value).then(i,o);m((r=r.apply(e,t)).next())});var Q=(r=>(r.REGULAR="regular",r.VERIFIED_ARTIST="BADGE_STYLE_TYPE_VERIFIED_ARTIST",r))(Q||{}),E=(s=>(s.ep="EP",s.album="Album",s.single="Single",s))(E||{}),L=(s=>(s.artist="MUSIC_PAGE_TYPE_ARTIST",s.album="MUSIC_PAGE_TYPE_ALBUM",s.playlist="MUSIC_PAGE_TYPE_PLAYLIST",s))(L||{});import z from"got";var x="MUSIC_EXPLICIT_BADGE",y=e=>{let t=e.split(":");return t.length===3?parseInt(t[0],10)*3600+parseInt(t[1],10)*60+parseInt(t[2],10):parseInt(t[0],10)*60+parseInt(t[1],10)},A=e=>{switch(e){case"Album":return"Album";case"EP":return"EP";default:return"Single"}},f=e=>{let t=[];if(e.forEach(r=>{r.navigationEndpoint&&r.navigationEndpoint.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType==="MUSIC_PAGE_TYPE_ARTIST"&&t.push({name:r.text,id:r.navigationEndpoint.browseEndpoint.browseId})}),t.length===0){let r=e.findIndex(s=>s.text===" \u2022 ");r!==-1&&e.filter((s,n)=>n<r&&s.name!==" & ").forEach(s=>t.push({name:s.text}))}return t},T=e=>{var l;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint.watchEndpoint.videoId}catch(u){}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(u){}let s;try{s=f(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs)}catch(u){}let n;try{let{length:u}=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs;n=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[u-3].text}catch(u){}let i;try{i=(l=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:l.url}catch(u){}let o;try{let u=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs.length-1].text;o={label:u,totalSeconds:y(u)}}catch(u){}let m;try{m=e.musicResponsiveListItemRenderer.badges[0].musicInlineBadgeRenderer.icon.iconType===x}catch(u){m=!1}return{youtubeId:t,title:r,artists:s,album:n,thumbnailUrl:i,duration:o,isExplicit:m}},P=e=>{var l;let t;try{t=e.playlistPanelVideoRenderer.navigationEndpoint.watchEndpoint.videoId}catch(u){}let r;try{r=e.playlistPanelVideoRenderer.title.runs[0].text}catch(u){}let s;try{s=f(e.playlistPanelVideoRenderer.longBylineText.runs)}catch(u){}let n;try{n=e.playlistPanelVideoRenderer.longBylineText.runs[2].text}catch(u){}let i;try{i=e.playlistPanelVideoRenderer.badges[0].musicInlineBadgeRenderer.icon.iconType==="MUSIC_EXPLICIT_BADGE"}catch(u){i=!1}let o;try{o=(l=e.playlistPanelVideoRenderer.thumbnail.thumbnails.pop())==null?void 0:l.url}catch(u){}let m;try{m={label:e.playlistPanelVideoRenderer.lengthText.runs[0].text,totalSeconds:y(e.playlistPanelVideoRenderer.lengthText.runs[0].text)}}catch(u){}return{youtubeId:t,title:r,artists:s,isExplicit:i,album:n,thumbnailUrl:o,duration:m}},S=(e,t)=>{var o;let r;try{r=e.musicResponsiveListItemRenderer.navigationEndpoint.browseEndpoint.browseId}catch(m){}if(t&&e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text!=="YouTube Music")return null;let s;try{s=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(m){}let n;try{n=parseInt(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].text.split(" ")[0],10)}catch(m){}let i;try{i=(o=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:o.url}catch(m){}return{playlistId:r,title:s,totalSongs:n,thumbnailUrl:i}},M=e=>{var l,u;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint.watchEndpoint.videoId}catch(R){}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(R){}let s;try{s=f(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs)}catch(R){}let n;try{n=e.musicResponsiveListItemRenderer.flexColumns[2].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(R){}let i;try{i=(l=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:l.url}catch(R){}let o;try{o={label:e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text,totalSeconds:y(e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text)}}catch(R){}let m;try{m=((u=e.musicResponsiveListItemRenderer)==null?void 0:u.badges[0].musicInlineBadgeRenderer.icon.iconType)===x}catch(R){m=!1}return{youtubeId:t,title:r,artists:s,album:n,thumbnailUrl:i,duration:o,isExplicit:m}},F=e=>{var u,R,h;let t;try{t=e.musicResponsiveListItemRenderer.navigationEndpoint.browseEndpoint.browseId}catch(a){console.error("Couldn't parse albumId",a)}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(a){console.error("Couldn't parse title",a)}let s;try{s=A(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text)}catch(a){console.error("Couldn't parse album type",a)}let n;try{n=(u=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:u.url}catch(a){console.error("Couldn't parse thumbnailUrl",a)}let i;try{i=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].text}catch(a){console.error("Couldn't parse artist",a)}let o;try{o=(R=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].navigationEndpoint)==null?void 0:R.browseEndpoint.browseId}catch(a){console.error("Couldn't parse artistId",a)}let m;try{m=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[4].text}catch(a){console.error("Couldn't parse year",a)}let l;try{l=((h=e.musicResponsiveListItemRenderer)==null?void 0:h.badges[0].musicInlineBadgeRenderer.icon.iconType)===x}catch(a){l=!1}return{albumId:t,title:r,type:s,thumbnailUrl:n,artist:i,artistId:o,year:m,isExplicit:l}},B=e=>{var n;let t;try{t=e.musicDetailHeaderRenderer.subtitle.runs[2].text}catch(i){console.error("Couldn't parse artist from album header",i)}let r;try{r=e.musicDetailHeaderRenderer.title.runs[0].text}catch(i){console.error("Couldn't parse title from album header",i)}let s;try{s=(n=e.musicDetailHeaderRenderer.thumbnail.croppedSquareThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:n.url}catch(i){console.error("Couldn't parse thumbnailUrl from album header",i)}return{artist:t,album:r,thumbnailUrl:s}},U=e=>{var o,m;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint.watchEndpoint.videoId}catch(l){}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(l){}let s=[];try{if((o=e.musicResponsiveListItemRenderer.flexColumns[1])!=null&&o.musicResponsiveListItemFlexColumnRenderer.text.runs)for(let l=0;l<e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs.length;l+=2)s.push({name:e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[l].text})}catch(l){}let n;try{n={label:e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text,totalSeconds:y(e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text)}}catch(l){}let i;try{i=((m=e.musicResponsiveListItemRenderer)==null?void 0:m.badges[0].musicInlineBadgeRenderer.icon.iconType)===x}catch(l){i=!1}return{youtubeId:t,artists:s,title:r,duration:n,isExplicit:i}},G=e=>{var m,l;let t;try{t=e.musicTwoRowItemRenderer.title.runs[0].text}catch(u){console.error("Couldn't get title",u)}let r;try{r=A(e.musicTwoRowItemRenderer.subtitle.runs[0].text)}catch(u){console.error("Couldn't get album type",u)}let s;try{s=e.musicTwoRowItemRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseId}catch(u){console.error("Couldn't get albumId",u)}let n;try{n=(m=e.musicTwoRowItemRenderer.subtitle.runs.pop())==null?void 0:m.text}catch(u){console.error("Couldn't get year",u)}let i;try{i=e.musicTwoRowItemRenderer.subtitleBadges[0].musicInlineBadgeRenderer.icon.iconType===x}catch(u){i=!1}let o;try{o=(l=e.musicTwoRowItemRenderer.thumbnailRenderer.musicThumbnailRenderer.thumbnail.thumbnails.shift())==null?void 0:l.url}catch(u){console.error("Couldn't get thumbnailUrl",u)}return{title:t,type:r,albumId:s,year:n,thumbnailUrl:o,isExplicit:i}},J=e=>{var i;let t;try{t=e.musicTwoRowItemRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseId}catch(o){console.error("Couldn't get artistId",o)}let r;try{r=e.musicTwoRowItemRenderer.title.runs[0].text}catch(o){console.error("Couldn't get name",o)}let s;try{s=e.musicTwoRowItemRenderer.subtitle.runs[0].text;let o=s.split(" ");o.pop(),s=o.join(" ")}catch(o){console.error("Couldn't get subscribers",o)}let n;try{n=(i=e.musicTwoRowItemRenderer.thumbnailRenderer.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:i.url}catch(o){console.error("Couldn't get thumbnailUrl",o)}return{artistId:t,name:r,subscribers:s,thumbnailUrl:n}},V=(e,t)=>{var R,h;let r;try{r=e.header.musicImmersiveHeaderRenderer.title.runs[0].text}catch(a){console.error("Couldn't get artist name",a)}let s;try{s=e.header.musicImmersiveHeaderRenderer.description.runs[0].text}catch(a){console.error("Couldn't get artist description",a)}let n=[];try{e.header.musicImmersiveHeaderRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.forEach(g=>{n.push(g)})}catch(a){console.error("Couldn't get artist thumbnails",a)}let i;try{i=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].musicShelfRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseId}catch(a){console.error("Couldn't get artist songPlaylistId",a)}let o=[],m=[];try{let{contents:a}=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer;for(let g of a)(R=g.musicCarouselShelfRenderer)!=null&&R.contents&&((h=g.musicCarouselShelfRenderer.contents[0].musicTwoRowItemRenderer.title.runs[0].navigationEndpoint)==null?void 0:h.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType)==="MUSIC_PAGE_TYPE_ALBUM"&&g.musicCarouselShelfRenderer.contents.forEach(I=>{let C=G(I);C.type==="Single"?m.push(C):o.push(C)})}catch(a){console.error("Couldn't get albums",a)}let l=[];try{let{contents:a}=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer;for(let g=a.length-1;g>=0;g-=1)if(a[g].musicCarouselShelfRenderer){a[g].musicCarouselShelfRenderer.contents[0].musicTwoRowItemRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType==="MUSIC_PAGE_TYPE_ARTIST"&&a[g].musicCarouselShelfRenderer.contents.forEach(I=>{l.push(J(I))});break}}catch(a){console.error("Couldn't get suggestedArtists",a)}let u;try{u=e.header.musicImmersiveHeaderRenderer.subscriptionButton.subscribeButtonRenderer.subscriberCountWithSubscribeText.runs[0].text}catch(a){console.error("Couldn't get subscribers",a)}return{artistId:t,name:r,description:s,albums:o,singles:m,thumbnails:n,songsPlaylistId:i,suggestedArtists:l,subscribers:u}},X=e=>{var i;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(o){console.error("Couldn't get name",o)}let r;try{r=e.musicResponsiveListItemRenderer.navigationEndpoint.browseEndpoint.browseId}catch(o){console.error("Couldn't get artistId",o)}let s;try{s=(i=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:i.url}catch(o){console.error("Couldn't get thumbnailUrl",o)}let n;try{n=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].text}catch(o){console.error("Couldn't get subscribers",o)}return{name:t,artistId:r,thumbnailUrl:s,subscribers:n}};var b={body:{context:{capabilities:{},client:{clientName:"WEB_REMIX",clientVersion:"0.1"}}}};var Y=e=>{let{contents:t}=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer,r=[];return t.forEach(s=>{try{let n=T(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function O(e){return p(this,null,function*(){let t=yield z.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIIAWoKEAoQCRADEAQQBQ%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return Y(JSON.parse(t.body))}catch(r){return[]}})}import H from"got";var k=e=>{let{contents:t}=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer,r=[];return t.forEach(s=>{try{let n=F(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function K(e){return p(this,null,function*(){let t=yield H.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIYAWoKEAkQAxAEEAUQCg%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return k(JSON.parse(t.body))}catch(r){return console.error(r),[]}})}import Z from"got";var q=(e,t)=>{let{contents:r}=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer,s=[];return r.forEach(n=>{try{let i=S(n,t);i&&s.push(i)}catch(i){console.error(i)}}),s};function $(e,t){return p(this,null,function*(){var s;let r=yield Z.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIoAWoKEAoQAxAEEAUQCQ%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return q(JSON.parse(r.body),(s=t==null?void 0:t.onlyOfficialPlaylists)!=null?s:!1)}catch(n){return console.error(n),[]}})}import ee from"got";var te=e=>{let{contents:t}=e.contents.singleColumnMusicWatchNextResultsRenderer.tabbedRenderer.watchNextTabbedResultsRenderer.tabs[0].tabRenderer.content.musicQueueRenderer.content.playlistPanelRenderer,r=[];return t.forEach(s=>{try{let n=P(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function re(e){return p(this,null,function*(){let t=yield ee.post("https://music.youtube.com/youtubei/v1/next",{json:d(c({},b.body),{enablePersistentPlaylistPanel:!0,isAudioOnly:!0,params:"mgMDCNgE",playerParams:"igMDCNgE",tunerSettingValue:"AUTOMIX_SETTING_NORMAL",playlistId:`RDAMVM${e}`,videoId:e}),searchParams:{alt:"json",key:"AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30"},headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return te(JSON.parse(t.body))}catch(r){return[]}})}import se from"got";var ne=e=>{let{contents:t}=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].musicShelfRenderer,r=[],{thumbnailUrl:s,artist:n,album:i}=B(e.header);return t.forEach(o=>{var m;try{let l=U(o);l&&(l.album=i,((m=l.artists)==null?void 0:m.length)===0&&(l.artists=[{name:n}]),l.thumbnailUrl=s,r.push(l))}catch(l){console.error(l)}}),r};function ie(e){return p(this,null,function*(){let t=yield se.post("https://music.youtube.com/youtubei/v1/browse?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{browseId:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return ne(JSON.parse(t.body))}catch(r){return console.error(r),[]}})}import oe from"got";var le=e=>{let{contents:t}=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].musicPlaylistShelfRenderer,r=[];return t.forEach(s=>{try{let n=M(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function ue(e){return p(this,null,function*(){let t=yield oe.post("https://music.youtube.com/youtubei/v1/browse?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{browseId:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return le(JSON.parse(t.body))}catch(r){return console.error(r),[]}})}import ae from"got";var me=e=>{let{contents:t}=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer,r=[];return t.forEach(s=>{try{let n=X(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function ce(e,t){return p(this,null,function*(){var s;let r=yield ae.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIgAWoKEAMQBBAJEAoQBQ%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)","Accept-Language":(s=t==null?void 0:t.lang)!=null?s:"en",origin:"https://music.youtube.com"}});try{return me(JSON.parse(r.body))}catch(n){return console.error(n),[]}})}import de from"got";function pe(e,t){return p(this,null,function*(){var s;let r=yield de.post("https://music.youtube.com/youtubei/v1/browse?key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{browseId:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)","Accept-Language":(s=t==null?void 0:t.lang)!=null?s:"en",origin:"https://music.youtube.com"}});try{return V(JSON.parse(r.body),e)}catch(n){return console.error(n),{}}})}export{Q as AccountType,E as AlbumType,L as PageType,pe as getArtist,re as getSuggestions,ie as listMusicsFromAlbum,ue as listMusicsFromPlaylist,K as searchAlbums,ce as searchArtists,O as searchMusics,$ as searchPlaylists};
var D=Object.defineProperty,W=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var v=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))j.call(t,r)&&v(e,r,t[r]);if(w)for(var r of w(t))_.call(t,r)&&v(e,r,t[r]);return e},d=(e,t)=>W(e,N(t));var p=(e,t,r)=>new Promise((s,n)=>{var o=l=>{try{m(r.next(l))}catch(u){n(u)}},i=l=>{try{m(r.throw(l))}catch(u){n(u)}},m=l=>l.done?s(l.value):Promise.resolve(l.value).then(o,i);m((r=r.apply(e,t)).next())});var Q=(r=>(r.REGULAR="regular",r.VERIFIED_ARTIST="BADGE_STYLE_TYPE_VERIFIED_ARTIST",r))(Q||{}),E=(s=>(s.ep="EP",s.album="Album",s.single="Single",s))(E||{}),L=(s=>(s.artist="MUSIC_PAGE_TYPE_ARTIST",s.album="MUSIC_PAGE_TYPE_ALBUM",s.playlist="MUSIC_PAGE_TYPE_PLAYLIST",s))(L||{});import z from"got";var x="MUSIC_EXPLICIT_BADGE",y=e=>{let t=e.split(":");return t.length===3?parseInt(t[0],10)*3600+parseInt(t[1],10)*60+parseInt(t[2],10):parseInt(t[0],10)*60+parseInt(t[1],10)},A=e=>{switch(e){case"Album":return"Album";case"EP":return"EP";default:return"Single"}},f=e=>{let t=[];if(e.forEach(r=>{r.navigationEndpoint&&r.navigationEndpoint.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType==="MUSIC_PAGE_TYPE_ARTIST"&&t.push({name:r.text,id:r.navigationEndpoint.browseEndpoint.browseId})}),t.length===0){let r=e.findIndex(s=>s.text===" \u2022 ");r!==-1&&e.filter((s,n)=>n<r&&s.name!==" & ").forEach(s=>t.push({name:s.text}))}return t},T=e=>{var l;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint.watchEndpoint.videoId}catch(u){}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(u){}let s;try{s=f(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs)}catch(u){}let n;try{let{length:u}=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs;n=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[u-3].text}catch(u){}let o;try{o=(l=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:l.url}catch(u){}let i;try{let u=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs.length-1].text;i={label:u,totalSeconds:y(u)}}catch(u){}let m;try{m=e.musicResponsiveListItemRenderer.badges[0].musicInlineBadgeRenderer.icon.iconType===x}catch(u){m=!1}return{youtubeId:t,title:r,artists:s,album:n,thumbnailUrl:o,duration:i,isExplicit:m}},P=e=>{var l;let t;try{t=e.playlistPanelVideoRenderer.navigationEndpoint.watchEndpoint.videoId}catch(u){}let r;try{r=e.playlistPanelVideoRenderer.title.runs[0].text}catch(u){}let s;try{s=f(e.playlistPanelVideoRenderer.longBylineText.runs)}catch(u){}let n;try{n=e.playlistPanelVideoRenderer.longBylineText.runs[2].text}catch(u){}let o;try{o=e.playlistPanelVideoRenderer.badges[0].musicInlineBadgeRenderer.icon.iconType==="MUSIC_EXPLICIT_BADGE"}catch(u){o=!1}let i;try{i=(l=e.playlistPanelVideoRenderer.thumbnail.thumbnails.pop())==null?void 0:l.url}catch(u){}let m;try{m={label:e.playlistPanelVideoRenderer.lengthText.runs[0].text,totalSeconds:y(e.playlistPanelVideoRenderer.lengthText.runs[0].text)}}catch(u){}return{youtubeId:t,title:r,artists:s,isExplicit:o,album:n,thumbnailUrl:i,duration:m}},S=(e,t)=>{var i;let r;try{r=e.musicResponsiveListItemRenderer.navigationEndpoint.browseEndpoint.browseId}catch(m){}if(t&&e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text!=="YouTube Music")return null;let s;try{s=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(m){}let n;try{n=parseInt(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].text.split(" ")[0],10)}catch(m){}let o;try{o=(i=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:i.url}catch(m){}return{playlistId:r,title:s,totalSongs:n,thumbnailUrl:o}},M=e=>{var l,u;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint.watchEndpoint.videoId}catch(R){}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(R){}let s;try{s=f(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs)}catch(R){}let n;try{n=e.musicResponsiveListItemRenderer.flexColumns[2].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(R){}let o;try{o=(l=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:l.url}catch(R){}let i;try{i={label:e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text,totalSeconds:y(e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text)}}catch(R){}let m;try{m=((u=e.musicResponsiveListItemRenderer)==null?void 0:u.badges[0].musicInlineBadgeRenderer.icon.iconType)===x}catch(R){m=!1}return{youtubeId:t,title:r,artists:s,album:n,thumbnailUrl:o,duration:i,isExplicit:m}},F=e=>{var u,R,h;let t;try{t=e.musicResponsiveListItemRenderer.navigationEndpoint.browseEndpoint.browseId}catch(a){console.error("Couldn't parse albumId",a)}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(a){console.error("Couldn't parse title",a)}let s;try{s=A(e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text)}catch(a){console.error("Couldn't parse album type",a)}let n;try{n=(u=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:u.url}catch(a){console.error("Couldn't parse thumbnailUrl",a)}let o;try{o=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].text}catch(a){console.error("Couldn't parse artist",a)}let i;try{i=(R=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].navigationEndpoint)==null?void 0:R.browseEndpoint.browseId}catch(a){console.error("Couldn't parse artistId",a)}let m;try{m=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[4].text}catch(a){console.error("Couldn't parse year",a)}let l;try{l=((h=e.musicResponsiveListItemRenderer)==null?void 0:h.badges[0].musicInlineBadgeRenderer.icon.iconType)===x}catch(a){l=!1}return{albumId:t,title:r,type:s,thumbnailUrl:n,artist:o,artistId:i,year:m,isExplicit:l}},B=e=>{var n;let t;try{t=e.musicDetailHeaderRenderer.subtitle.runs[2].text}catch(o){console.error("Couldn't parse artist from album header",o)}let r;try{r=e.musicDetailHeaderRenderer.title.runs[0].text}catch(o){console.error("Couldn't parse title from album header",o)}let s;try{s=(n=e.musicDetailHeaderRenderer.thumbnail.croppedSquareThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:n.url}catch(o){console.error("Couldn't parse thumbnailUrl from album header",o)}return{artist:t,album:r,thumbnailUrl:s}},U=e=>{var i,m;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].navigationEndpoint.watchEndpoint.videoId}catch(l){}let r;try{r=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(l){}let s=[];try{if((i=e.musicResponsiveListItemRenderer.flexColumns[1])!=null&&i.musicResponsiveListItemFlexColumnRenderer.text.runs)for(let l=0;l<e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs.length;l+=2)s.push({name:e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[l].text})}catch(l){}let n;try{n={label:e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text,totalSeconds:y(e.musicResponsiveListItemRenderer.fixedColumns[0].musicResponsiveListItemFixedColumnRenderer.text.runs[0].text)}}catch(l){}let o;try{o=((m=e.musicResponsiveListItemRenderer)==null?void 0:m.badges[0].musicInlineBadgeRenderer.icon.iconType)===x}catch(l){o=!1}return{youtubeId:t,artists:s,title:r,duration:n,isExplicit:o}},G=e=>{var m,l;let t;try{t=e.musicTwoRowItemRenderer.title.runs[0].text}catch(u){console.error("Couldn't get title",u)}let r;try{r=A(e.musicTwoRowItemRenderer.subtitle.runs[0].text)}catch(u){console.error("Couldn't get album type",u)}let s;try{s=e.musicTwoRowItemRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseId}catch(u){console.error("Couldn't get albumId",u)}let n;try{n=(m=e.musicTwoRowItemRenderer.subtitle.runs.pop())==null?void 0:m.text}catch(u){console.error("Couldn't get year",u)}let o;try{o=e.musicTwoRowItemRenderer.subtitleBadges[0].musicInlineBadgeRenderer.icon.iconType===x}catch(u){o=!1}let i;try{i=(l=e.musicTwoRowItemRenderer.thumbnailRenderer.musicThumbnailRenderer.thumbnail.thumbnails.shift())==null?void 0:l.url}catch(u){console.error("Couldn't get thumbnailUrl",u)}return{title:t,type:r,albumId:s,year:n,thumbnailUrl:i,isExplicit:o}},J=e=>{var o;let t;try{t=e.musicTwoRowItemRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseId}catch(i){console.error("Couldn't get artistId",i)}let r;try{r=e.musicTwoRowItemRenderer.title.runs[0].text}catch(i){console.error("Couldn't get name",i)}let s;try{s=e.musicTwoRowItemRenderer.subtitle.runs[0].text;let i=s.split(" ");i.pop(),s=i.join(" ")}catch(i){console.error("Couldn't get subscribers",i)}let n;try{n=(o=e.musicTwoRowItemRenderer.thumbnailRenderer.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:o.url}catch(i){console.error("Couldn't get thumbnailUrl",i)}return{artistId:t,name:r,subscribers:s,thumbnailUrl:n}},V=(e,t)=>{var R,h;let r;try{r=e.header.musicImmersiveHeaderRenderer.title.runs[0].text}catch(a){console.error("Couldn't get artist name",a)}let s;try{s=e.header.musicImmersiveHeaderRenderer.description.runs[0].text}catch(a){console.error("Couldn't get artist description",a)}let n=[];try{e.header.musicImmersiveHeaderRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.forEach(g=>{n.push(g)})}catch(a){console.error("Couldn't get artist thumbnails",a)}let o;try{o=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].musicShelfRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseId}catch(a){console.error("Couldn't get artist songPlaylistId",a)}let i=[],m=[];try{let{contents:a}=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer;for(let g of a)(R=g.musicCarouselShelfRenderer)!=null&&R.contents&&((h=g.musicCarouselShelfRenderer.contents[0].musicTwoRowItemRenderer.title.runs[0].navigationEndpoint)==null?void 0:h.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType)==="MUSIC_PAGE_TYPE_ALBUM"&&g.musicCarouselShelfRenderer.contents.forEach(I=>{let C=G(I);C.type==="Single"?m.push(C):i.push(C)})}catch(a){console.error("Couldn't get albums",a)}let l=[];try{let{contents:a}=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer;for(let g=a.length-1;g>=0;g-=1)if(a[g].musicCarouselShelfRenderer){a[g].musicCarouselShelfRenderer.contents[0].musicTwoRowItemRenderer.title.runs[0].navigationEndpoint.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType==="MUSIC_PAGE_TYPE_ARTIST"&&a[g].musicCarouselShelfRenderer.contents.forEach(I=>{l.push(J(I))});break}}catch(a){console.error("Couldn't get suggestedArtists",a)}let u;try{u=e.header.musicImmersiveHeaderRenderer.subscriptionButton.subscribeButtonRenderer.subscriberCountWithSubscribeText.runs[0].text}catch(a){console.error("Couldn't get subscribers",a)}return{artistId:t,name:r,description:s,albums:i,singles:m,thumbnails:n,songsPlaylistId:o,suggestedArtists:l,subscribers:u}},X=e=>{var o;let t;try{t=e.musicResponsiveListItemRenderer.flexColumns[0].musicResponsiveListItemFlexColumnRenderer.text.runs[0].text}catch(i){console.error("Couldn't get name",i)}let r;try{r=e.musicResponsiveListItemRenderer.navigationEndpoint.browseEndpoint.browseId}catch(i){console.error("Couldn't get artistId",i)}let s;try{s=(o=e.musicResponsiveListItemRenderer.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails.pop())==null?void 0:o.url}catch(i){console.error("Couldn't get thumbnailUrl",i)}let n;try{n=e.musicResponsiveListItemRenderer.flexColumns[1].musicResponsiveListItemFlexColumnRenderer.text.runs[2].text}catch(i){console.error("Couldn't get subscribers",i)}return{name:t,artistId:r,thumbnailUrl:s,subscribers:n}};var b={body:{context:{capabilities:{},client:{clientName:"WEB_REMIX",clientVersion:"0.1"}}}};var Y=e=>{let{contents:t}=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer,r=[];return t.forEach(s=>{try{let n=T(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function O(e){return p(this,null,function*(){let t=yield z.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIIAWoKEAoQCRADEAQQBQ%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return Y(JSON.parse(t.body))}catch(r){return[]}})}import H from"got";var k=e=>{let{contents:t}=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer,r=[];return t.forEach(s=>{try{let n=F(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function K(e){return p(this,null,function*(){let t=yield H.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIYAWoKEAkQAxAEEAUQCg%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return k(JSON.parse(t.body))}catch(r){return console.error(r),[]}})}import Z from"got";var q=(e,t)=>{var n;let r=(n=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer)==null?void 0:n.contents;if(!r)return[];let s=[];return r.forEach(o=>{try{let i=S(o,t);i&&s.push(i)}catch(i){console.error(i)}}),s};function $(e,t){return p(this,null,function*(){var s;let r=yield Z.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIoAWoKEAoQAxAEEAUQCQ%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return q(JSON.parse(r.body),(s=t==null?void 0:t.onlyOfficialPlaylists)!=null?s:!1)}catch(n){return console.error(n),[]}})}import ee from"got";var te=e=>{let{contents:t}=e.contents.singleColumnMusicWatchNextResultsRenderer.tabbedRenderer.watchNextTabbedResultsRenderer.tabs[0].tabRenderer.content.musicQueueRenderer.content.playlistPanelRenderer,r=[];return t.forEach(s=>{try{let n=P(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function re(e){return p(this,null,function*(){let t=yield ee.post("https://music.youtube.com/youtubei/v1/next",{json:d(c({},b.body),{enablePersistentPlaylistPanel:!0,isAudioOnly:!0,params:"mgMDCNgE",playerParams:"igMDCNgE",tunerSettingValue:"AUTOMIX_SETTING_NORMAL",playlistId:`RDAMVM${e}`,videoId:e}),searchParams:{alt:"json",key:"AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30"},headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return te(JSON.parse(t.body))}catch(r){return[]}})}import se from"got";var ne=e=>{let{contents:t}=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].musicShelfRenderer,r=[],{thumbnailUrl:s,artist:n,album:o}=B(e.header);return t.forEach(i=>{var m;try{let l=U(i);l&&(l.album=o,((m=l.artists)==null?void 0:m.length)===0&&(l.artists=[{name:n}]),l.thumbnailUrl=s,r.push(l))}catch(l){console.error(l)}}),r};function ie(e){return p(this,null,function*(){let t=yield se.post("https://music.youtube.com/youtubei/v1/browse?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{browseId:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});try{return ne(JSON.parse(t.body))}catch(r){return console.error(r),[]}})}import oe from"got";var le=e=>{var n;let t=e.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0],{contents:r}=(n=t.musicPlaylistShelfRenderer)!=null?n:t.musicCarouselShelfRenderer,s=[];return r.forEach(o=>{try{let i=M(o);i&&s.push(i)}catch(i){console.error(i)}}),s};function ue(e){return p(this,null,function*(){let t;e.startsWith("VL")||(t="VL"+e);try{let r=yield oe.post("https://music.youtube.com/youtubei/v1/browse?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{browseId:t}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",origin:"https://music.youtube.com"}});return le(JSON.parse(r.body))}catch(r){return console.error(`Error in listMusicsFromPlaylist: ${r}`),[]}})}import ae from"got";var me=e=>{let{contents:t}=e.contents.tabbedSearchResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.pop().musicShelfRenderer,r=[];return t.forEach(s=>{try{let n=X(s);n&&r.push(n)}catch(n){console.error(n)}}),r};function ce(e,t){return p(this,null,function*(){var s;let r=yield ae.post("https://music.youtube.com/youtubei/v1/search?alt=json&key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{params:"EgWKAQIgAWoKEAMQBBAJEAoQBQ%3D%3D",query:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)","Accept-Language":(s=t==null?void 0:t.lang)!=null?s:"en",origin:"https://music.youtube.com"}});try{return me(JSON.parse(r.body))}catch(n){return console.error(n),[]}})}import de from"got";function pe(e,t){return p(this,null,function*(){var s;let r=yield de.post("https://music.youtube.com/youtubei/v1/browse?key=AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",{json:d(c({},b.body),{browseId:e}),headers:{"User-Agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)","Accept-Language":(s=t==null?void 0:t.lang)!=null?s:"en",origin:"https://music.youtube.com"}});try{return V(JSON.parse(r.body),e)}catch(n){return console.error(n),{}}})}export{Q as AccountType,E as AlbumType,L as PageType,pe as getArtist,re as getSuggestions,ie as listMusicsFromAlbum,ue as listMusicsFromPlaylist,K as searchAlbums,ce as searchArtists,O as searchMusics,$ as searchPlaylists};
{
"name": "node-youtube-music",
"description": "Unofficial YouTube Music API for Node.js",
"version": "0.10.2",
"version": "0.10.3",
"exports": "./dist/index.js",

@@ -22,3 +22,3 @@ "files": [

"test": "vitest",
"generate-change-log": "pnpx gitmoji-changelog"
"generate-change-log": "git fetch --all && pnpx gitmoji-changelog"
},

@@ -25,0 +25,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc