Git Product home page Git Product logo

alexa-youtube-skill's Introduction

alexa-youtube-skill

This project contains the source code for an unpublished skill that allows users to search and play audio from YouTube as, by default, Amazon Alexa does not support playing audio from YouTube.

After setting this skill up, it's easy to query YouTube for the video of your choice:

Alexa, ask YouTube to search for ...

This skill performs a search, finding the most relevant video that matches the query. It then streams the video (audio only) to your Alexa device for your enjoyment. :)

Additional Information

Setup: The instructions have been moved to this repository's wiki page.

Migration: Version 3.x.x is the latest version and fixes several critical issues present in earlier versions. To migrate to v3, please use this guide on the wiki.

Disclaimer: This skill is not officially supported by YouTube and will never be published on Amazon. It was originally intended as a proof-of-concept, but instructions on setting it up are provided (see above).

alexa-youtube-skill's People

Contributors

andrewdavisdev avatar chokkyvista avatar colinfrei avatar dipu7388 avatar dmhacker avatar indiana71 avatar salim-b avatar ulich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alexa-youtube-skill's Issues

No stupid question tab

Not an issue but there's no stupid question section so this is the way to communicate...

How do I install/add this skill?

Fantasy wish list for features?

@dmhacker how would you WANT THIS SKILL to work / be architected, if you could do anything? For me, YouTube has good search, huge availability to content, but the video to audio transforming step is weirdly stupid and wasteful. I wonder if using a 3rd party MP3 censersion service would make the setup and deploy easier?

Performance issue

It takes almost 2-3mins to search for a video in youtube and play.

How to activate skill in the app?

Hello,
the skill works well for me in the test area. I can see it under developer in the app. But i can´t see it in the app under "video" settings. Alexa: "Can´t find any video skills."
Thank you for help.
Sledge

Link the Account

Can you please show me were i can Link the Account that i can use the Skill on my Alexa? I did all steps but i can´t test it on alexa because i think it´s didn´t linked but idk how to link it.

The skill swallows words

Hey,

Alexa recognises all the words but not all the words arrive at the skill.
The words have either disappeared at the front, back or on both sides.

How to make it work on a french echo ?

Hi, I followed this great topic, thanks.
But it is not working for me. Maybe I missed something, or is it linked to the language of my french echo.
How can I make a french interaction model ?
Where are listed the vocal commands we can use ?
Is there a lsit of checks I can validate ?
Thanks again.
MisterSeb

Problems with the skill on amazon echo show

Hi,

I have put this skill on my echo show and general i can say that it works but i have following issue:

After i hear one or two videos, i am asking alexa to close the screen and when i later ask alexa ask youtube „find....“ then nothing happens. When i take power off from the echo show and start it again, the. It works immediately again...want

Stop/pause/resume playback

I have successfully set it up and its finding and playing the songs requested.
"Alexa, Ask Youtube to play artist title"

However during playback if i say any of these:
Alexa, stop
Alexa, ask Youtube to stop
Alexa, ask Youtube to pause

She always responds with:
"You are not playing anything currently"

Also on a side note... If i want o switch to my own Heroku its only the URL i have to change in the AWS Lambda index.js?
// Set Heroku URL
var heroku = process.env.HEROKU_APP_URL || "https://**********.herokuapp.com";

Nothing else requires changing?

Anyone having issues with long videos?

Anyone having issues with videos that are long? Seems like maybe some caching issue. For example, try searching for "Prince". The first result that is returned is a 7minute video. It won't play unless you hit the horokuapp directly and search for Prince, let the video play through to get it cached in horoku. Then you can search for it and it will play. But try something like "Guardians of the Galaxy Soundtrack". The first result is 1hours and 30minutes. That wont play at all.

Unhandled rejection Error: Invalid application

I just took the recent code from master.
When testing lamda function, I am getting this error:

Unhandled rejection Error: Invalid application
 at Object.ensureErrorObject (/var/task/node_modules/bluebird/js/main/util.js:261:20)
    at Promise._rejectCallback (/var/task/node_modules/bluebird/js/main/promise.js:472:22)
    at Promise._settlePromiseFromHandler (/var/task/node_modules/bluebird/js/main/promise.js:516:17)
    at Promise._settlePromiseAt (/var/task/node_modules/bluebird/js/main/promise.js:584:18)
    at Promise._settlePromiseAtPostResolution (/var/task/node_modules/bluebird/js/main/promise.js:248:10)
    at Async._drainQueue (/var/task/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/var/task/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/var/task/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

Doesn't work

When asking alexa to open the skill there is an error "The target Lambda application returned a failure response".

When checking Lambda there is "This function contains external libraries. Uploading a new file will override these libraries."

Do I have to buy a better/larger version of amazon aws?

Thank you!

Total Noob

Hi -- I am trying to create this skill as outlined, however, the steps listed on the Wiki and Amazon's interface are completely different.

For instance, I never found "Global Fields section, mark that the skill uses audio player directives" where I named Invocation (also, invocation needs to be two words, not one? "you tube" not "youtube"? I did find, under Interfaces, a tab to turn on Audio Player -- is that correct?

In the Interaction Model page, I found build-in Intents and create a Custom Intent, but no "Schema Intent". And when I tried to Create an Intent and name it Schema, pasting in the script
{
"intents": [
{
"slots": [
{
"name": "VideoQuery",
"type": "VIDEOS" ...etc...

I got a dialogue box requesting I "Select an Existing Slot" and that there were "no existing slots" and the box changed name to "Sample Utterances" so I deleted the first script and pasted in Sample Utterances from the Wiki, but that wasn't supported, either...

Is there an easier to follow set of instructions is this skill just not meant for noobs like myself. I was really hoping this would work as my teenage son loves listening to youTube while he falls asleep.

Unhandle rejection Error: Invalid application

Hello,

i want to install this skill today on a aws lambda.
This lambda is in EU ireland and use NodeJs 4.3

I want to start a small lambda test. I get follwing error:

2017-11-22T22:01:03.122Z	a1af59bf-cfd0-11e7-91cc-739af6785e91	Unhandled rejection Error: Invalid application
    at Object.ensureErrorObject (/var/task/node_modules/bluebird/js/main/util.js:261:20)
    at Promise._rejectCallback (/var/task/node_modules/bluebird/js/main/promise.js:472:22)
    at Promise._settlePromiseFromHandler (/var/task/node_modules/bluebird/js/main/promise.js:516:17)
    at Promise._settlePromiseAt (/var/task/node_modules/bluebird/js/main/promise.js:584:18)
    at Promise._settlePromiseAtPostResolution (/var/task/node_modules/bluebird/js/main/promise.js:248:10)
    at Async._drainQueue (/var/task/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/var/task/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/var/task/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

I hope you can help me 👍

Could not find any linked video skills

I did all the steps and although on the test page on my developer account the response is correct, on my alexa device I get this message "I Could not find any linked video skills"... What is going wrong?

Are you hiding the instructions on purpose?

Your Readme states : "The instructions have been moved to this repository's wiki page." which takes you to https://github.com/dmhacker/alexa-youtube-skill/wiki which then states: "For instructions on how to setup the skill, please visit the Setup Process page. " which takes you to https://github.com/dmhacker/alexa-youtube-skill/wiki/Setup-Process-%28Current%29 which says: "For now, the setup process is detailed here. The guide will be moved back to the wiki shortly." and this link https://imgur.com/a/H5R7L points to a single screenshot that is totally worthless. This is dated April 5th so I can't be the first person to encounter this mess.

Unexpected token C in JSON at position 0

The lamda function was able to found the video when requested, but then crash into this issue: Any suggestions? Thank you!

2017-08-10T10:09:16.713Z	f6cdcd50-7db3-11e7-8359-5f9198326baa	SyntaxError: Unexpected token C in JSON at position 0
at Object.parse (native)
at Request._callback (/var/task/index.js:96:47)
at Request.self.callback (/var/task/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/var/task/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/var/task/node_modules/request/request.js:1091:12)
at IncomingMessage.g (events.js:292:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)

"Ask YouTube to..." issues

If I say "Ask YouTube to Pause" it works. If I ask Alexa to stop, that is the only way I can pause the music, but I can't resume it if I do so. Also, is there any way to skip songs? Or to play a different song than the one playing? Does this Skill work in the way that if you ask Alexa to play a song in the middle of playing another song, she is supposed to play it instantly, or is there a queue system?

Alexa won't recognize some words like 'ready' and 'pixel.

Hi, I noticed that if you ask Alexa to play a song that has the word 'ready' in it, it won't recognize the word and omit it from search. Here is an example below with what it searched and what I actually said to Alexa. (PS. This seems to affect more than just 'ready'. See images below.)
capture
capture

Problems with Install Step 6

Configuration page: under Endpoint, select AWS ...
What should I put in the blank after Default: ?
Error: Please select a default endpoint.

not working for me at all

when i test from skill:
echo, search YouTube for Frost Hyperventilate.
or
search YouTube for Frost Hyperventilate.
Frost Hyperventilate.
i get the same lamda response:
{
"version": "1.0",
"response": {
"speechletResponse": {
"directives": [],
"shouldEndSession": true
}
},
"sessionAttributes": {}
}
When i ask my echo directly:
echo, search YouTube for Frost Hyperventilate.
It just turns off the blue light
When I ask echo directly:
echo, ask YouTube to search for Frost Hyperventilate.'I get response im sorry i dont know what went wrong

Could not extract signature deciphering actions

Since few days, I have been getting the message on alexa as "there is a problem with the requested skills response". When I tried your web URL for your heroku server, and I search under "Youtube Search" , I see this error: "Could not extract signature deciphering actions". Any idea whats going on?

Doesn't play the audio

Set up everything as the instructions said so and everything seems to go through and the process returns the sound file but the echo does not play it it simply turns off.

Lambda invvocation error

START RequestId: ce61e347-8532-11e7-98d6-013b034f9a64 Version: $LATEST
Unable to import module 'index': Error
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

When I try to use the skill after following ur instructions i get the above error .

IT's Work but i'm waiting very long

I am waiting to alexa play music over 1 min, 2,3 min sometimes, is it normal for this skill, or you don't wait so long for loading ?

Some sugetistion what i can do for faster loading of song, i try with default dmhacker and with my own but its same problem.

AudioPlayer.PlaybackFailed not handled

When I try to run this, I get an error when trying to play back the media file. This is sent as a 'AudioPlayer.PlaybackFailed' request, which doesn't have the applicationid in the sessiondetails, and that causes the following error:

Unhandled exception: Cannot read property 'applicationId' of undefined.

I think the 'pre' function needs to handle that case as well, and the app should probably log errors if it receives them.

No response, no error

Have built and rebuilt this skill with no luck.

2017-08-20T19:05:37.402Z 8d0ddc6b-85da-11e7-856b-930b9b388846 Unhandled rejection Error: Invalid application
at Object.ensureErrorObject (/var/task/node_modules/bluebird/js/main/util.js:261:20)
at Promise._rejectCallback (/var/task/node_modules/bluebird/js/main/promise.js:472:22)
at Promise._settlePromiseFromHandler (/var/task/node_modules/bluebird/js/main/promise.js:516:17)
at Promise._settlePromiseAt (/var/task/node_modules/bluebird/js/main/promise.js:584:18)
at Promise._settlePromiseAtPostResolution (/var/task/node_modules/bluebird/js/main/promise.js:248:10)
at Async._drainQueue (/var/task/node_modules/bluebird/js/main/async.js:128:12)
at Async._drainQueues (/var/task/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues (/var/task/node_modules/bluebird/js/main/async.js:15:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)

I already have a role called "lambda_basic_execution"

When creating the skill, I get error that I already have lambda_basic_execution. I changed name to lambda_basic_execution2, but naturally the skill doesn't work. It takes my query but I get no response back.

Any suggestions? I'm assuming I created the first lambda_basic_execution when I created the google assistant skill.

Works perfectly for me.

Thanks it works for me. However, the minor issue I face is that I have to repeat 2 times wherever I ask youtube for a new song. I believe this is due to the conversion of the clip to audio. Subsequent play of the song works flawlessly. Thanks.

Alexa Recognizes but doesn't answer

Hello, I did everything as in the Setup and in my History, Alexa seems to answer me, but she doesn't say anything and no Video is playing.

Skill incredibly slow

On average it takes about a minute for the audio to play, which makes the skill barely usable.
I followed this Tutorial, in which it takes a few seconds for the echo to play the audio. My bandwidth is about 10 mbit/s over wifi.

Not working

when testing I got the message:
The remote endpoint could not be called, or the response it returned was invalid.

By testing in Lambda AWS I got the execution results:

Response:
{
"errorMessage": "RequestId: dfea431a-0ea3-11e8-9b39-57237427abcd Process exited before completing request"
}

Request ID:
"dfea431a-0ea3-11e8-9b39-57237427abcd"

Function Logs:
START RequestId: dfea431a-0ea3-11e8-9b39-57237427abcd Version: $LATEST
2018-02-10T20:49:23.567Z dfea431a-0ea3-11e8-9b39-57237427abcd Searching ... cro
2018-02-10T20:49:24.384Z dfea431a-0ea3-11e8-9b39-57237427abcd SyntaxError: Unexpected token <
at Object.parse (native)
at Request._callback (/var/task/index.js:103:29)
at Request.self.callback (/var/task/node_modules/request/request.js:188:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (/var/task/node_modules/request/request.js:1171:10)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at IncomingMessage. (/var/task/node_modules/request/request.js:1091:12)
at IncomingMessage.g (events.js:260:16)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:437:9)
at process._tickDomainCallback (node.js:392:17)
END RequestId: dfea431a-0ea3-11e8-9b39-57237427abcd
REPORT RequestId: dfea431a-0ea3-11e8-9b39-57237427abcd Duration: 1002.18 ms Billed Duration: 1100 ms Memory Size: 128 MB Max Memory Used: 45 MB
RequestId: dfea431a-0ea3-11e8-9b39-57237427abcd Process exited before completing request

Unsupported Directive

Using the utterance : "Alexa ask youtube play ...."
Error in testing:
Unsupported Directive
AudioPlayer is currently an unsupported namespace. Check the device log for more information.

Unsupported Directive

I couldn't find any linked video skills

Hey, Please help me with this error.
I receive this error when i try to play youtube music. I followed exactly your steps and all was setup succesfully.
Now when i am trying to play a melody it says: I couldn't find any linked video skills that can find that.
Can you help me please? Thanks. Also what is the command to play a melody?

There was a problem with the requestet skill / Bei der Antwort des angeforderten Skill ist ein Problem aufgetreten

Hello dmhacker,
first, thanks a lot for this great skill - unfortunately it did not will work.
I set all as you described here: https://imgur.com/a/H5R7L
but everytime i asked: "alexa frage youtube" i got the response
"bei der Antwort des Skills ist ein Problem aufgetreten"
in english: there was a problem with the requestet skill.

in developer.amazon.com everythins should be right, because at the Test Page i got an response to my Alexa.
I think the problem is in lambda, because when i tried to upload the .zip file i´ve got a message:
index.js not found.
I tried the zip- file from here:
https://github.com/dmhacker/alexa-youtube-skill/releases/latest

alexa.amazon.de response:

Skill response was marked as failure
YouTube Playback
Request Identifier: amzn1.echo-api.request.43cc7108-aa2c-448b-92c8-01bbc028c5e5
The target Lambda application returned a failure response
Sprachfeedback
Alexa hat Folgendes gehört: „alexa frage youtube“

So where can i search for my fault?
Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.