akhilerm / youtube-music-alexa-skill

Alexa skill to play songs from youtube music on echo devices
Apache License 2.0
75 stars 30 forks source link

Certain songs not playing - returned url by google API is not correct / incorrect format #6

Open ORi0N opened 8 months ago

ORi0N commented 8 months ago

Splitting this one off of the other issue.

ery:

2023-08-27T19:08:07.408Z INFO { kind: 'youtube#searchResult', etag: 'm1U7P4FmX0SmtMReYv4ntpUCRVA', id: { kind: 'youtube#video', videoId: '2GADx4Hy-Gg' }, snippet: { publishedAt: '2013-09-16T13:00:35Z', channelId: 'UC1SqP7_RfOC9Jf9L_GRHANg', title: 'Avicii - You Make Me (Official)', description: "Listen to Avicii's latest single “SOS” here: https://Avicii.lnk.to/SOS.", thumbnails: { default: [Object], medium: [Object], high: [Object] }, channelTitle: 'AviciiOfficialVEVO', liveBroadcastContent: 'none', publishTime: '2013-09-16T13:00:35Z' }, videoId: '2GADx4Hy-Gg' }

Leads to: mimeType: 'audio/webm; codecs="opus"', qualityLabel: null, bitrate: 144812, audioBitrate: 160, itag: 251, initRange: { start: '0', end: '265' }, indexRange: { start: '266', end: '670' }, lastModified: '1574706181940362', contentLength: '3711890', quality: 'tiny', projectionType: 'RECTANGULAR', averageBitrate: 128761, audioQuality: 'AUDIO_QUALITY_MEDIUM', approxDurationMs: '230621', audioSampleRate: '48000', audioChannels: 2, loudnessDb: 5.0132666, url: 'https://rr2---sn-p5qs7nsk.googlevideo.com/videoplayback?expire=1693184887&ei=F5_rZL7WG4rh8wT_nLGIBA&ip=54.226.20.136&id=o-AATvH8Nt1tm6GzMLokn3G4IdY0WNP-o7xLEBOs6RRQfb&itag=251&source=youtube&requiressl=yes&mh=MD&mm=31%2C26&mn=sn-p5qs7nsk%2Csn-ab5sznzr&ms=au%2Conr&mv=u&mvi=2&pl=22&gcr=us&spc=UWF9f6g1KcWZWSM38X6zgyTHKSGgnXGPrYJxvI2U8w&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=4X367NPDZBvzApl60agIw7EP&gir=yes&clen=3711890&dur=230.621&lmt=1574706181940362&mt=1693162768&fvip=5&keepalive=yes&fexp=24007246%2C51000011&beids=24472436&c=WEB&txp=5531432&n=C4ppJD_zbnlXXw&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AG3C_xAwRQIhAPQBQ_rUFXqdS8OW2V25fYgm_FLSpBFWo5vsw_QxU27rAiAhtwKQIcoYVEXzJS4j7aa_vVZmcbhXfP479tuRgodySA%3D%3D&sig=AOq0QJ8wRQIgOgR7PeQpiSxxjlrtUI48zeR6BKEHcSRCiMUmVGc74moCIQDLPI5P-i2SM7kVIjIhW4UB5DG6BJRbvWAU0TsUDEj2JA%3D%3D', hasVideo: false, hasAudio: true, container: 'webm', codecs: 'opus', videoCodec: null, audioCodec: 'opus', isLive: false, isHLS: false, isDashMPD: false

ery:

2023-08-27T19:08:07.408Z INFO { kind: 'youtube#searchResult', etag: 'm1U7P4FmX0SmtMReYv4ntpUCRVA', id: { kind: 'youtube#video', videoId: '2GADx4Hy-Gg' }, snippet: { publishedAt: '2013-09-16T13:00:35Z', channelId: 'UC1SqP7_RfOC9Jf9L_GRHANg', title: 'Avicii - You Make Me (Official)', description: "Listen to Avicii's latest single “SOS” here: https://Avicii.lnk.to/SOS.", thumbnails: { default: [Object], medium: [Object], high: [Object] }, channelTitle: 'AviciiOfficialVEVO', liveBroadcastContent: 'none', publishTime: '2013-09-16T13:00:35Z' }, videoId: '2GADx4Hy-Gg' }

Leads to: mimeType: 'audio/webm; codecs="opus"', qualityLabel: null, bitrate: 144812, audioBitrate: 160, itag: 251, initRange: { start: '0', end: '265' }, indexRange: { start: '266', end: '670' }, lastModified: '1574706181940362', contentLength: '3711890', quality: 'tiny', projectionType: 'RECTANGULAR', averageBitrate: 128761, audioQuality: 'AUDIO_QUALITY_MEDIUM', approxDurationMs: '230621', audioSampleRate: '48000', audioChannels: 2, loudnessDb: 5.0132666, url: 'https://rr2---sn-p5qs7nsk.googlevideo.com/videoplayback?expire=1693184887&ei=F5_rZL7WG4rh8wT_nLGIBA&ip=54.226.20.136&id=o-AATvH8Nt1tm6GzMLokn3G4IdY0WNP-o7xLEBOs6RRQfb&itag=251&source=youtube&requiressl=yes&mh=MD&mm=31%2C26&mn=sn-p5qs7nsk%2Csn-ab5sznzr&ms=au%2Conr&mv=u&mvi=2&pl=22&gcr=us&spc=UWF9f6g1KcWZWSM38X6zgyTHKSGgnXGPrYJxvI2U8w&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=4X367NPDZBvzApl60agIw7EP&gir=yes&clen=3711890&dur=230.621&lmt=1574706181940362&mt=1693162768&fvip=5&keepalive=yes&fexp=24007246%2C51000011&beids=24472436&c=WEB&txp=5531432&n=C4ppJD_zbnlXXw&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AG3C_xAwRQIhAPQBQ_rUFXqdS8OW2V25fYgm_FLSpBFWo5vsw_QxU27rAiAhtwKQIcoYVEXzJS4j7aa_vVZmcbhXfP479tuRgodySA%3D%3D&sig=AOq0QJ8wRQIgOgR7PeQpiSxxjlrtUI48zeR6BKEHcSRCiMUmVGc74moCIQDLPI5P-i2SM7kVIjIhW4UB5DG6BJRbvWAU0TsUDEj2JA%3D%3D', hasVideo: false, hasAudio: true, container: 'webm', codecs: 'opus', videoCodec: null, audioCodec: 'opus', isLive: false, isHLS: false, isDashMPD: false

It's however not playing all content. Some songs work fine, others do not, and when inspecting the logs:

