[PLUGIN] YouTube2

i dont know if i ve done something wrong. once a while i m finding the google account not logged in on the verification url step. do you know why?

Sorry, I’ve been quite busy recently. Are you still having this problem?

yeah actually after i reboot the device sometimes i have to re do the verification…

Hey, I tried using this plugin on a Raspberry 3 B+ and 4, with Volumio 2.882 (with updated MPD) and Beta 3.015. I managed to install it and do find YouTube videos and playlists when using the search function, but whenever I try to play them (doesn’t matter which video/song) nothing happens.

Jun 24 12:24:56 beta volumio[738]: info: [youtube2-play] clearAddPlayTrack: youtube2/video@videoId=j1wgaFJ0750
Jun 24 12:24:57 beta volumio[738]: error: [youtube2-play] clearAddPlayTrack() error
Jun 24 12:24:57 beta volumio[738]: error: Status code: 404 {“statusCode”:404}

I’m using the headphone jack of the Pi, no DAC. Tried both scraping and API. Everything else (webradio, Tidal, Spotify, my local music library) works.

Any help would be appreciated. Let me know what other info/logs you need.

both youtube cast and youtube 2 plugin are broken. waiting to hear from @patrickkfkan

YouTube has changed their API again… The YouTube2 and YouTube Cast Receiver plugins utilise the awesome ytdl-core library for some parts of data retrieval, and I believe a fix is underway for that library. When that happens, I’ll update said plugins to use the updated version of ytdl-core.

Having said that, I would still need to implement a workaround to make sure the updated ytdl-core library will work with Volumio 2.x, because even the current version of that library has dropped support for the legacy Node 8 which Volumio 2.x still uses. This is going to take a bit of time and unfortunately, I don’t have much time on my hands recently. I’ll get to this ASAP.

Thx Patrick for informing!
I’m looking forward to the next update and hope it does not take too long!
But however, take your time, Regards Axel

I got it working on my Volumio v3 by updating the ytdl-core with the latest youtube2 git pull

login via ssh

username: volumio
password: volumio

volumio:~$ cd ~/youtube2-plugin/volumio-youtube2/node_modules
volumio:~/youtube2-plugin/volumio-youtube2/node_modules$ rm -rf ytdl-core
volumio:~/youtube2-plugin/volumio-youtube2/node_modules$ git clone https://github.com/fent/node-ytdl-core.git ytdl-core

volumio:~/youtube2-plugin/volumio-youtube2/node_modules$ cd …
volumio:~/youtube2-plugin/volumio-youtube2$ volumio plugin update

ytdl-core has been quick to push the fix (I see it was updated 6 hours ago). I’ll adapt this to the plugin if I have time tonight.

Your procedure will work with Volumio 3, but I think it will generate a different kind of error with Volumio 2.x due to Node version incompatibility.

Thanks for still taking care of v2

Br
Josef

1 Like

Thank you so much for the work done!

OK, I have updated the plugin that should now work on both Volumio 2 and 3. Please update it through the instructions on the Github page and report any issues. If you were using Google API as the data retrieval method, then you would have to re-grant access (this should not be necessary for future updates).

3 Likes

Volumio Version 2.882
After updating the youtube2 version strangely only the 1st song in the playlist was playing.
Uninstall & re-install still didn’t work for me.

Hence wanted to clear all youtube2 files & do fresh install since uninstall doesn’t remove all of them. Tried removing /volumio-youtube2 directory but was showing files as write protected. Used the following command to delete the folder & contents.

rm -r -f *

Fresh installed again. Works fine after going through the installation process. Occasionally while playing it does get stuck playing the playlist. Have to press the > button to skip for next song.
Thanks Patrick for the awesome work on this Youtube2 plugin! Much better than the first plugin.

@penjoseph , when you say playback getting stuck in the playlist, does this always occur for a particular track or is it just random? Do you get any error messages in the logs? If this is a public playlist, could you give me the link to it so I can test too?

1 Like

Need to observe whether its at the same song its getting stuck. Give me few days time to check.

Sure, take your time. I’m just thinking if it’s a particular type of track that’s causing the hiccup, I can see what can be done about it.

Hi, I’ve updated according to the instructions on GitHub (see below). But however, it still does not play music. I.e. if I click on a track the message “Play. Started playback …” appears, but it does not play and also the > button does not toggle. Also after a reboot it’s still the same. I use scraping as method.

I would be pleased to get a hint. Thx and best regards Axel

