[PLUGIN] YouTube for Volumio

Hi,

Forget my last post, i made some stupid mistakes. At the moment i’ve installed your latest uptdate, whent true all the steps creating credentials and inserted them in the plugin settings. Unfortunately i don’t see anything changing in the account acces, no code will appear. Am i still missing something?

So what do you see under Account Access? If you don’t see the code refresh after entering your credentials, you can click Back and then enter the plugin settings again. You should see the new code there.

Don’t know why but it just keeps saying: “Code not yet available. Please come back later.” I made the credentials this morning, is there like a period of time before they become active? or should it work right away?

The credentials become active right away. When the plugin starts, it contacts Google’s authentication server to obtain the Code if access to YouTube has not been granted. If you get “Code not yet available. Please come back later”, the reason is likely to be one of the following two:

  1. Request has not been made to Google’s auth server
  2. Request made, but no response received

Reason 1 is highly unlikely, given the plugin can been started successfully. Reason 2 is more likely here. Could you check the logs and see if the plugin shows any errors?

Hi, since i am a total noob (bear with me), can you please explain to me how to check the logs? Thank you

You can view logs in the console by:

sudo journalctl -f

Try to spot any error when disabling / enabling the Youtube plugin, or accessing its settings.

I would also like to know two things:

  1. If you select “Use Default” for API in the plugin settings, do you see the code after clicking Save?
  2. If you use your own credentials, even with no Code, do you see anything when browsing YouTube? You should still see “Trending on YouTube” like the picture.
    trendingonyt.jpg

To answer your questions:

  1. No, it still says “code not yet available. Please come back later”
  2. No, i get an error “no results” and a blank page

I will try to acces the logs now.

What do you get when you run the following in your console (replace [API_KEY] with your API key)

curl \ 'https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&chart=mostPopular&videoCategoryId=10&key=[API_KEY]' \ --header 'Accept: application/json' \ --compressed

Patrick,

This is a fantastic looking plugin. But I have a problem. I can’t get it to make any sound!

I know my system is working: spotify connect and spotify both play correctly. I was able to install your plugin using your instructions and have been able to connect to youtube and retrieve my liked videos, subscriptions etc. So I am confident that the google API side of things is good too.

But when I try to play a track, even though I get the volumio notification, there is no sound. The play symbol stays at “arrow” and does not change to “pause”. And the track time counter stays at 0:01 secs.

Any idea what I am doing wrong?

CHarles

Can you check the log in the console with:

sudo journalctl -f

You should see lots of messages when you click on a YouTube video. Most is useless but you should be able to spot a URL like this:

https://r3---sn-i3b7knld.googlevideo.com/videoplayback?expire=1575257449&ei=CTHkXYeFG5GYs8IPkpWuoAw&ip=xx.xxx.xxx.xxx&id=o-AKQeJ4693z_rhd4ZNqbhFMvn5OVqT_rBJ_yK0gz9200k&itag=251&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-i3b7knld%2Csn-i3belne6&ms=au%2Crdu&mv=m&mvi=2&pl=23&gcr=hk&initcwndbps=1648750&mime=audio%2Fwebm&gir=yes&clen=4594653&dur=258.321&lmt=1574582675861977&mt=1575235815&fvip=3&keepalive=yes&fexp=23842630%2C23860863&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgXFfAlHBq378JGR7LRXABludGUQ3ct4UXtTv0I-r_NbACIQDQScn5OzrzeyxzKIuvN20z4UUADsLiGvuHQFFxW45Qpw%3D%3D&sig=ALgxI2wwRQIhAOCWwQivs8XwWZ0rApN-aWvjFmUEtihEXDZ63Cp1M1xWAiBFWPNTAt0LDB6nd_CgpwA92rSkvUV0h578D462FF4-ZQ==&ratebypass=yes

You can search for “googlevideo” in the terminal and get the link.

Now copy the full link and in the console:

> mpc clear
> mpc add "[paste the link here]"
> mpc play 1

Do you hear anything? If you don’t, then this is not a problem with the plugin and we would have to explore further…

Hi, i get this line:

curl: (3) [globbing] bad range in column 131 

Did you remove the square brackets around the API KEY?

I’m sorry, as i said total noob.

Now it says:

curl: (60) SSL certificate problem: certificate is not yet valid
more details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a 
problem with the certificate (it might be expired, or the name might 
not match the domain name in the URL).
If you'd like to turn off curl's verification of the cerificate, use
the -k (or --insecure) option. 

Could you check if the system date is accurate? Do this in the console:

> date

If it’s wrong, reconfigure your timezone, which should then resync the date:

> dpkg-reconfigure tzdata

Then retry with the curl command or just see if the code is fetched in the YouTube plugin settings.

Victory!! Works like charm now. Thanks a lot for helping me out. However i had to configure the date and time manualy with “sudo date -s”, for some reason time and date don’t reconfigure using “dpkg-reconfigure” or “sudo raspi-config”. Anyway, nice job helping me out!

Thanks Patrick,

I followed your instructions, posted a google link into the mpc command, and music comes out.

When I try playing from the volumio interface, I get (amongst other stuff) the following at the console log

