[PLUGIN] YouTube for Volumio

Hmm… Did the problem show up only recently or has been around all the time?

I’ll have a look into this. Could you confirm that the plugin you’re using is 20191224? I’m asking because the earlier versions could produce the error you’re seeing in the logs.

Till now there is no Video I can play. Volumio gives the message “Playbck started” but it never starts to play.
Maybe someone can tell me a video qwhich is working with Volumio. Many of the tried videos worked well before!

Where do I find the logs in Volumio?

You need to ssh into your Volumio device and then issue the command:

sudo journalctl -f

Are you using the latest version I have uploaded? It should be this one

These instructions seemed to have worked for me. I’m using the youtube-20191224.zip version of your plugin, with a Raspberry Pi 3B & Hifiberry AMP2.

Possibly a stupid question, but I was expecting the video itself to play, should it? Or does the plugin just grab the audio stream?

Thanks

Hi patrickkfkan,

I verified in my archive library that your latest plugin zip is what I used.
The MPD update tarfile was also archived.
I started to doubt myself after rereading your mpd update instructions.
Thought maybe I had not done that correctly, so I started completely over this morning.
Steps in the following order:

Used the save setting plugin and created my volumio_data.tgz file
Downloaded the latest rasPi Version 2.698 from volumio.org
Installed V2.698 onto a new SD card.
Copied three files onto new card
volumio_data.tgz youtube-20191224.zip and mpd-0.21.16.arm-20191228-3v3jy.tar.gz
Started up Pi with v2.698
Restored my settings
Rebooted
made sure afterwards I could play music from my usb stick and webradio favorites
Installed your 20191224 plugin
Rebooted
Installed your mpd-0.21.16 update
Rebooted
Activated youtube plugin… I did not have to reauthorize with google as all my keys were
restored from my archived settings

tested afterwards:

searched youtube just fine.
played 20 items from youtube that I had documented as not working and random others.
Everything works perfect now, audio plays full track 100% every time.

THANK YOU

You deserve a nice beverage at the very least for all your help.
Respond back if there is a way that I can buy you a Beer… :sunglasses:

When you click on a video, the plugin fetches the audio stream and plays it. The video itself is not played - Volumio is strictly audio :slight_smile:

You must be in the wrong place
volumio plugin install
volumio vrestart

Hi patrickkfkan,

Day 2 and the plugin still working great.
I hit the 10,000 limit quota last night and as expected and verified in the log
search results stopped working.
I am monitoring my quota limit now and after only 9 searches I have over
15000+ queries logged for today. I have plugin limits set to 20 items per page,
timer 3600 and cache size 400. I don’t ever login to youtube website so all the search
categories, activities, subscriptions, have no relevance to me. I only use the plugin
for general youtube searches and playback something from the results.
I assume the reason for the high query count is because youtube returns so many
“suggested” hits for each search Item I try as well as its predictive behavior of returning
results with each character I type into the search box. Waiting to search until I finish typing
would be more desirable in my opinion.

Any suggestions on how I can change plugin or youtube user account settings or develop a
different search method to reduce the query volume?

thanks LouSly

sorry typo
9 searches produced over 1500+ queries

Hmm… interesting and definitely looks serious. Let me check.

DId you do the search inside the plugin, or in the top page of Volumio?

ytube-search.PNGytube-search.PNGpatrickkfkan,

Not sure I understand your inside the plugin reference?
I operate volumio only one way. I use chrome browser on my PC.
navigate and search this way.

browse
select youtube from homepage
type all searches in the box at top right corner of screen.

for example i typed this string into the search box

Townes Van Zandt Dollar Bill Blues

After I got the results google developer page shows my quota # increased by 102.

attachment is a screen shot of when I did the search.

thanks

The quota increase of 102 is actually normal. From Google’s documentation on the API search function:

(For now, let’s not be concerned with the extra 2 units consumed - that could be due to retrieving extra info from YouTube)

As you navigate through the pages of the search results, extra units will be consumed for non-cached pages (~100 each time). Interestingly, the quota cost is the same whether you are returning 20 hits or 50 hits (the max allowed) per page.

Different operations such as viewing a playlist, fetching video metadata or, as in this case, performing a search will have different quota costs. Google provides a quota cost calculator to give you a rough estimate of what to expect for different operations.

As far as searching goes, Volumio delays for a short while before actually commencing the search. This is a global “feature” provided by Volumio itself (applies to all music service plugins). You are correct in pointing out that multiple requests could have been made to YouTube if you type too slowly. I tried typing a 20-character string into the search box at a slow-enough speed, and that resulted in the plugin making 3 requests and costing me ~300 quota units. So, if you have a long string to search, I suggest you copy and paste it into the search box instead of typing it in. I don’t know if it would be a good idea to modify the code of Volumio UI to prolong the search delay, as this would affect all the other plugins as well…

I wonder if I’ve missed anything crucial in my explanation. Also, I don’t quite get why Google refers to quota units as “queries” in their Quotas section… :confused:

Thankyou patrickkfkan, you gave me the right hints. I used vers. 20191110, which did not work. Now with vers. 20191224 (a Christmas present?) everything is perfect! Btw there was / is no log to read! How can I start logging?
Thankyou again for your great job and help! :smiley: :smiley: :smiley:

Hi patrickkfkan,

your explanation was terrific. Lots of good information shared.
I will check out that link to the calculator later this evening…

Thank You

I also installed the last unofficial version youtube-20191224.zip and used my own Api.
Unfortunately youtube cannot find any content, what am I doing wrong?
youtube.jpg

The screenshot looks normal to me. Seems you have granted access to your YouTube account.

What do you mean by YouTube cannot find any content? E.g. do you get errors when doing a search?

Yes, I have access to my account.

When searching I don’t get an error message.

But content is not shown.

hmm it seems to be due to my API key. I get error messages with every query.

What’s going wrong?
APIabfrage.jpg

What are those error messages?