Working song: 2023-06-23T15:36:24.093Z 57899906-6ec6-4221-b9ee-0134fe4095fe INFO { mimeType: 'audio/webm; codecs="opus"', qualityLabel: null, bitrate: 142160, audioBitrate: 160, itag: 251, initRange: { start: '0', end: '265' }, indexRange: { start: '266', end: '653' }, lastModified: '1685999978500351', contentLength: '3778546', quality: 'tiny', projectionType: 'RECTANGULAR', averageBitrate: 134598, audioQuality: 'AUDIO_QUALITY_MEDIUM', approxDurationMs: '224581', audioSampleRate: '48000', audioChannels: 2, loudnessDb: 0.10999966, url: 'https://rr3---sn-p5qlsny6.googlevideo.com/videoplayback?expire=1687556182&ei=9ruVZODOM4zn8wSxyLioDA&ip=44.200.48.216&id=o-AOCNvmfn6xttLzecQpYm1dVWM-3tWGojlKqpo-UMnt7o&itag=251&source=youtube&requiressl=yes&mh=Gm&mm=31%2C29&mn=sn-p5qlsny6%2Csn-p5qddn7d&ms=au%2Crdu&mv=m&mvi=3&pl=11&initcwndbps=1035000&spc=qEK7B411jiKmyBtoFhGOasuJCdr_9uM3pAlgSApuuw&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=8Nc7rU8j8bJhnwqhimXpcOYN&gir=yes&clen=3778546&dur=224.581&lmt=1685999978500351&mt=1687534149&fvip=5&keepalive=yes&fexp=24007246&c=WEB&txp=4432434&n=LMtgWyE3ZWOQ8A&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgS2vCF-IgpSbYwcr8G68NOtHzCTbWRmA1eBwd27DKIBQCIQDFSMoX2OuGn_77ZCNrimBX57DdA_3C6r-9Ay6gPr8AnQ%3D%3D&sig=AOq0QJ8wRQIgKeu7_k0y9HAe73G2t4eV6q6rvvfnDaNGUZn4GyQSFXACIQC725c1F-Jfd4mLvl9RHeBieDjjOIbzyGwR7ryKA9uIVg%3D%3D', hasVideo: false, hasAudio: true, container: 'webm', codecs: 'opus', videoCodec: null, audioCodec: 'opus', isLive: false, isHLS: false, isDashMPD: false }

Not working song: 2023-06-23T15:50:35.789Z 6c9f11dd-43f1-4deb-9fab-b52a5f632a61 INFO { mimeType: 'video/mp4; codecs="avc1.64001F, mp4a.40.2"', qualityLabel: '720p', bitrate: 377577, audioBitrate: 192, itag: 22, width: 1280, height: 720, lastModified: '1681982993805470', quality: 'hd720', fps: 25, projectionType: 'RECTANGULAR', audioQuality: 'AUDIO_QUALITY_MEDIUM', approxDurationMs: '8179948', audioSampleRate: '44100', audioChannels: 2, url: 'https://rr2---sn-p5qlsnrr.googlevideo.com/videoplayback?expire=1687557034&ei=Sr-VZL6tMIOb8wS4w7bgBg&ip=44.200.63.182&id=o-ADI-w4YWsJaTU9uzoCh1m_C6vkajhDfq91J3qcbSIARN&itag=22&source=youtube&requiressl=yes&mh=um&mm=31%2C29&mn=sn-p5qlsnrr%2Csn-p5qddn7r&ms=au%2Crdu&mv=m&mvi=2&pl=11&gcr=us&initcwndbps=818750&spc=qEK7B3p563lfMOctz79L3vqx9QP3P1KntcqhvChGQg&vprv=1&svpuc=1&mime=video%2Fmp4&ns=I1qqQAbCMDfD0g-Cx7xD3skN&cnr=14&ratebypass=yes&dur=8179.948&lmt=1681982993805470&mt=1687535107&fvip=3&fexp=24007246&c=WEB&txp=4532434&n=8vCvglpSBvnHLg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgOjfaoNrPyjeMzhgzr0beoue0nDG9Z9yqPtQTAFxkqqoCIQCL6afcMXbhykVd8kMU31hd_0SYavZfmmQE0dT8ILxWpw%3D%3D&sig=AOq0QJ8wRQIgSCBFsqf2lou_VWnkfJwjoA7jipTe7i52UVqzAgvsJnwCIQDXrLk70lIgaeuiKMA0NLwxnkuRWxWfogj4d11ubNe6Mw%3D%3D', hasVideo: true, hasAudio: true, container: 'mp4', codecs: 'avc1.64001F, mp4a.40.2', videoCodec: 'avc1.64001F', audioCodec: 'mp4a.40.2', isLive: false, isHLS: false, isDashMPD: false }

It seems that the URL returned is not correct? When trying to access it using browser, the first one works, but I get a 403 on the second one. Permission denied, why?

akhilerm commented 4 months ago

Related issue in alexa https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/723