Closed sixtusk closed 7 months ago
Did you get this working in the end?
As I'm not an advanced AWS developer I already have trouble understanding the setup instructions. I have aws cli, nodejs and ask installed, cannot run ask deploy however.
I will take a look at the error. I am still running this on my Echo Dot 4.
@ORi0N Can you say which part of the setup instructions are unclear so that I can modify/fix them
I'm having the same error: "[Error]: CliError: The lambda deploy failed for Alexa region "default": InvalidParameterValueException: The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs18.x) while creating or updating functions."
Part 4 and 5 of the instructions are unclear, im not an advanced developer and it is unclear to me what to do after deploying.
Thanks in advance, looking forward to this!
I think the code requires some change related to node version. Will update the node version , rebuild and then push the changes.
Yeah I also thought of that, thank you, let us know when the changes have been pushed and also if you could be a but more detailed on what to do after deploying that would be awesome since I'm not nich of a code development savy.
Yeah, it was the node version, I changed it in the ask-resources.json and i was able to deploy it fine. I generated my Youtube API, but I really have no clue on what to do next, or where do I put this API.
Alright I figured it out, however when it is running on my echo dot, and I say play (song) it just says, you just triggered playSongIntent, and checking the JSON for the intents there's no handlers for the intent so I don't know if this is a problem on my end.
Thanks, Changed in ask-resources.json to 18.x and now it works:
"skillInfrastructure": { "userConfig": { "runtime": "nodejs18.x",
and now ask deploy returns: `Code for region default built to /home/xxx/aws/youtube-music-alexa-skill-main/.ask/lambda/build.zip successfully with build flow NodeJsNpmBuildFlow.
==================== Deploy Skill Infrastructure ==================== ✔ Deploy Alexa skill infrastructure for region "default"
The api endpoints of skill.json have been updated from the skill infrastructure deploy results.
Skill infrastructures deployed successfully through @ask-cli/lambda-deployer.
==================== Enable Skill ==================== The skill has been enabled.`
What's next ?
And where do you add the YOUTUBE API KEY?
Here?
That's where I added it, did you manually input the key name? Or was it already there? I am talking about "YOUTUBE_API_KEY"
I had to manually add it, was nothing there.
You anu further? I am afraid we’ll need the dev for answers.
On Sun, 18 Jun 2023 at 18:35, Kewz4 @.***> wrote:
That's where I added it, did you manually input the key name? Or was it already there? I am talking about "YOUTUBE_API_KEY"
— Reply to this email directly, view it on GitHub https://github.com/akhilerm/youtube-music-alexa-skill/issues/1#issuecomment-1596199212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFLFXL47JMQYLXKRPJWYRTXL4U4XANCNFSM6AAAAAAVYKMUVQ . You are receiving this because you were mentioned.Message ID: @.***>
Yes, I went further, go into the Amazon developer console > Alexa Skill Set and you can see the skill set there and do any changes and build.
Then you go into your Alexa app > skills > scroll down into custom skills > developer and it should be there.
However the skill doesn't do anything when I ask it to play music, it recognizes the invitation command but that's it.
We can also talk on discord if you want, my username is just kewz. (with a period)
Here it just says 'I have trouble doing what you asked' on whatever I ask it.
Try saying launch the "invitation name" skill.
Well, it's not that it's not launching. That works. It's also activated successfully:
And the skill is Lambda is triggered successfully too . Check in the CloudWatch logs here:
When troubleshooting, the error message in the return message from the googleapis.com led me to the fact that the Youtube API v3 was not enabled in the project. I could easily do this using: https://console.cloud.google.com/apis/dashboard?project=yourprojectname. It's just clicking enable.
On the phone, Alexa answers me what it will play, but it remains silent afterwards.
And it throws this error in the logs:
2023-06-23T11:58:21.855Z 0a331ae9-34bd-4717-b696-50c38b7eb8dc INFO ~~~~ Error handled: AskSdk.GenericRequestDispatcher Error: Unable to find a suitable request handler. at createAskSdkError (/var/task/node_modules/ask-sdk-runtime/dist/util/AskSdkUtils.js:23:19) at GenericRequestDispatcher.dispatchRequest (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:72:55) at async GenericRequestDispatcher.dispatch (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:45:22) at async CustomSkill.invoke (/var/task/node_modules/ask-sdk-core/dist/skill/CustomSkill.js:68:26)
But when actually testing from the Echo Dot v2 it works fine!!! It's correctly playing the song.
Alexa, Open youtube
Play Mark Knopfler, what it is
Playing ....
Hope this helps you @Kewz4 !
I've forked and submitted the changes we made to get it working @akhilerm . Thanks again for the dev.
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?
@ORi0N @Kewz4 I have migrated the skill to an Alexa hosted skill instead of self hosted for easier development and monitoring. This makes sure that many of the details are hidden from user and it is easier to deploy. I still have to add a migration step for existing users, but new users can easily use the new alexa hosted skill.
It would be great if you can look at the current doc and check if I am missing something.
Also, regarding some songs not working. @ORi0N can you list the exact query used. I have raised an issue with ask sdk, https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/723, but havent got any traction so far.
Thanks for trying out this
The exact command used is
"Open youtube" + "Play Avicii you make me"
Query:
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
That doesn't play
Just reproduced this issue on my Echo Dot 4. Did some digging around, but TBH I am not able to understand why its not playing this music.
Really a lot of songs/streams are impacted by this issue. It's barely usable now sadly. What can we do to get more traction on this issue?
Can this issue be closed, and we can create another issue for some songs not playing?
Yes it can. There is indeed still the problem of certain songs not playing which almost renders the skills useless today ;)
I have opened a new issue for this, so this one can be closed. I'm willing to try some more things if needed.
Issue with some songs not playing is discussed here. https://github.com/akhilerm/youtube-music-alexa-skill/issues/6
Runing ask deploy leads to a "Required parameter(s) missing in the request." error.
here is some debug log: