YouTube no search results


#1

Hey,

today I’ve flashed and run Pi MusicBox 0.7.0RC5 on my RPI 3. However, youtube searching is not working. “No tracks found” all the time.

After checking some logs at /var/log/mopidy/mopidy.log it turned out something is wrong. here it is:

Maybe it’s because of some latest changes in youtube API?https://developers.google.com/youtube/v3/revision_history#august-29-2017

2017-07-27 23:49:58,919 - ERROR    YouTubeBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mopidy/core/library.py", line 19, in _backend_error_handling
yield
  File "/usr/local/lib/python2.7/dist-packages/mopidy/core/library.py", line 344, in search
    result = future.get()
  File "/usr/local/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/local/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/local/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/local/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/local/lib/python2.7/dist-packages/mopidy_youtube/backend.py", line 192, in search
    tracks=search_youtube(search_query)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_youtube/backend.py", line 98, in search_youtube
    result = session.get(yt_api_endpoint+'search', params=query)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 515, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 502, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 612, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 504, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='www.googleapis.com', port=443): Max retries exceeded with url: 
/youtube/v3/search?
q=acdc&part=id&type=video&key=AIzaSyAl1Xq9DwdE_KD4AtPaE4EJl3WZe2zCqg4&maxResults=15 (Caused by 
SSLError(SSLErro$

Has anyone encountered such a problem?


#2

I have this problem too. I have installed MusicBox and a version 1 pi, and most things seem to work OK, but any search on youtube returns no results.

Have you found a solution to this problem?


#3

None of those API changes look relevant to what mopidy-youtube uses. I can’t reproduce this.

2018-01-11 16:50:15,035 INFO [4554:YouTubeBackend-7] mopidy_youtube: Searching YouTube for query 'acdc'
2018-01-11 16:50:15,249 DEBUG [4554:YouTubeBackend-7] urllib3.connectionpool: https://www.googleapis.com:443 "GET /youtube/v3/search?q=acdc&part=id&type=video&key=AIzaSyAl1Xq9DwdE_KD4AtPaE4EJl3WZe2zCqg4&maxResults=15 HTTP/1.1" 200 None
2018-01-11 16:50:32,195 DEBUG [4554:HttpServer] mopidy.http.handlers: Sent WebSocket message to 172.22.0.55: '{"jsonrpc": "2.0", "id": 20, "result": [{"__model__": "SearchResult", "tracks": [{"album": {"images": ["http://i.ytimg.com/vi/v2AC41dglnM/hqdefault.jpg", "http://i.ytimg.com/vi/v2AC41dglnM/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "v2AC41dglnM", "__model__": "Track", "name": "AC/DC - Thunderstruck (Official Video)", "uri": "youtube:video/ACDC - Thunderstruck (Official Video).v2AC41dglnM", "length": 292000}, {"album": {"images": ["http://i.ytimg.com/vi/pAgnJDJN4VA/hqdefault.jpg", "http://i.ytimg.com/vi/pAgnJDJN4VA/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "pAgnJDJN4VA", "__model__": "Track", "name": "AC/DC - Back In Black (Official Video)", "uri": "youtube:video/ACDC - Back In Black (Official Video).pAgnJDJN4VA", "length": 255000}, {"album": {"images": ["http://i.ytimg.com/vi/gEPmA3USJdI/mqdefault.jpg", "http://i.ytimg.com/vi/gEPmA3USJdI/hqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "gEPmA3USJdI", "__model__": "Track", "name": "AC/DC - Highway to Hell (from Live at River Plate)", "uri": "youtube:video/ACDC - Highway to Hell (from Live at River Plate).gEPmA3USJdI", "length": 284000}, {"album": {"images": ["http://i.ytimg.com/vi/3f2g4RMfhS0/mqdefault.jpg", "http://i.ytimg.com/vi/3f2g4RMfhS0/hqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "3f2g4RMfhS0", "__model__": "Track", "name": "AC/DC - Let There Be Rock (Official Video)", "uri": "youtube:video/ACDC - Let There Be Rock (Official Video).3f2g4RMfhS0", "length": 369000}, {"album": {"images": ["http://i.ytimg.com/vi/S7FWA-WKlY0/mqdefault.jpg", "http://i.ytimg.com/vi/S7FWA-WKlY0/hqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "S7FWA-WKlY0", "__model__": "Track", "name": "AC DC live at Munich 2001 FULL concert", "uri": "youtube:video/AC DC live at Munich 2001 FULL concert.S7FWA-WKlY0", "length": 7657000}, {"album": {"images": ["http://i.ytimg.com/vi/Lo2qQmj0_h4/mqdefault.jpg", "http://i.ytimg.com/vi/Lo2qQmj0_h4/hqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "Lo2qQmj0_h4", "__model__": "Track", "name": "AC/DC - You Shook Me All Night Long (Official Video)", "uri": "youtube:video/ACDC - You Shook Me All Night Long (Official Video).Lo2qQmj0_h4", "length": 210000}, {"album": {"images": ["http://i.ytimg.com/vi/QMvE0yFnR0I/hqdefault.jpg", "http://i.ytimg.com/vi/QMvE0yFnR0I/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "QMvE0yFnR0I", "__model__": "Track", "name": "AC/DC - Whole Lotta Rosie (from Live at River Plate)", "uri": "youtube:video/ACDC - Whole Lotta Rosie (from Live at River Plate).QMvE0yFnR0I", "length": 342000}, {"album": {"images": ["http://i.ytimg.com/vi/n_GFN3a0yj0/mqdefault.jpg", "http://i.ytimg.com/vi/n_GFN3a0yj0/hqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "n_GFN3a0yj0", "__model__": "Track", "name": "AC/DC - Thunderstruck (from Live at River Plate)", "uri": "youtube:video/ACDC - Thunderstruck (from Live at River Plate).n_GFN3a0yj0", "length": 320000}, {"album": {"images": ["http://i.ytimg.com/vi/O24AipZ-buQ/mqdefault.jpg", "http://i.ytimg.com/vi/O24AipZ-buQ/hqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "O24AipZ-buQ", "__model__": "Track", "name": "AC/DC - Let There Be Rock (from Live at River Plate)", "uri": "youtube:video/ACDC - Let There Be Rock (from Live at River Plate).O24AipZ-buQ", "length": 1066000}, {"album": {"images": ["http://i.ytimg.com/vi/l482T0yNkeo/hqdefault.jpg", "http://i.ytimg.com/vi/l482T0yNkeo/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "l482T0yNkeo", "__model__": "Track", "name": "AC/DC - Highway to Hell (Official Video)", "uri": "youtube:video/ACDC - Highway to Hell (Official Video).l482T0yNkeo", "length": 207000}, {"album": {"images": ["http://i.ytimg.com/vi/44XYEeD1A1U/hqdefault.jpg", "http://i.ytimg.com/vi/44XYEeD1A1U/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "44XYEeD1A1U", "__model__": "Track", "name": "AC/DC - T.N.T. (from Live at River Plate)", "uri": "youtube:video/ACDC - T.N.T. (from Live at River Plate).44XYEeD1A1U", "length": 230000}, {"album": {"images": ["http://i.ytimg.com/vi/etAIpkdhU9Q/hqdefault.jpg", "http://i.ytimg.com/vi/etAIpkdhU9Q/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "etAIpkdhU9Q", "__model__": "Track", "name": "AC/DC - Hells Bells (Official Video)", "uri": "youtube:video/ACDC - Hells Bells (Official Video).etAIpkdhU9Q", "length": 311000}, {"album": {"images": ["http://i.ytimg.com/vi/JGftIcp2SC0/hqdefault.jpg", "http://i.ytimg.com/vi/JGftIcp2SC0/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "JGftIcp2SC0", "__model__": "Track", "name": "AC/DC - Touch Too Much (Official Video)", "uri": "youtube:video/ACDC - Touch Too Much (Official Video).JGftIcp2SC0", "length": 267000}, {"album": {"images": ["http://i.ytimg.com/vi/zakKvbIQ28o/mqdefault.jpg", "http://i.ytimg.com/vi/zakKvbIQ28o/hqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "zakKvbIQ28o", "__model__": "Track", "name": "AC/DC - You Shook Me All Night Long (from Live at River Plate)", "uri": "youtube:video/ACDC - You Shook Me All Night Long (from Live at River Plate).zakKvbIQ28o", "length": 265000}, {"album": {"images": ["http://i.ytimg.com/vi/xRQnJyP77tY/hqdefault.jpg", "http://i.ytimg.com/vi/xRQnJyP77tY/mqdefault.jpg"], "__model__": "Album", "name": "YouTube"}, "comment": "xRQnJyP77tY", "__model__": "Track", "name": "AC/DC - Shoot To Thrill (Iron Man 2 Version)", "uri": "youtube:video/ACDC - Shoot To Thrill (Iron Man 2 Version).xRQnJyP77tY", "length": 333000}], "uri": "youtube:search"}]}'

Is it possible to get the rest of the error message?

@Vincent_Bodsworth Do you see the same SSL error message in your log? Want to try running:

apt-get update && apt-get install gcc python-dev libffi-dev
pip install -U 'requests[security]'

#4

Hey,

no solution after tons of searching, I’ve abandoned this project because of
that.


#5

Everything else I have tried works OK, and I find the system fine for playing radio stations, which is my main requirement. So I will take out the You Tube function for now, and return to it if I have spare time.


#6

OK, when someone can help debugging we can try and fix this.


#7

Some progress, although no explanations or debugging. I re-installed MusicBox on a PI Zero and got some results when I searched Youtube. But nothing played when I selected it. It appeared to be playing, but no audio.
What specifically should I collect for debugging. I have some skills with linux (logging in with ssh, editing examining files etc) but not in depth.


#8

I haven’t seen anything like those error messages in my log.
I tried to run the scripts you mentioned. The first one aborts even if I answer yes to a question about continuing.
The second one gives this error message. (or should the secondone be just a continuation of the first?

You must give at least one requirement to install (see “pip help install”)
/usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning


#9

You can enable debug level Logging for Mopidy through the web settings.

They were two separate commands.

  1. apt-get update && apt-get install gcc python-dev libffi-dev
  2. pip install -U 'requests[security]'

We just have to ignore those InsecurePlatformWarning messages, the version of python in Wheezy is older than what pip would like to use. I don’t know of a simple fix for that.

But, to be honest, those suggestions were aimed at resolving the mystery SSL error. If you get search results and something at least pretends to play then it’s probably something else. The log might still tell you something helpful. If you give me the URL of the video (the Streams page has a “Get Now Playing” button you can use) then I can try to reproduce the problem.


#10

I had the same issue as @Piotr_Rosinski. Mine was a fresh install of v0.7.0RC5 on an RPi 3. I could not get YouTube search to work for me, with the same experience as above: I would search on YouTube and get no results. I did NOT capture any logs files… however I did login via SSH and manually did an "apt-get update && apt-get dist-ugrade. A number of packages were updated, and after a reboot I was able to search YouTube.

I can replicated this experience from scratch if necessary, if someone is interested in my log files. Just posting this here as a possible way forward for some people experiencing the same issue. Do a system update after installing!