Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Youtube URI not working with iris and mopidy #150

Closed
eziosoma opened this issue Jul 5, 2020 · 20 comments
Closed

Youtube URI not working with iris and mopidy #150

eziosoma opened this issue Jul 5, 2020 · 20 comments
Assignees
Labels

Comments

@eziosoma
Copy link

eziosoma commented Jul 5, 2020

I copy the URI from the example and add it to play. Nothing appens.
with the command
sudo systemctl status mopidy
I see:

lug 05 12:45:41 raspberrypi mopidy[363]: _compat.reraise(*self._data['exc_info'])
lug 05 12:45:41 raspberrypi mopidy[363]: File "/usr/lib/python3/dist-packages/pykka/_compat/init.py", line 29, in reraise
lug 05 12:45:41 raspberrypi mopidy[363]: raise value
lug 05 12:45:41 raspberrypi mopidy[363]: File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 193, in _actor_loop
lug 05 12:45:41 raspberrypi mopidy[363]: response = self._handle_receive(envelope.message)
lug 05 12:45:41 raspberrypi mopidy[363]: File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 299, in _handle_receive
lug 05 12:45:41 raspberrypi mopidy[363]: return callee(*message.args, **message.kwargs)
lug 05 12:45:41 raspberrypi mopidy[363]: File "/usr/local/lib/python3.7/dist-packages/mopidy_youtube/backend.py", line 194, in loo
lug 05 12:45:41 raspberrypi mopidy[363]: name=video.title.get().replace(";", ""),
lug 05 12:45:41 raspberrypi mopidy[363]: AttributeError: 'NoneType' object has no attribute 'replace'

@natumbri
Copy link
Owner

natumbri commented Jul 5, 2020

Sorry to hear it is not working for you. What is the uri you are trying?

@eziosoma
Copy link
Author

eziosoma commented Jul 5, 2020 via email

@natumbri
Copy link
Owner

natumbri commented Jul 5, 2020

Thanks for confirming @eziosoma. I've now tested Njpw2PVb1c0 at my end, and it works fine for me.

  • Are all videos failing, or just particular ones?
  • Which version of mopidy-youtube are you using? The released version on pypi is starting to get a bit old, and I haven't managed to update it yet. You might consider trying the current version in the develop branch here on github, if you're not already using that - it is more likely to work.

The following things don't look relevant to you, judging by the systemctl status you have posted, but it is perhaps worth checking:

  • Are all your python modules up-to-date (particularly youtube-dl)?
  • Did you upgrade from mopidy 2 to mopidy 3? That has introduced gremlins for some people.

@jannislehmann
Copy link

Hey 👋
I am facing the same issue.
For me, every video and/or searching by title fails without an error in the logs.

The version I am using it the latest one in pypi, since I am using a docker container that pulls the addons.
All python modules should be up-to-date as I just recreated the container.

@eziosoma
Copy link
Author

eziosoma commented Jul 7, 2020 via email

@natumbri
Copy link
Owner

natumbri commented Jul 8, 2020

Hi @eziosoma and @Cludch

Thanks for your further reports. I've pushed some small changes to the develop branch here on github. Do either of you have any capacity to give the new version a try? If someone can confirm that it helps, I'll try to push it out to pypi as a new version 3.1.

Thanks again for raising this - hopefully we can get it fixed!

Cheers,
Nik

@eziosoma
Copy link
Author

eziosoma commented Jul 10, 2020

Hi,
I had a test by installing mopidy-youtube extension from github by running:

python3 -m pip install https://github.com/natumbri/mopidy-youtube/archive/develop.zip

but nothing changed.

The first time I added the URI i got from the command

sudo systemctl status mopidy

this result:

lug 10 18:24:23 raspberrypi mopidy[1943]: raise value
lug 10 18:24:23 raspberrypi mopidy[1943]: File "/usr/lib/python3/dist-packages/pykka/_actor.py", lin
lug 10 18:24:23 raspberrypi mopidy[1943]: response = self._handle_receive(envelope.message)
lug 10 18:24:23 raspberrypi mopidy[1943]: File "/usr/lib/python3/dist-packages/pykka/_actor.py", lin
lug 10 18:24:23 raspberrypi mopidy[1943]: return callee(*message.args, **message.kwargs)
lug 10 18:24:23 raspberrypi mopidy[1943]: File "/usr/local/lib/python3.7/dist-packages/mopidy_youtub
lug 10 18:24:23 raspberrypi mopidy[1943]: name=video.title.get().replace(";", ""),
lug 10 18:24:23 raspberrypi mopidy[1943]: AttributeError: 'NoneType' object has no attribute 'replace'
lug 10 18:24:23 raspberrypi mopidy[1943]: [youtube] Njpw2PVb1c0: Downloading js player 3662280c
lug 10 18:24:26 raspberrypi mopidy[1943]: [youtube] Njpw2PVb1c0: Downloading js player 3662280c

That seems better than previous messages, but no success in reproducing the video track.

I have not enabled the yt API, I hope that this is not important.

@natumbri
Copy link
Owner

@eziosoma I'm sorry to hear it is still not working for you. You shouldn't need to use the yt API. (If you have an API key, you could try it, but that's not the cause of this bug.)

I'll keep thinking about what it could be...

@eziosoma
Copy link
Author

eziosoma commented Jul 11, 2020

Let me know if there is some log file or debug message that i can collect for you to better understand where the problem is. I am quite interested in having it working, because me and my son we have built a tiny device with a raspberry pi zero, Pirate sound hat of Pimoroni and Pisugar 900 mAh. It is a sort of "ipod nano" and works quite well, so we would like to add also the possibility of reproducing youtube.

@LucK1Y
Copy link

LucK1Y commented Jul 14, 2020

Hi,
I got the same error.
But journalctl -xe is printing some more details about this error:

Jul 14 10:07:26 raspberrypi mopidy[2878]: INFO     [YouTubeBackend-3] mopidy_youtube youtube LibraryProvider.lookup "yt: https://www.youtube.com/watch?v=xkAQ6bhpwYw"
Jul 14 10:07:32 raspberrypi mopidy[2878]: ERROR    [Thread-11] mopidy_youtube list_videos error "list index out of range"
Jul 14 10:07:32 raspberrypi mopidy[2878]: ERROR    [Core-7] mopidy.core.library YouTubeBackend backend caused an exception.
Jul 14 10:07:32 raspberrypi mopidy[2878]: Traceback (most recent call last):
Jul 14 10:07:32 raspberrypi mopidy[2878]:   File "/usr/lib/python3/dist-packages/mopidy/core/library.py", line 17, in _backend_error_handling
Jul 14 10:07:32 raspberrypi mopidy[2878]:     yield
Jul 14 10:07:32 raspberrypi mopidy[2878]:   File "/usr/lib/python3/dist-packages/mopidy/core/library.py", line 217, in lookup
Jul 14 10:07:32 raspberrypi mopidy[2878]:     result = future.get()
Jul 14 10:07:32 raspberrypi mopidy[2878]:   File "/usr/lib/python3/dist-packages/pykka/_threading.py", line 45, in get
Jul 14 10:07:32 raspberrypi mopidy[2878]:     _compat.reraise(*self._data['exc_info'])
Jul 14 10:07:32 raspberrypi mopidy[2878]:   File "/usr/lib/python3/dist-packages/pykka/_compat/__init__.py", line 29, in reraise
Jul 14 10:07:32 raspberrypi mopidy[2878]:     raise value
Jul 14 10:07:32 raspberrypi mopidy[2878]:   File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 193, in _actor_loop
Jul 14 10:07:32 raspberrypi mopidy[2878]:     response = self._handle_receive(envelope.message)
Jul 14 10:07:32 raspberrypi mopidy[2878]:   File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 299, in _handle_receive
Jul 14 10:07:32 raspberrypi mopidy[2878]:     return callee(*message.args, **message.kwargs)
Jul 14 10:07:32 raspberrypi mopidy[2878]:   File "/usr/local/lib/python3.7/dist-packages/mopidy_youtube/backend.py", line 194, in lookup
Jul 14 10:07:32 raspberrypi mopidy[2878]:     name=video.title.get().replace(";", ""),
Jul 14 10:07:32 raspberrypi mopidy[2878]: AttributeError: 'NoneType' object has no attribute 'replace'
Jul 14 10:07:39 raspberrypi sudo[3163]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/systemctl status mopidy

For me it seems like the error handling is thowing an error...as the "list index out of range" error is occuring before the main error.
Hope this somehow helps.

@natumbri
Copy link
Owner

natumbri commented Jul 14, 2020

Ok, thanks everybody - this must be quite frustrating for you all!

I'm not too sure what is going on, so...

  • I've created a new branch specifically for diagnosing, fixing and testing this issue
  • the new branch is fix/issue-150
  • the new branch is based on develop with one addition ...
  • ... the new branch saves a file to /tmp each time a search is run; the file contains the search results

It would be useful if people could

  • install that branch
  • run a search for dylan
  • upload the file that is generated (/tmp/dylan.mopidy_youtube.search) to the internet somewhere (dropbox, google drive, etc), and send me a link

I'll look at those files, and then at least I'll know if you are getting similar results back from youtube to what I am getting. And, I can feed those results into my system here to see if I can duplicate the error (and fix it). If you're getting wildly different results to what I'd expect ... well, there might need to be some more fundamental changes.

I had a couple of goes here and couldn't find any private information in the search results. Feel free to have a look and, if you find private information feel free to

  • tell everyone what kind of information it is, and that it is included in the search results, and maybe where (so we all know),
  • replace it with an x for each character, so secret would become xxxxxx

As I said, I don't think there is anything like that in there, but I certainly wouldn't discourage anyone who wants to double check from doing so.

Ok, please, generate some dylan searches and send me links to the files!

Thanks for your help,
Nik

@natumbri natumbri added the bug label Jul 14, 2020
@natumbri natumbri self-assigned this Jul 14, 2020
@LucK1Y
Copy link

LucK1Y commented Jul 16, 2020

Hi,
it was a mistake from my side. I didn't check the update output properly.
To override the newest version I had to add the --upgrade flag.

sudo python3 -m pip install --upgrade https://github.com/natumbri/mopidy-youtube/archive/fix/issue-150.zip

Now everything is working 👍

Nevertheless, I created the output file for the search:
https://gist.github.com/LucK1Y/0f9bb2c396cd5cbb07cf8a970cc18fbb#file-dylan-mopidy_youtube-search

@eziosoma
Copy link
Author

Hello,
I have executed the same command of LucK1Y without success. The file is not generated and no result in the search.
My environment is a Raspberry PI zero.
Any suggestion or test to do?

@natumbri
Copy link
Owner

@LucK1Y glad to hear it is working for you, and thanks for uploading the file. I'll have a look at it, to make sure it is as expected, but it sounds like you are good to go. Don't forget to switch back to the develop branch, to avoid generating a new file every time you run a search.

@eziosoma I'm sorry to hear it is still not working for you. I will try to think of some new things to test, to see if we can get it working!

@tschenek
Copy link

tschenek commented Jul 17, 2020

Hi,
For me it was same as in @eziosoma case. Mopidy-youtube stopped working several weeks ago with same errors in log. I installed issue-150 version as @LucK1Y mentioned, Still mopidy-youtube didnt play anything and no log was created. Then I tried to run
sudo python3 -m pip install --upgrade https://github.com/natumbri/mopidy-youtube/archive/fix/issue-150.zip
and everything started working. Finally a switched to the develop version and everything is running smoothly. The key was in installing with sudo. I'm a beginner in this so I don't know why but it could help you too.

@eziosoma
Copy link
Author

eziosoma commented Jul 18, 2020

Many thanks @tschenek, installing the development version with sudo and restarting mopidy solved also my problem.

@vdmkenny
Copy link

I had the same issue, 3.0 did not work. The provided fix seemed to have worked! Please release it as an update on pypi!

@natumbri
Copy link
Owner

@vdmkenny thanks for trying. I've pushed it out to pypi as v3.1. I haven't really tested it much, so fingers crossed.

@ruuda
Copy link

ruuda commented Jul 25, 2020

This bug affected me as well, and I can confirm that 3.1 fixes it, thanks!

@blauertee
Copy link

blauertee commented Jul 26, 2020

I can confirm as well that I can search, find and play videos, since the update. Which is everything I wanted.

What still does not work for me though is playing a specific video or playlist by URL.

Specifically searching for:
yt:http://www.youtube.com/playlist?list=PLeCg_YDclAETQHa8VyFUHKC_Ly0HUWUnq
or
yt:http://www.youtube.com/watch?v=Njpw2PVb1c0
in filename does not give me any results.

EDIT:

I just discovered that searching for URLs in "Any" does work though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants