[PLUGIN] YouTube for Volumio

Discuss, contribute and orient Volumio development!

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

[PLUGIN] YouTube for Volumio

Postby jro » Sun Aug 11 2019 11:42

After following the above instructions I get:

2019-08-11T11:39:53.604Z - error: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.
Error: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.
at Request._callback (/data/plugins/music_service/youtube/node_modules/google-auth-library/lib/transporters.js:85:15)
at Request.self.callback (/data/plugins/music_service/youtube/node_modules/request/request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (/data/plugins/music_service/youtube/node_modules/request/request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (/data/plugins/music_service/youtube/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Random avatar
jro
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Sun Aug 11 2019 10:36

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


[PLUGIN] YouTube for Volumio

Postby TonyK » Mon Oct 07 2019 10:33

quatmo wrote:You can try other solution for fix 3/4 stop, overwrite ytdl-core and miniget:

Code: Select all
sudo chmod -R 777 /data/plugins/music_service/youtube/node_modules && wget https://github.com/quatmo/volumio-youtube-mod/raw/master/ytdl-core.zip && miniunzip ytdl-core.zip -d /data/plugins/music_service/youtube/node_modules/ytdl-core && cd /data/plugins/music_service/youtube/node_modules/ytdl-core && sudo npm install && reboot


Is the above a tested and proven fix for the 3/4 stop? *can anyone confirm? (maybe instructions on how to apply? e.g. do you have to disable the plugin prior...?)
Random avatar
TonyK
Fresh off the boat
Fresh off the boat
 
Posts: 8
Joined: Wed Apr 17 2019 12:40


[PLUGIN] YouTube for Volumio

Postby TonyK » Mon Oct 07 2019 10:34

hombibi wrote:All, thank for the work on the youtube plugin, when it works it is really a great function

I also experience the cut off of songs. Some observations I hope may help:

1) The troubles started in June with not being able to play songs any longer
2) Playing capability was restored by ma_sk1 on the 17th of June, still in use by me as it is not clear how/which versions/forks have progressed.
3) The cut off only occurs on when on a wireless network, as was also noted by ma_sk1. With an ethernet cable connected the cutoff does not occur.
3) the clock/timer that supports the song runs too fast when on wifi.

Hombibi


3) We have the cut off also on a wired network... *did have a song play till the end today...was the last one in the queue
Random avatar
TonyK
Fresh off the boat
Fresh off the boat
 
Posts: 8
Joined: Wed Apr 17 2019 12:40


[PLUGIN] YouTube for Volumio

Postby GwaneTIme » Wed Oct 09 2019 08:35

I do not know why but my browser crashed any time when I use a youtube plugin. It could be due to poor optimization. I have a choice the website which provides youtube to mp3 converter The convenient and easy interface with many available formats and never with load your internet speed. Advice to everyone who also has some issues with a browser to use better the site and do not instal a plugin.
Random avatar
GwaneTIme
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Mon Sep 30 2019 07:50


[PLUGIN] YouTube for Volumio

Postby SofaSurfer » Sat Oct 12 2019 20:30

Hi.

anyone fixed/tested 2/3 cut issue?

Thank you and best regards.
Random avatar
SofaSurfer
Sunday DIYer
Sunday DIYer
 
Posts: 11
Joined: Wed Jan 28 2015 17:47


[PLUGIN] YouTube for Volumio

Postby patrickkfkan » Tue Nov 05 2019 16:54

Hi,

Maybe I missed it, but I'm wondering if this plugin has an "AutoPlay" feature that plays the "Up Next" video if there are no further tracks in the playlist (like YouTube in the browser)?

Thanks for the good work :)
User avatar
patrickkfkan
Fresh off the boat
Fresh off the boat
 
Posts: 7
Joined: Tue Nov 05 2019 10:52


[PLUGIN] YouTube for Volumio (add API Settings)

Postby patrickkfkan » Sun Nov 10 2019 09:43

Hello,

This may come a bit late but I have made some changes to the YouTube plugin to allow specifying your own API credentials in the plugin settings.

The API key used by the official YouTube plugin is broken as of this writing, so you cannot access YouTube without first granting Volumio to your YouTube account. However, even after granting such access, sometimes the plugin fails with Quota Exceeded errors. This is because the quotas associated with the API credentials used by the official YouTube plugin have exceeded due to too many requests (the credentials are shared by all users of the plugin). It is therefore ideal to instruct the plugin to use your own API credentials, which would mean all quotas are reserved only for you (whether or not you grant access to your YouTube account). The attached plugin caters for this.

Before using the plugin, you need to create the credentials in your Google Developer Console as follows:

  1. Go to your Google Developer Console
  2. Create a Project (click 'Select a Project', then 'New Project').
  3. On the left menu, choose Library, then enter "YouTube Data API v3" in the search box. In the search results, click on the API and enable it.
  4. Then choose Credentials on the left menu. This is the place where you will create your API credentials.
  5. Click 'Create Credentials', choose 'API Key'. An API Key will be created and you can optionally choose to restrict it to the YouTube Data API v3.
  6. Then click 'Create Credentials' again and choose 'OAuth client ID'.
  7. You will be asked to configure the consent screen, so let's do that. On the configuration page:
    • Set Application name (e.g. volumio-youtube-your-username). This name will be shown during the process where you grant Volumio access to your YouTube account
    • Click 'Add scope', then check the box for 'YouTube Data API v3 ../auth/youtube.readonly'
    • Click Save.
  8. You will be brought back to the Create OAuth Client ID page. Choose 'Other' for Application type and provide a name (e.g. volumio-youtube-client). Click Create.
  9. Done! You have just created the API credentials needed for YouTube access. On the Credentials page, you will see the API key and Client ID. The Client Secret can be obtained by clicking the Edit icon corresponding to the Client ID.

To install the plugin:

  1. If you have the official YouTube plugin installed, you should uninstall it first, followed by a Volumio restart. To restart Volumio, you can enter the following in the console:
    Code: Select all
    volumio@volumio:~$ volumio vrestart
  2. Download the attached zip file and place it in your Volumio home directory (/home/volumio)
  3. In Volumio console, enter the following:
    Code: Select all
    volumio@volumio:~$ cd /home/volumio
    volumio@volumio:~$ mkdir volumio_youtube_install
    volumio@volumio:~$ cd volumio_youtube_install
    volumio@volumio:~/volumio_youtube_install$ miniunzip ../<name of zip file downloaded>
    volumio@volumio:~/volumio_youtube_install$ volumio plugin install
  4. You can delete the volumio_youtube_install directory after installation is complete
    Code: Select all
    volumio@volumio:~/volumio_youtube_install$ cd ..
    volumio@volumio:~$ rm -rf volumio_youtube_install

Using the API credentials with our plugin:

  1. Open Volumio web interface in your browser, go to Plugins->Installed Plugins and enable the YouTube plugin. Then click Settings.
  2. The default is to use the credentials provided by the official YouTube plugin. To change that:
    • Under API Settings, turn off the 'Default' switch.
    • In the corresponding fields that appear, enter the API key, Client ID and Client secret you created in your Google Developer Console.
    • Click Save.
  3. A dialog will appear reminding you to use new Code for granting Volumio access to your YouTube account.
  4. Note the change in the Code shown under Account Access. You may have to wait up to 10 seconds to see the change.
  5. Use the new Code for granting access to your YouTube account. The process is the same as with the official YouTube plugin. Note that you might get a "This app isn't verified" warning in the process. This is normal since you haven't gone through the Google verification step after creating the OAuth Client ID, but it is nonetheless safe to proceed by clicking 'Advanced' and 'Go to <your app name>'.
  6. If you change the API settings again, you will need to grant / regrant access with new Code.

Please feel free to test it and point out any issues or suggestions. If this works well then maybe this can be merged into the official plugin... :roll:
Attachments
youtube-api-20191110.zip
(5.7 MiB) Downloaded 8 times
User avatar
patrickkfkan
Fresh off the boat
Fresh off the boat
 
Posts: 7
Joined: Tue Nov 05 2019 10:52


[PLUGIN] YouTube for Volumio

Postby MrSeamus » Tue Nov 12 2019 21:58

Great! Thanks patrickkfkan!
I followed your instructions and the plugin works perfectly!

Just an issue: when clicking on a subscripted channel an error appears that, looking in the log, is an HTML page showing "413. That’s an error. Your client issued a request that was too large." (I omitted all the html tags)

Is it something that can be solved? Or there is a limit on the request's length?
Thanks
Random avatar
MrSeamus
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Thu Jan 18 2018 16:00


[PLUGIN] YouTube for Volumio

Postby patrickkfkan » Wed Nov 13 2019 09:40

MrSeamus wrote:Great! Thanks patrickkfkan!
I followed your instructions and the plugin works perfectly!

Just an issue: when clicking on a subscripted channel an error appears that, looking in the log, is an HTML page showing "413. That’s an error. Your client issued a request that was too large." (I omitted all the html tags)

Is it something that can be solved? Or there is a limit on the request's length?
Thanks


Hello MrSeamus,

Could you try replacing the index.js file in your YouTube plugin directory with the one in the attached zip and see if it works?

After unzipping the attachment:
Code: Select all
> cp index.js /data/plugins/music_service/youtube/
> volumio vrestart


What's updated:
  • When you click on a channel (in your Subscriptions or search results), the official plugin actually fetches all Channel Sections first and then the playlists in each section. Sometimes that fails with some channels (e.g. https://www.youtube.com/channel/UCXUsPf-G8qGEKCy-Yw30CGw). The updated plugin now fetches the playlists directly off a channel, as opposed to going through each channel section.
  • 'Back' navigation has been improved. With the original plugin, clicking Back will always bring you back to the first page. Now, you can go back to the previous page - e.g. search for something -> click on a channel in search results -> click on a playlist in the selected channel -> play a song in the playlist -> Click 'Back' arrow to return to channel playlists -> Click 'Back' to return to search results. Note that searching will reset the 'back' history.

If you still get Error 413, could you please provide the channel ID so I can have a look at it? You can find the channel ID in the YouTube URL of the browser (e.g. https://www.youtube.com/channel/UCXUsPf-G8qGEKCy-Yw30CGw)

I'll repackage the plugin with the updated index.js when I'm not feeling too lazy :| . Also, for those who are interested, here's my git (although I don't really use it properly, so don't expect master always == stable ;) ): https://github.com/patrickkfkan/volumio-plugins
Attachments
youtube-index.js-20191113.zip
(8.14 KiB) Downloaded 2 times
User avatar
patrickkfkan
Fresh off the boat
Fresh off the boat
 
Posts: 7
Joined: Tue Nov 05 2019 10:52


[PLUGIN] YouTube for Volumio

Postby Josh2000 » Wed Nov 13 2019 17:05

Hi patrickkfkan,

Do i guess right i will have to edit auth.json and replace the credentials with the values just created ?
I think so - will try

Best Regards
Josef
User avatar
Josh2000
Audiophile
Audiophile
 
Posts: 176
Joined: Mon Oct 17 2016 16:43

PreviousNext

Return to Development talks

Who is online

Users browsing this forum: No registered users and 0 guests