Dec 02 17:03:15 volumio sudo[6221]: volumio : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ifconfig wlan0 Dec 02 17:03:15 volumio volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo Dec 02 17:03:15 volumio sudo[6221]: pam_unix(sudo:session): session opened for user root by (uid=0) Dec 02 17:03:15 volumio volumio[1255]: info: No code Dec 02 17:03:15 volumio volumio[1255]: info: CoreStateMachine::pushState Dec 02 17:03:15 volumio volumio[1255]: info: CoreStateMachine::getState Dec 02 17:03:15 volumio volumio[1255]: info: CorePlayQueue::getTrack 1 Dec 02 17:03:15 volumio sudo[6221]: pam_unix(sudo:session): session closed for user root Dec 02 17:03:15 volumio volumio[1255]: info: CoreCommandRouter::volumioPushState Dec 02 17:03:15 volumio volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo Dec 02 17:03:15 volumio sudo[6229]: volumio : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ifconfig wlan0 Dec 02 17:03:15 volumio sudo[6229]: pam_unix(sudo:session): session opened for user root by (uid=0) Dec 02 17:03:15 volumio sudo[6229]: pam_unix(sudo:session): session closed for user root Dec 02 17:03:15 volumio sudo[6237]: volumio : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ifconfig wlan0 Dec 02 17:03:15 volumio sudo[6237]: pam_unix(sudo:session): session opened for user root by (uid=0) Dec 02 17:03:15 volumio sudo[6237]: pam_unix(sudo:session): session closed for user root Dec 02 17:03:15 volumio volumio[1255]: error: Could not send mpd command: load "https://r5---sn-cxab5jvh-cg0ez.googlevideo.com/videoplayback?expire=1575327794&ei=0kPlXY34OPCsmLAPxr-toAQ&ip=109.133.151.108&id=o-AOF8XLO5wFLEDGR3R6izIRaqUj6sX2p-5TP0s4RTHj1g&itag=18&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-cxab5jvh-cg0ez%2Csn-5hnedn7z&ms=au%2Crdu&mv=m&mvi=4&pcm2cms=yes&pl=20&initcwndbps=1226250&mime=video%2Fmp4&gir=yes&clen=39110741&ratebypass=yes&dur=536.938&lmt=1490085495848904&mt=1575306102&fvip=5&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AHylml4wRAIgc0LT8PjUFXIv7D5J6tXXX2GXh1MgroJIqIY5ebKEdo0CIDFRYrQgVV3BNa6S5pk1ZqnHvKIQsAt17Ybn2hk8RCH0&sig=ALgxI2wwRgIhAM7JwwAVi9AJdHvFYTG5nI6zQCTJfhIw8nn5bOtGzvxKAiEAnOlAflwlW_HqP3uMh57R13ssHF790bep_07_7ccaBBE%3D" Dec 02 17:03:15 volumio volumio[1255]: info: ControllerMpd::sendMpdCommand play Dec 02 17:03:15 volumio volumio[1255]: info: sending command... Dec 02 17:03:15 volumio volumio[1255]: info: parsing response... Dec 02 17:03:15 volumio volumio[1255]: info: Youtube::After Play Dec 02 17:03:15 volumio volumio[1255]: info: ControllerMpd::getState Dec 02 17:03:15 volumio volumio[1255]: info: ControllerMpd::sendMpdCommand status Dec 02 17:03:15 volumio volumio[1255]: info: sending command... Dec 02 17:03:15 volumio volumio[1255]: info: parsing response... Dec 02 17:03:15 volumio volumio[1255]: info: ControllerMpd::parseState Dec 02 17:03:15 volumio volumio[1255]: info: Youtube: {"status":"stop","position":null,"seek":null,"duration":null,"samplerate":null,"bitdepth":null,"channels":null,"random":false,"updatedb":false,"repeat":false,"isStreaming":false,"title":null,"artist":null,"album":null,"uri":null,"trackType":"Fucking Youtube!!!!"} Dec 02 17:03:15 volumio volumio[1255]: info: CoreStateMachine::syncState Dec 02 17:03:15 volumio volumio[1255]: info: CoreStateMachine::pushState Dec 02 17:03:15 volumio volumio[1255]: info: CoreStateMachine::getState Dec 02 17:03:15 volumio volumio[1255]: info: CorePlayQueue::getTrack 1 Dec 02 17:03:15 volumio volumio[1255]: info: CoreCommandRouter::volumioPushState Dec 02 17:03:15 volumio volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo Dec 02 17:03:15 volumio volumio[1255]: info: CorePlayQueue::getTrack 1 Dec 02 17:03:15 volumio volumio[1255]: info: STATE SERVICE {"status":"stop","position":null,"seek":null,"duration":null,"samplerate":null,"bitdepth":null,"channels":null,"random":false,"updatedb":false,"repeat":false,"isStreaming":false,"title":null,"artist":null,"album":null,"uri":null,"trackType":"Fucking Youtube!!!!"}

Youtube clearly doesn’t like some of what it’s getting.

Appreciate you help on this, and on producing the plugin.

Charles

Thanks for this plugin. I have installed last version from 16.11. but still have 2/3 issue. Am I alone, or is there anybody else with the same problem?

Hi Charles,

Sorry about not replying sooner. I’m currently busy with something else. Will get back to this when I’m done.

Patrick

Hi Patrick,

Thanks for the holding reply. And thank you for working on this. It looks a great plugin.

All the best, Charles

Hi, I installed Youtube login and verified on 3th of Dec, it was work like charm. For some reason, I formatted and re-install Volumio > Youtube plugin, when I pasted the code to google.com/device, it’s say:
“Sign in with Google temporarily disabled for this app
This app has not been verified yet by Google in order to use Google Sign In”

I tried to search for solution it’s the answer almost “it’s cannot fix, it’s about developer’s site”

Does anyone experience this issue like me? Sorry for my bad English.