volumio@volumio:~$ cd ~/youtube2-plugin/volumio-youtube2/
volumio@volumio:~/youtube2-plugin/volumio-youtube2$ git pull
remote: Enumerating objects: 92, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 53 (delta 33), reused 53 (delta 33), pack-reused 0
Unpacking objects: 100% (53/53), done.
From https://github.com/patrickkfkan/volumio-youtube2
   29f9fa9..d4b0c15  master     -> origin/master
Updating 29f9fa9..d4b0c15
Fast-forward
 README.md                                          |   4 +
 lib/core/gapi/auth.js                              |  56 +---
 lib/youtube2.js                                    |  10 +-
 node_modules/m3u8stream/dist/dash-mpd-parser.js    |  22 +-
 .../m3u8stream/dist/dash-mpd-parser.js.map         |   2 +-
 node_modules/m3u8stream/dist/index.d.ts            |   4 +-
 node_modules/m3u8stream/dist/index.js              |  33 +--
 node_modules/m3u8stream/dist/index.js.map          |   2 +-
 node_modules/m3u8stream/dist/m3u8-parser.d.ts      |   9 +-
 node_modules/m3u8stream/dist/m3u8-parser.js        |   2 +-
 node_modules/m3u8stream/dist/m3u8-parser.js.map    |   2 +-
 node_modules/m3u8stream/dist/parse-time.d.ts       |  11 +
 node_modules/m3u8stream/dist/parse-time.js         |  26 +-
 node_modules/m3u8stream/dist/parse-time.js.map     |   2 +-
 node_modules/m3u8stream/dist/queue.d.ts            |  28 +-
 node_modules/m3u8stream/dist/queue.js              |  14 +-
 node_modules/m3u8stream/dist/queue.js.map          |   2 +-
 node_modules/m3u8stream/package.json               |  31 ++-
 node_modules/ytdl-core/README.md                   |  25 +-
 node_modules/ytdl-core/lib/format-utils.js         |  28 +-
 node_modules/ytdl-core/lib/index.js                |   1 +
 node_modules/ytdl-core/lib/info-extras.js          | 230 ++++++++++++-----
 node_modules/ytdl-core/lib/info.js                 |  73 +++---
 node_modules/ytdl-core/lib/sig.js                  |  22 +-
 node_modules/ytdl-core/lib/url-utils.js            |  14 +-
 node_modules/ytdl-core/lib/utils.js                |  29 ++-
 .../ytdl-core/node_modules/miniget/LICENSE         |  21 ++
 .../ytdl-core/node_modules/miniget/README.md       | 111 ++++++++
 .../ytdl-core/node_modules/miniget/dist/index.d.ts |  66 +++++
 .../ytdl-core/node_modules/miniget/dist/index.js   | 286 +++++++++++++++++++++
 .../node_modules/miniget/dist/index.js.map         |   1 +
 .../ytdl-core/node_modules/miniget/package.json    | 112 ++++++++
 node_modules/ytdl-core/package.json                |  70 +++--
 node_modules/ytdl-core/typings/index.d.ts          |  54 +++-
 package.json                                       |   4 +-
 storage/access_token                               |   0
 36 files changed, 1107 insertions(+), 300 deletions(-)
 create mode 100644 node_modules/ytdl-core/node_modules/miniget/LICENSE
 create mode 100644 node_modules/ytdl-core/node_modules/miniget/README.md
 create mode 100644 node_modules/ytdl-core/node_modules/miniget/dist/index.d.ts
 create mode 100644 node_modules/ytdl-core/node_modules/miniget/dist/index.js
 create mode 100644 node_modules/ytdl-core/node_modules/miniget/dist/index.js.ma                                                                             p
 create mode 100644 node_modules/ytdl-core/node_modules/miniget/package.json
 delete mode 100644 storage/access_token
volumio@volumio:~/youtube2-plugin/volumio-youtube2$ sudo systemctl restart volumio

OS info

Version of Volumio: 2.906
Hostname: volumio
Kernel: 4.19.118-v7+
Governor: performance
Uptime: 0 days, 0 Hrs, 12 Minutes, 44 Seconds

Audio info

Hw audio configured: Allo Piano 2.1
Mixer type: Hardware
Number of channels: 2
Supported sample rate: 44100 48000 88200 96000 176400 192000

Board info

Manufacturer: Raspberry Pi Foundation
Model: BCM2835 - Pi 3 Model B
Version: a02082 - Rev. 1.2
Firmware Version: Apr 27 2020 14:35:17 - 3a8f1793b758d6fb7f375edaa260e069ecd34c88

i’m missing volumio plugin update in your install did you do it?

Thx dvo! I have indeed forgotten this command. Now it works :slight_smile:

i was happy that you post your steps otherwise i could not see this…
and happy that it works :slight_smile: