[PLUGIN] YouTube2

This plugin works perfectly on the X86 debian buster image.

Hi Guys…
I am having the 3/4 issue with youtube2 plugin…
I am running volumio version 2.861 on raspberry pi 3B
the plugin works ( also using API keys ) but indeed it stops all songs at 3/4
I have tried to update the mpd version as discribed here ( MPD 0.21.16 for Volumio (arm, armv7 and x86) ) but for some reason this version is not accepted ( wont start.
I have tried both versions arm and armv7…
So now i am stuck a litle and see no solutions atm for me…
Can someone maybe help me out with this ?

Kind regards Osdieman

@Osdieman, run these commands in SSH:

$ systemctl status mpd

$ ls /opt/mpd*

What do you see?

systemctl status mpd gives
volumio@volumio-main:~$ systemctl status mpd
● mpd.service - Music Player Daemon
Loaded: loaded (/lib/systemd/system/mpd.service; enabled)
Active: active (running) since Wed 2020-12-30 11:11:55 UTC; 45min ago
Docs: man:mpd(1)
man:mpd.conf(5)
Main PID: 684 (mpd)
CGroup: /system.slice/mpd.service
└─684 /usr/bin/mpd --no-daemon

Dec 30 11:11:55 volumio-main systemd[1]: Started Music Player Daemon.

ls /opt/mpd* gives
volumio@volumio-main:~$ ls /opt/mpd*
ls: cannot access /opt/mpd*: No such file or directory

volumio@volumio-main:~/opt/mpd-0.21.16_20191227/bin$ ls gives
mpd systemd-switch-mpd.sh

Where i have used the Pi version ( mpd-0.21.16.arm-20191228-3v3jy.tar.gz )
Also tried the armv7 version with same result…))

You extracted the contents of the mpd archive to your home directory.

What you need to do is unpack it into the root directory:

$ cd /
$ sudo tar xzf <path to mpd archive>
$ cd /opt/mpd-0.21.16_20191227/bin
$ ./mpd --version
// Check output does not contain errors, then activate
$ sudo ./systemd-switch-mpd.sh

I think you left out the important cd / right at the beginning.

1 Like

aaaah that could be indeed… let me try once more hehehe… )))

I can confirm it works now… super thanks Patrick…!!! happy new year and listening all… and thank you all for this unbelievable great work…!!!

i finally have everything working as i have planned
Volumio with : youtube => spotify => Tidal => local files and all served to 4 other rooms with snapcast… Wonderfull…!!!

Regards Osdieman

That’s just awesome! Happy new year too (and everyone here~)

2 Likes

Hi Patrickkfkan,

Happy new year.
Works perfectly on v3.010.

BR
Josef

I just had to come back to give big thanks to @patrickkfkan, @dvo and everyone else involved in this project and Volumio overall. I appreciate all the effort, work and support you all give. The new Youtube plugin has become the plugin I’ve been using the most. I’m really happy with the new features of Autoplay, and customized “Front Page Sections”.

Like the comment above, having Volumio with these plugins together with snapcast for multiroom capabilities… Awesome Stuff!!!

Thank you the great Xmas present. :slight_smile:

I think I find a problem. If I play playlist from Youtube plugin, sometimes I got an error: “443 Connection refused” and then stop the playing of the other sounds.

RPI image the latest (beta): Raspberry Pi Volumio-3.015-2021-01-03-pi
Youtube plugin is the latest too.

Everything is working fine, but sometimes i got that strange error.
Am I doing something wrong?
Thank you.

Logs:

– Logs begin at Thu 2019-02-14 11:12:01 CET. –
Jan 06 14:14:47 nappali volumio[767]: info: CoreCommandRouter::volumioGetState
Jan 06 14:14:47 nappali volumio[767]: info: Listing playlists
Jan 06 14:14:47 nappali volumio[767]: info: Listing playlists
Jan 06 14:14:57 nappali volumio[767]: info: CoreCommandRouter::volumioGetState
Jan 06 14:14:59 nappali sudo[17964]: pam_unix(sudo:session): session closed for user root
Jan 06 14:15:07 nappali volumio[767]: info: CoreCommandRouter::volumioGetState
Jan 06 14:15:07 nappali volumio[767]: info: Listing playlists
Jan 06 14:15:07 nappali volumio[767]: info: Listing playlists
Jan 06 14:15:11 nappali sudo[17972]: volumio : TTY=pts/0 ; PWD=/home/volumio ; USER=root ; COMMAND=/bin/journalctf
Jan 06 14:15:11 nappali sudo[17972]: pam_unix(sudo:session): session opened for user root by volumio(uid=0)
Jan 06 14:15:16 nappali volumio[767]: info: CoreCommandRouter::volumioPlay
Jan 06 14:15:16 nappali volumio[767]: UNSET VOLATILE
Jan 06 14:15:16 nappali volumio[767]: info: CoreStateMachine::play index undefined
Jan 06 14:15:16 nappali volumio[767]: info: CoreStateMachine::setConsumeUpdateService undefined
Jan 06 14:15:16 nappali volumio[767]: info: CorePlayQueue::getTrack 11
Jan 06 14:15:16 nappali volumio[767]: info: CoreStateMachine::startPlaybackTimer
Jan 06 14:15:16 nappali volumio[767]: info: CorePlayQueue::getTrack 11
Jan 06 14:15:16 nappali volumio[767]: info: [youtube2-play] clearAddPlayTrack: youtube2/video@videoId=gmrBzlbSQxg
Jan 06 14:15:17 nappali volumio[767]: info: CoreCommandRouter::volumioGetState
Jan 06 14:15:17 nappali volumio[767]: info: CorePlayQueue::getTrack 11
Jan 06 14:15:19 nappali volumio[767]: info: CorePlayQueue::getTrack 11
Jan 06 14:15:19 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand stop
Jan 06 14:15:19 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand clear
Jan 06 14:15:19 nappali volumio[767]: info:
Jan 06 14:15:19 nappali volumio[767]: ---------------------------- MPD announces system playlist update
Jan 06 14:15:19 nappali volumio[767]: info: Ignoring MPD Status Update
Jan 06 14:15:19 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand load “https://r1---sn-qpbpu8-c0qs.goovideo.com/videoplayback?expire=1609960516&ei=5Lf1X4-tNdGEmLAP-v2D8As&ip=77.234.76.252&id=o-ADz1WR3kfCVfDyx3zdCZL19S8nJwg2uAU86xk0Rpf&itag=251&source=youtube&requiressl=yes&mh=1M&mm=31%2C29&mn=sn-qpbpu8-c0qs%2Csn-c0q7lns7&ms=au%2u&mv=m&mvi=1&pl=22&gcr=hu&initcwndbps=1630000&vprv=1&mime=audio%2Fwebm&ns=c6tBOovsv_LDoEB2YeVfLh8F&gir=yes&clen=3976&dur=239.221&lmt=1598103237093540&mt=1609938522&fvip=1&keepalive=yes&c=WEB&txp=5531432&n=6ues0JYsbRPaLRA-&sparamxpire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2C2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAPmK_GQ8h5uJ-Q41WS71jbczTn7GbU63OE35DRUWkXmjAiEA-KFfNXsmb4Cq9ZytKxm6o1mZ6lWpumnKXPMgUmh0%3D&ratebypass=yes&sig=AOq0QJ8wRgIhAKQz7nAR1lEvHV8L8C1UcihTDdYw-2tDPtuYTahpQhxHAiEAwqCUJDtYDIGnkIQ0tDgQ13wX67NgyqMb3CA1yipI%3D
Jan 06 14:15:19 nappali volumio[767]: error: updateQueue error: null
Jan 06 14:15:19 nappali volumio[767]: info: ------------------------------ 3ms
Jan 06 14:15:20 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand addid “https://r1---sn-qpbpu8-c0qs.goevideo.com/videoplayback?expire=1609960516&ei=5Lf1X4-tNdGEmLAP-v2D8As&ip=77.234.76.252&id=o-ADz1WR3kfCVfDyx3zdCZL1lS8nJwg2uAU86xk0Rpf&itag=251&source=youtube&requiressl=yes&mh=1M&mm=31%2C29&mn=sn-qpbpu8-c0qs%2Csn-c0q7lns7&ms=au%du&mv=m&mvi=1&pl=22&gcr=hu&initcwndbps=1630000&vprv=1&mime=audio%2Fwebm&ns=c6tBOovsv_LDoEB2YeVfLh8F&gir=yes&clen=3076&dur=239.221&lmt=1598103237093540&mt=1609938522&fvip=1&keepalive=yes&c=WEB&txp=5531432&n=6ues0JYsbRPaLRA-&sparaexpire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAPmK_GQ8h5uJ-Q41WS71jbczTn7GbU63OE35DRUWkXmjAiEA-KFfNXsm34Cq9ZytKxm6o1mZ6lWpumnKXPMgUmh0%3D&ratebypass=yes&sig=AOq0QJ8wRgIhAKQz7nAR1lEvHV8L8C1UcihTDdYw-2tDPtuYTahpQhxHAiEywqCUJDtYDIGnkIQ0tDgQ13wX67NgyqMb3CA1yipI%3D
Jan 06 14:15:20 nappali volumio[767]: info:
Jan 06 14:15:20 nappali volumio[767]: ---------------------------- MPD announces system playlist update
Jan 06 14:15:20 nappali volumio[767]: info: Ignoring MPD Status Update
Jan 06 14:15:20 nappali volumio[767]: verbose: MPD COMMAND [object Object]
Jan 06 14:15:20 nappali volumio[767]: verbose: MPD COMMAND [object Object]
Jan 06 14:15:20 nappali volumio[767]: info:
Jan 06 14:15:20 nappali volumio[767]: ---------------------------- MPD announces system playlist update
Jan 06 14:15:20 nappali volumio[767]: info: Ignoring MPD Status Update
Jan 06 14:15:20 nappali volumio[767]: info: ------------------------------ 4ms
Jan 06 14:15:20 nappali volumio[767]: info: CoreStateMachine::setConsumeUpdateService mpd
Jan 06 14:15:20 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand play
Jan 06 14:15:20 nappali volumio[767]: info: ------------------------------ 4ms
Jan 06 14:15:20 nappali volumio[767]: info:
Jan 06 14:15:20 nappali volumio[767]: ---------------------------- MPD announces state update: player
Jan 06 14:15:20 nappali volumio[767]: info: ControllerMpd::getState
Jan 06 14:15:20 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand status
Jan 06 14:15:20 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand clearerror
Jan 06 14:15:20 nappali volumio[767]: verbose: ControllerMpd::parseState
Jan 06 14:15:20 nappali volumio[767]: verbose: ControllerMpd::sendMpdCommand playlistinfo
Jan 06 14:15:20 nappali volumio[767]: verbose: ControllerMpd::parseTrackInfo
Jan 06 14:15:20 nappali volumio[767]: info: ControllerMpd::pushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreCommandRouter::servicePushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreStateMachine::pushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreCommandRouter::volumioPushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Jan 06 14:15:20 nappali volumio[767]: info: CorePlayQueue::getTrack 11
Jan 06 14:15:20 nappali volumio[767]: verbose: STATE SERVICE {“status”:“stop”,“position”:0,“seek”:null,“duration”:l,“samplerate”:null,“bitdepth”:null,“channels”:null,“random”:false,“updatedb”:false,“repeat”:false,“bitrate”:null,Streaming":false,“title”:“Takagi & Ketra, Elodie, Mariah - Ciclone ft. Gipsy Kings, Nicolás Reyes, Tonino Baliardoartist”:“Takagi & Ketra”,“album”:“YouTube Video”,“uri”:“https://r1---sn-qpbpu8-c0qs.googlevideo.com/videoplayback?ire=1609960516&ei=5Lf1X4-tNdGEmLAP-v2D8As&ip=77.234.76.252&id=o-ADz1WR3kfCVfDyx3zdCZL19j1lS8nJwg2uAU86xk0Rpf&itag=&source=youtube&requiressl=yes&mh=1M&mm=31%2C29&mn=sn-qpbpu8-c0qs%2Csn-c0q7lns7&ms=au%2Crdu&mv=m&mvi=1&pl=22&gcr=hnitcwndbps=1630000&vprv=1&mime=audio%2Fwebm&ns=c6tBOovsv_LDoEB2YeVfLh8F&gir=yes&clen=3902076&dur=239.221&lmt=1598137093540&mt=1609938522&fvip=1&keepalive=yes&c=WEB&txp=5531432&n=6ues0JYsbRPaLRA-&sparams=expire%2Cei%2Cip%2Cid%2Ci%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2CpCinitcwndbps&lsig=AG3C_xAwRgIhAPmK_GQ8h5uJ-Q41WS71jbczTn7GbU63OE35DRUWkXmjAiEA-KFfNXsmbKU34Cq9ZytKxm6o1mZ6lWpumnKXUmh0%3D&ratebypass=yes&sig=AOq0QJ8wRgIhAKQz7nAR1lEvHV8L8C1UcihTDdYw-2tDPtuYTahpQhxHAiEA62ywqCUJDtYDIGnkIQ0tDgQ13wXgyqMb3CA1yipI%3D",“trackType”:"”}
Jan 06 14:15:20 nappali volumio[767]: verbose: CURRENT POSITION 11
Jan 06 14:15:20 nappali volumio[767]: info: CoreStateMachine::syncState stateService stop
Jan 06 14:15:20 nappali volumio[767]: info: CoreStateMachine::syncState currentStatus stop
Jan 06 14:15:20 nappali volumio[767]: info: CoreStateMachine::pushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreCommandRouter::volumioPushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Jan 06 14:15:20 nappali volumio[767]: info: No code
Jan 06 14:15:20 nappali volumio[767]: info: CoreStateMachine::pushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreCommandRouter::volumioPushState
Jan 06 14:15:20 nappali volumio[767]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Jan 06 14:15:20 nappali volumio[767]: info: ------------------------------ 21ms
Jan 06 14:15:27 nappali volumio[767]: info: CoreCommandRouter::volumioGetState
Jan 06 14:15:27 nappali volumio[767]: info: Listing playlists
Jan 06 14:15:27 nappali volumio[767]: info: Listing playlists

Screenshot:

Hi @chipman,

  1. Does this error occur only with playlists, and are they playlists you created in Volumio (as opposed to those that you create or find on YouTube)?

  2. Does it happen randomly, or only with certain tracks? If you click on the track again (in the queue), does it play?

  3. How many items are there in the playlist?

A 443 Connection Refused error means that the YouTube server is rejecting the request. This can be difficult to diagnose because YouTube is unlikely to return more info regarding this type of error. If this is reproducible under certain conditions, then it may be easier to pinpoint the cause of the problem.

-Patrick

Dear @Patrick,

That was a Youtube playlist (Italy Top Songs 2021 - Best Italian Music 2021) what contains 60 videos.

It stopped at the 12th song (Takagi & Ketra, Elodie, Mariah…) and if I tried to restart that song I got again the 443: Connection refused error. Then I empried the queue and added that playlist again and I got that 443 error again. Bingo!

I tried to reproduce the error with other Youtube (children songs) playlists (Legismertebb óvodásdalok) with 75 videos. It play the first three songs, then stopped. I tried to start manually the 4th (Most érkeztünk ez helyre) song and I got again the 443 error.
And then I deleted the queue and added again that playlist from Youtube. And the 4th song made the error again. Second Bingo!

Maybe we got it?

PS: I tried that tests with the Youtube plugin Scraping and Youtube API config mode too with the same result.

Thanks.
chipman

I have just tried playing the 12th song from “Italy Top Songs 2021…” and 4th song from “Legismertebb…”. They play well.

I am wondering if there’s a bug in Curl on Debian Buster that somehow handled the audio URL wrongly and sent an invalid request to YouTube (which would of course reject it).

If you can, could you try using the MPD I have here ? Follow the instructions there to activate it and see if the error persists. This MPD is the one I am using on my Volumio 2.853.

I am unable to try Volumio 3.015 at the moment but I will do that when I have time.

-Patrick

Dear Patrick,

I installed a version 2.853, updated the MPD on it, and then installed the Youtube plugin, which works properly, except for the two playlists (there may be more), where it stops with the same music with the 443 Connection refused error.

If it works well for you, there may be a problem with my settings, but I tried to set the Youtube plugin to other countries, but it didn’t play the problem song anyway.

Maybe there a router or ISP side problem?
Does anyone else have such as?

Thanks.
chipman

Could you try running a curl command in SSH and see if it shows more information about the error:

$ curl -sIXGET "<Audio URL>"

Audio URL is the one which gets sent by the plugin to MPD. In the logs you’ve shown previously, this would be the value shown in bold below:


STATE SERVICE {“status”:“stop”,“position”:0,“seek”:null,“duration”:l,“samplerate”:null,“bitdepth”:null,“channels”:null,“random”:false,“updatedb”:false,“repeat”:false,“bitrate”:null,Streaming":false,“title”:“Takagi & Ketra, Elodie, Mariah - Ciclone ft. Gipsy Kings, Nicolás Reyes, Tonino Baliardoartist”:“Takagi & Ketra”,“album”:“YouTube Video”,“uri”:“https://r1---sn-qpbpu8-c0qs.googlevideo.com/videoplayback?ire=1609960516&ei=5Lf1X4-tNdGEmLAP-v2D8As&ip=77.234.76.252&id=o-ADz1WR3kfCVfDyx3zdCZL19j1lS8nJwg2uAU86xk0Rpf&itag=&source=youtube&requiressl=yes&mh=1M&mm=31%2C29&mn=sn-qpbpu8-c0qs%2Csn-c0q7lns7&ms=au%2Crdu&mv=m&mvi=1&pl=22&gcr=hnitcwndbps=1630000&vprv=1&mime=audio%2Fwebm&ns=c6tBOovsv_LDoEB2YeVfLh8F&gir=yes&clen=3902076&dur=239.221&lmt=1598137093540&mt=1609938522&fvip=1&keepalive=yes&c=WEB&txp=5531432&n=6ues0JYsbRPaLRA-&sparams=expire%2Cei%2Cip%2Cid%2Ci%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2CpCinitcwndbps&lsig=AG3C_xAwRgIhAPmK_GQ8h5uJ-Q41WS71jbczTn7GbU63OE35DRUWkXmjAiEA-KFfNXsmbKU34Cq9ZytKxm6o1mZ6lWpumnKXUmh0%3D&ratebypass=yes&sig=AOq0QJ8wRgIhAKQz7nAR1lEvHV8L8C1UcihTDdYw-2tDPtuYTahpQhxHAiEA62ywqCUJDtYDIGnkIQ0tDgQ13wXgyqMb3CA1yipI%3D",“trackType”:"”}

I suggest you play the problematic track in Volumio and get the up-to-date value from the logs. I would not be able to test the Audio URL obtained from your logs because it’s specific to your IP address and session.

On my side, here’s what I get:

HTTP/1.1 200 OK
Last-Modified: Thu, 08 Jun 2017 10:03:11 GMT
Content-Type: audio/webm
Date: Thu, 07 Jan 2021 11:10:01 GMT
Expires: Thu, 07 Jan 2021 11:10:01 GMT
Cache-Control: private, max-age=21187
Accept-Ranges: bytes
Content-Length: 1711889
Connection: keep-alive
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v=“46,43”
Vary: Origin
Cross-Origin-Resource-Policy: cross-origin
X-Content-Type-Options: nosniff
Server: gvs 1.0

Remember to put the URL in double quotes.

Absolutely nothing. :frowning:
No output.

But if I check a working URL, I got response too:

HTTP/1.1 200 OK
Last-Modified: Tue, 03 Nov 2020 13:06:50 GMT
Content-Type: audio/webm
Date: Thu, 07 Jan 2021 12:00:49 GMT
Expires: Thu, 07 Jan 2021 12:00:49 GMT
Cache-Control: private, max-age=21235
Accept-Ranges: bytes
Content-Length: 2731425
Connection: keep-alive
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v=“46,43”
Vary: Origin
Cross-Origin-Resource-Policy: cross-origin
X-Content-Type-Options: nosniff
Server: gvs 1.0

I also checked from my friend’s network, there was no problem.
So this will be a network issue. I will continue to investigate in this direction.

Thank you for your great support and your work!

This curl command should give you more info (hopefully):

$ curl -Iiv "<Audio URL>"

Hope you get this working in the end…

That more detailed error message helped:

  • Hostname was NOT found in DNS cache
  • Trying 0.0.0.0…
  • connect to 0.0.0.0 port 443 failed: Connection refused
  • Trying ::…
  • Immediate connect fail for ::: Cannot assign requested address
  • Failed to connect to r3---sn-qpbpu8-c0ql.googlevideo.com port 443: Connection refused
  • Closing connection 0
    curl: (7) Failed to connect to r3---sn-qpbpu8-c0ql.googlevideo.com port 443: Connection refused

The AdGuard Home block that host and drop the connections. I enabled the entire googlevideo.com domain and both playlist working well.

Thanks again for your help, Patrick!

Good to know that it’s working now!

Installed the plugin on Volumio 2.861 and updated mpd on a raspberry pi 3b. Everything is working perfectly.
Thanks @patrickkfkan!