[PLUGIN] YouTube Music

Hi everyone,

YouTube Music plugin is available for testing in the beta channel of the plugin store. Supports optional login and access to your library. Go to the plugin settings to sign in.

The plugin uses a modified version of the YouTube.js library for content fetching and login. Credit goes to the developers of that library. If you like this plugin, consider sponsoring that project or giving it a star.

Plugin source

Modified YouTube.js source

Please report issues in this thread. Feedback is of course welcome.

Have fun!

-Patrick

7 Likes

Really nice functionality compared to the existing (also good) yt plugin. Great way to explore music based on my history & preferences, once logged in. Clear menus and fast to use. Thanks!

2 Likes

A really nice and useful plugin! Thanks for your hard work!

/Claes

1 Like

A great plugin.

My only problem appears to be that I cannot listen to the substantial music library I uploaded to YouTube Music (formally Google Music). I can see all my albums listed but when it comes to playing any of the albums I get “error no results”

Thanks for your work on this.

Steve (UK)

@Steve1 , are these items shown under ‘Uploads’ in your library? I can confirm that it currently doesn’t play privately owned, uploaded songs. Will see if I can provide a fix.

1 Like

Yes, that’s right. I have ripped my beloved CD collection accumulated over many years and uploaded it to YouTube Music (Formally Google Play Music) so I can access my library anytime and anywhere.

The plugin can see the uploaded albums including album art but when it comes playing an album I get “error no results”

Thanks for your work on this

Steve (UK)

Updated v0.1.2:

  • Add Autoplay (off by default; enable in plugin settings)
  • Fix browsing and playback of uploads

To update:

  1. Uninstall any previous version of YouTube Music plugin, followed by restarting Volumio (important).
  2. Go to plugin store, click Details button under “YouTube Music”, then “Install v0.1.2 (beta)”.

@Steve1 , could you please test if this version plays your uploaded albums?

2 Likes

Brilliant! - it works.

Thank you so much

Steve

OMG thank you so much. I was trying to do this about a year ago but didnt find the device registration and was only able to read about the api key which was really complicated. My first request for a feature, and I know its more than likely a google limitation on returned results a time but if playlists over 100 songs could have them all listed at once vs in chunks of 100. Again thank you. I have this since google music started and locked in to music and youtube prem. for 8usd/month. I haven’t wanted to pay for another music service.

I can add an option for that but think about the extra time needed to fetch all the results for a long playlist. Even if you have a fast network connection and processor, I would still have to throttle the requests made to YouTube Music to maybe around 3 per second, otherwise Google might think you’re spamming their servers and block you…

Updated v0.1.3:

  • Add ‘Load full playlists’ setting

To update:

  1. Uninstall any previous version of YouTube Music plugin, followed by restarting Volumio (important).
  2. Go to plugin store, click Details button under “YouTube Music”, then “Install v0.1.3 (beta)”.

@Mike_Lohmiller , here you go.

2 Likes

WOAH thank you. That turn around was incredible but at the same time if it would be a larger issue, I completely understand as well. I will try it and report back. Again thank you and impressive.

Updated v0.1.4:

  • Bug fixes with autoplay and browsing of artists in Library → Uploads
  • Add ‘Add to history’ plugin setting. If enabled (default), items are added to ytmusic history as they are played.

To update:

  • Uninstall any previous version of YouTube Music plugin, followed by restarting Volumio (important).
  • Go to plugin store, click Details button under “YouTube Music”, then “Install v0.1.4 (beta)”.

So far the plugin is great, thank you very much for that :laughing:. Unfortunately, some titles simply cannot be played. No idea what the reason is.

1 Like

Do you have the links to those titles that cannot be played?

1 Like

Those are two examples. However, there are many other titles.

I have no problems playing these two. Any error messages or could you PM me some logs?

Can anyone else try playing these two with the plugin? You can search the video IDs hBHZicPnMvA and eDPhsByCL_o to get to them quickly:

Sep 09 08:36:14 volumio volumio[836]:     at new Tab (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/classes/Tab.js:18:40)
Sep 09 08:36:14 volumio volumio[836]:     at Function.parseItem (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:274:32) {
Sep 09 08:36:14 volumio volumio[836]:   info: {
Sep 09 08:36:14 volumio volumio[836]:     primaryRenderer: { playlistPanelVideoRenderer: [Object] },
Sep 09 08:36:14 volumio volumio[836]:     counterpart: [ [Object] ]
Sep 09 08:36:14 volumio volumio[836]:   },
Sep 09 08:36:14 volumio volumio[836]:   date: 2022-09-09T08:36:14.007Z,
Sep 09 08:36:14 volumio volumio[836]:   version: '0.1.0-b.5'
Sep 09 08:36:14 volumio volumio[836]: }
Sep 09 08:36:14 volumio volumio[836]: error: [ytmusic-play] clearAddPlayTrack() error
Sep 09 08:36:14 volumio volumio[836]: error: Cannot read property 'item_type' of undefined
Sep 09 08:36:17 volumio volumio[836]: info: CoreCommandRouter::volumioGetState
Sep 09 08:36:17 volumio volumio[836]: info: CorePlayQueue::getTrack 37
Sep 09 08:36:27 volumio volumio[836]: info: CoreCommandRouter::volumioGetState
Sep 09 08:36:27 volumio volumio[836]: info: CorePlayQueue::getTrack 37
Sep 09 08:36:27 volumio volumio[836]: info: Listing playlists
Sep 09 08:36:27 volumio volumio[836]: info: Listing playlists
Sep 09 08:36:37 volumio volumio[836]: info: CoreCommandRouter::volumioGetState
Sep 09 08:36:37 volumio volumio[836]: info: CorePlayQueue::getTrack 37
Sep 09 08:36:47 volumio volumio[836]: info: CoreCommandRouter::volumioGetState
Sep 09 08:36:47 volumio volumio[836]: info: CorePlayQueue::getTrack 37
Sep 09 08:36:47 volumio volumio[836]: info: Listing playlists
Sep 09 08:36:47 volumio volumio[836]: info: Listing playlists
Sep 09 08:36:57 volumio volumio[836]: info: CoreCommandRouter::volumioGetState
Sep 09 08:36:57 volumio volumio[836]: info: CorePlayQueue::getTrack 37

Here is the output of journalctl when I click on the song.

What’s above this:

Further up please.

Sep 09 09:06:32 volumio volumio[837]: info: [ytmusic-play] clearAddPlayTrack(): ytmusic/video@videoId=M7Ea6dy9P8o@explodeTrackData=%7B%22videoId%22%3A%22M7Ea6dy9P8o%22%2C%22title%22%3A%22Wild%22%2C%22artist%22%3A%22Spoon%22%2C%22album%22%3A%22Lucifer%20On%20The%20Sofa%22%2C%22albumart%22%3A%22https%3A%2F%2Flh3.googleusercontent.com%2FTx-PmNhz0fy1V_Kk3qeMivlXWhZE4sIOSflgqVCVEB6dJL8QVaDfUJV9KNy5l7NN5nHUnHVV2IsMW6o%3Dw701-h701-l90-rj%22%2C%22playlistId%22%3A%22LM%22%2C%22autoplayContext%22%3A%7B%22playlistId%22%3A%22LM%22%2C%22continueFromVideoId%22%3A%22N2Oa3RPt_60%22%7D%7D@playlistId=LM@autoplayContext=%7B%22playlistId%22%3A%22LM%22%2C%22continueFromVideoId%22%3A%22N2Oa3RPt_60%22%7D
Sep 09 09:06:33 volumio volumio[837]: InnertubeError: PlaylistPanelVideoWrapper not found!
Sep 09 09:06:33 volumio volumio[837]: This is a bug, please report it at https://github.com/patrickkfkan/Volumio-YouTube.js/issues
Sep 09 09:06:33 volumio volumio[837]:     at Function.formatError (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:357:33)
Sep 09 09:06:33 volumio volumio[837]:     at Function.parseItem (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:279:22)
Sep 09 09:06:33 volumio volumio[837]:     at Function.parseArray (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:289:37)
Sep 09 09:06:33 volumio volumio[837]:     at new PlaylistPanel (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/classes/PlaylistPanel.js:17:41)
Sep 09 09:06:33 volumio volumio[837]:     at Function.parseItem (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:274:32)
Sep 09 09:06:33 volumio volumio[837]:     at Function.parse (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:321:53)
Sep 09 09:06:33 volumio volumio[837]:     at new MusicQueue (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/classes/MusicQueue.js:11:40)
Sep 09 09:06:33 volumio volumio[837]:     at Function.parseItem (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:274:32)
Sep 09 09:06:33 volumio volumio[837]:     at new Tab (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/classes/Tab.js:18:40)
Sep 09 09:06:33 volumio volumio[837]:     at Function.parseItem (/data/plugins/music_service/ytmusic/node_modules/volumio-youtubei.js/dist/src/parser/index.js:274:32) {
Sep 09 09:06:33 volumio volumio[837]:   info: {
Sep 09 09:06:33 volumio volumio[837]:     primaryRenderer: { playlistPanelVideoRenderer: [Object] },
Sep 09 09:06:33 volumio volumio[837]:     counterpart: [ [Object] ]
Sep 09 09:06:33 volumio volumio[837]:   },
Sep 09 09:06:33 volumio volumio[837]:   date: 2022-09-09T09:06:33.766Z,
Sep 09 09:06:33 volumio volumio[837]:   version: '0.1.0-b.5'
Sep 09 09:06:33 volumio volumio[837]: }
Sep 09 09:06:33 volumio volumio[837]: error: [ytmusic-play] clearAddPlayTrack() error
Sep 09 09:06:33 volumio volumio[837]: error: Cannot read property 'item_type' of undefined
Sep 09 09:06:37 volumio volumio[837]: info: CoreCommandRouter::volumioGetState
Sep 09 09:06:37 volumio volumio[837]: info: CorePlayQueue::getTrack 37
Sep 09 09:06:37 volumio volumio[837]: info: Listing playlists
Sep 09 09:06:37 volumio volumio[837]: info: Listing playlists
Sep 09 09:06:47 volumio volumio[837]: info: CoreCommandRouter::volumioGetState
Sep 09 09:06:47 volumio volumio[837]: info: CorePlayQueue::getTrack 37
Sep 09 09:06:57 volumio volumio[837]: info: CoreCommandRouter::volumioGetState
Sep 09 09:06:57 volumio volumio[837]: info: CorePlayQueue::getTrack 37
Sep 09 09:06:57 volumio volumio[837]: info: Listing playlists
Sep 09 09:06:57 volumio volumio[837]: info: Listing playlists
Sep 09 09:07:07 volumio volumio[837]: info: CoreCommandRouter::volumioGetState
Sep 09 09:07:07 volumio volumio[837]: info: CorePlayQueue::getTrack 37
Sep 09 09:07:17 volumio volumio[837]: info: CoreCommandRouter::volumioGetState
Sep 09 09:07:17 volumio volumio[837]: info: CorePlayQueue::getTrack 37
Sep 09 09:07:17 volumio volumio[837]: info: Listing playlists
Sep 09 09:07:17 volumio volumio[837]: info: Listing playlists
```Preformatted text