[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 pintea » Thu May 31 2018 22:58

Hi Sepherim,
I am aware of the problem and I will be looking into it as soon as I have a moment.
I will make sure to update this thread once it is fixed.

Best Regards,
Cris
Cris Pintea http://pintea.net

If you appreciate my work buy me a coffee!

That's very appreciated!
User avatar
pintea
Moderator
 
Posts: 47
Joined: Fri Apr 14 2017 22:54
Location: Turin, Italy

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


[PLUGIN] YouTube for Volumio

Postby hakstoro » Tue Jun 19 2018 23:37

When I played this LIve Stream on Youtube plugin, it is stopped after 30 secs play.
https://www.youtube.com/watch?v=jiLkBxw2pbs

I think, Non LIve Stream clips are good(not stopped)

attached Log
http://logs.volumio.org/volumio/fKcRXao.html
Random avatar
hakstoro
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Mon Jun 18 2018 03:41


[PLUGIN] YouTube for Volumio

Postby chipman » Fri Jun 22 2018 05:07

sla89 wrote:
chipman wrote:Bad news again.
I got that error:

Apr 01 18:53:30 nappali volumio[872]: error: Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/a ... 3050398935
Apr 01 18:53:30 nappali volumio[872]: Error: Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/a ... 3050398935

I don't understand that because I barely used Youtube today.
Have any suggestions for someone?
Thanks.


Yes, I can explain that to you. Currently the youtube plugin uses the free to use Google Youtube v3 API. All users of the plugin use the same API key. That means we (all volumio youtube plugin user) are allowed to create 1.000.000 queries per day. Yesterday we have done 1.000.000 queries. Normally we have about 200.000 to 300.000 (on weekends). So wow. I would never expect that so many people are using my plugin. :shock:

To be able to increase this quota I would have to pay for it and I won't do that, I am sorry. I have already told this Michelangelo a long time ago but I cannot tell you whether the volumio team is willing to to pay for the API usage.

When I have developed the plugin my first idea was that each user has to generate a own key but I think that you cannot expect that from every user for usability reasons.

But when the usage of the plugin will increase and the quota will be reached more often AND the volumio team is not willing to pay for the API usage I will change this.

I will talk with Michelangelo again and explain him the situation.

To decrease the number of queries automatically done I will move the activities list into a folder and query it only when the user wants to see it. That should also improve the usage of the plugin.



This is a really good plugin that many people use. Thank you for your work and support.

If we exceed the limit, will we have to pay a monthly fee or pay a one-off fee to Google?

Creating your own api key would be complicated for plugin users?

It is a good idea to keep a list of polled music, because if I choose something from the plugin's polled list and I click to my playlist and then go back to the plugin's polled list, the list is no longer visible and you need to change a character in the search field and retrieve it to appear in the list generates unnecessary queries.

I think today we've again exceeded Google API's quota.
Random avatar
chipman
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Fri Feb 09 2018 10:55


[PLUGIN] YouTube for Volumio

Postby stefanf » Fri Jun 22 2018 07:35

Hey,

I installed Volumio yesterday and spent the whole evening trying to figure out why the Youtube plugin doesn't work. Glad that I found this thread and now know why - just checked my logs, I have the "daily limit exceeded" problem as well.

Would be awesome if you guys could add the possibility that I can enter my own API key as well. I think that users that run software like Volumio should be able to do this and I assume this is the easier solution to fix this than to get a paid solution for everybody?

Thanks for maintaning this plugin, hope I can use it soon!

Cheers,
Stefan
Random avatar
stefanf
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Fri Jun 22 2018 07:28


[PLUGIN] YouTube for Volumio

Postby orderoftheflame » Fri Jun 22 2018 08:20

stefanf wrote:Hey,

I installed Volumio yesterday and spent the whole evening trying to figure out why the Youtube plugin doesn't work. Glad that I found this thread and now know why - just checked my logs, I have the "daily limit exceeded" problem as well.

Would be awesome if you guys could add the possibility that I can enter my own API key as well. I think that users that run software like Volumio should be able to do this and I assume this is the easier solution to fix this than to get a paid solution for everybody?

Thanks for maintaning this plugin, hope I can use it soon!

Cheers,
Stefan


chipman wrote:
sla89 wrote:Yes, I can explain that to you. Currently the youtube plugin uses the free to use Google Youtube v3 API. All users of the plugin use the same API key. That means we (all volumio youtube plugin user) are allowed to create 1.000.000 queries per day. Yesterday we have done 1.000.000 queries. Normally we have about 200.000 to 300.000 (on weekends). So wow. I would never expect that so many people are using my plugin. :shock:

To be able to increase this quota I would have to pay for it and I won't do that, I am sorry. I have already told this Michelangelo a long time ago but I cannot tell you whether the volumio team is willing to to pay for the API usage.

When I have developed the plugin my first idea was that each user has to generate a own key but I think that you cannot expect that from every user for usability reasons.

But when the usage of the plugin will increase and the quota will be reached more often AND the volumio team is not willing to pay for the API usage I will change this.

I will talk with Michelangelo again and explain him the situation.

To decrease the number of queries automatically done I will move the activities list into a folder and query it only when the user wants to see it. That should also improve the usage of the plugin.



This is a really good plugin that many people use. Thank you for your work and support.

If we exceed the limit, will we have to pay a monthly fee or pay a one-off fee to Google?

Creating your own api key would be complicated for plugin users?

It is a good idea to keep a list of polled music, because if I choose something from the plugin's polled list and I click to my playlist and then go back to the plugin's polled list, the list is no longer visible and you need to change a character in the search field and retrieve it to appear in the list generates unnecessary queries.

I think today we've again exceeded Google API's quota.



Would it make sense to at least offer users the option to generate your their own key and enter it.

If the user doesn't enter the key then they fall back and default to the shared API key. It could be under a hidden "Advanced configuration" section in the UI that just overrides the default.

I completely agree that expecting every user to create their own key isn't a suitable solution. But allowing users to enter their own key, would:

a) allow more technical users an option to continue use when the API limit is hit.
And b) potentially reduce the load on the shared API key by removing the number of users utilising it.

I'm sure if you shared some step by step instructions for creating a key, the majority of Volumio users would be technical enough to follow and understand it if they wanted to. :) But those that can't would still just use the shared key by default if don't decide to configure anything.
Random avatar
orderoftheflame
Sunday DIYer
Sunday DIYer
 
Posts: 27
Joined: Tue May 16 2017 06:41
Location: Newbury, UK


[PLUGIN] YouTube for Volumio

Postby Sepherim » Sat Jun 23 2018 05:55

Seems google repaired the Device problem on their end.

They seemed to have fucked up.

Im happy it all works again now.
Random avatar
Sepherim
Fresh off the boat
Fresh off the boat
 
Posts: 4
Joined: Wed May 30 2018 15:10


[PLUGIN] YouTube for Volumio

Postby mrhung751 » Sun Jul 22 2018 17:01

Please help me
Your search on youtube is not working!
I installed the latest version still does not work
Thanks
Attachments
youtube loi.jpg
youtube loi.jpg (131.61 KiB) Viewed 1572 times
Random avatar
mrhung751
Sunday DIYer
Sunday DIYer
 
Posts: 13
Joined: Sat Mar 03 2018 02:46


[PLUGIN] YouTube for Volumio

Postby throwawayguy » Sun Sep 30 2018 05:36

Yes, I can explain that to you. Currently the youtube plugin uses the free to use Google Youtube v3 API. All users of the plugin use the same API key. That means we (all volumio youtube plugin user) are allowed to create 1.000.000 queries per day. Yesterday we have done 1.000.000 queries. Normally we have about 200.000 to 300.000 (on weekends). So wow. I would never expect that so many people are using my plugin. :shock:


To the plugin author: Congratulations on the heavy usage! Well past free tier pretty often : )

To the users: This plugin works great, but indeed does often run out of free API usage due to so many users. It is entirely possible, if you have a google account, to create project credentials yourself to access the youtube API without using the build in volumio-youtube key. Some brief instructions are below.

Activate the API
* Uninstall the Youtube plugin, then reinstall it, then reboot your volumio. Don't 'enable' the plugin yet.
* Log into google developer section at https://console.developers.google.com. You might have to activate a new project, or your account in some way, that I had already done.
* Find the API library, and search for and enable Youtube data API v3.
* You are 1/3 of the way done.

Create credentials
* Create a new project, named something like volumio-youtube-yourusername
* Use the google developer page to add credentials for this project. Select the youtube data API you just enabled. It will say lots of things about oauth2, and the like. If you have to choose an access category, webserver should work fine.
* Download the resulting credentials in json format. It will probably be called client_id.json or similar.
* You are now 2/3 done.

Edit the auth.json file for the plugin
* Copy the /data/plugins/music_service/youtube/auth.json file off your volumio
* Edit it in a text editor, and replace all the matching fields with the data from your client_id.json file, except the redirect.
* You'll end up with something like this:
Code: Select all
{
  "volumio": {
    "client_id": "biglongrandomnumber9131928319273192873.apps.googleusercontent.com",
    "project_id": "the-name-ofthe-project-you-created",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://www.googleapis.com/oauth2/v3/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_secret": "ADIFFERENT_SECRET_THAN_THE_ORIGINAL",
    "redirect_uris": [
      "http://127.0.0.1:9004"
    ]
  }
}


* Copy the file back into your volumio at the correct location:
Code: Select all
/data/plugins/music_service/youtube/auth.json

* Enable the youtube plugin. Copy the code displayed as previously, into google.com/device
* Leave the youtube plugins settings page, then go back in. It should successfully authenticate.

Done
You now have a (mostly) functioning youtube plugin. Depending how you configure your project, accessing user account data may not work, but public results should always function. You'll have enough free API usage for your personal use, I'm sure.

Don't paste your client secret anywhere on the internet unless you want other people using your API credit.

If you update the youtube plugin, your changes will get blown away - so save the auth.json file you create. Maybe the author will add expert settings for you to plug in your own values for client_id and client_secret - but it is too much generally to expect users to deal with these values and API registration. If I was the developer I'm would probably have other higher priorities.
Random avatar
throwawayguy
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Sun Sep 30 2018 05:17


[PLUGIN] YouTube for Volumio

Postby edwin69 » Sun Sep 30 2018 21:21

Hi throwawayguy,

Thanks for the tips and the well documented how-to.
I just followed the steps as described but I get stucked on the plugin settings page where the code zone remains empty.
Any idea on what I forgot ?

Many thanks,
Random avatar
edwin69
Fresh off the boat
Fresh off the boat
 
Posts: 3
Joined: Sun Sep 30 2018 21:16
Location: Villeurbanne (France)


[PLUGIN] YouTube for Volumio

Postby pet » Fri Oct 05 2018 17:17

Hi!

Awesome plugin, thank you!

I got stuck at the same point as edwin69.
After looking into it, i changed the "ytapi_key" in the index.js (same folder) and kept the original auth.json. (I think you will need to deinstall and restart .. and then make the change in the index.js)
I see now my requests in the google console, so this seems to work. For this you need to create an api key and not a oauth-client-id.

Hope this helps anyone.
Random avatar
pet
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Fri Oct 05 2018 16:40

PreviousNext

Return to Development talks

Who is online

Users browsing this forum: No registered users and 1 guest