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
Getting mps-youtube up and running -- if you're experiencing issues check here first #1143
Comments
@windowswithoutborders excellent work outlining the steps required, it will help future users to properly get mpsyt up and running.I do wonder why the devs have a lack of interest in updating this project with the necessary fixes. |
even after all of this i still end up with |
Ah, sorry to hear that. Not that I have any solution, but for troubleshooting purposes could you post the output of For me on macOS with pipx:
|
I had the same issue when installing the stable branch. When I switched to the development branch, this issue was fixed for me (I just installed the development branch, didn't explicitly remove the stable branch). |
Is it possible to use it without an API? I have no problem playing audio or video with Mpv and I have not set any API whatsoever with it. |
Can confirm that switching to dev fixed this one. Thanks! |
I followed and i get this error
|
I've been using mps-youtube for a couple weeks now and absolutely love it. Unfortunately, it's not as simple as installing it to get it up and running. But through the work of some skilled and helpful people on here, I'd like to share the additional steps that have been discovered that should get mps-youtube working again. I hope this can benefit those just coming across this project and understanding the appeal of a program like this. Note, these steps resulted in a perfectly usable mps-youtube on arch and macos. And of course, all of this assumes you have a player installed. I use mpv and will mention certain issues specific to mpv.
Anyways, let's start with installation:
Installing
or
I say get the development branch. I'm sure there are some other differences, but I noticed the development branch added tab complete to the set parameters you'll choose within mpsyt, which is actually pretty nice. I haven't noticed any bugs in the branch either so it seems perfectly usable.
Be sure to get the dependencies as well. Although I already had youtube-dl installed through my package manager, mps-youtube wouldn't work until I got it from pip. If you do have youtube-dl on your system through a package manager, potential conflicts between the two packages won't be an issue as the
--user
install flag ensures that it is only installed locally to your user. That is to say, should you invoke youtube-dl on your command line, your path variable should choose the youtube-dl bin from the package manager over the one installed from pip.You can upgrade these packages with
$ pip3 install --user <package-name> --upgrade
OPTIONAL: Installing with pipx
It doesn't really matter, but I prefer to use pipx for installing packages from pip just to isolate them that much further from packages installed from my package manager. Pipx will install packages into their own isolated virtual environments. I especially like doing this on macOS because pipx will install packages into ~/.local, which is where I would expect
pip install --user
to place them, but on mac they go into ~/Library/Python instead.You can upgrade with
$ pipx upgrade-all --include-injected ### upgrade everything installed through pipx
Create a youtube api key
Despite the installation being complete, don't bother with a first run of
mpsyt
, you're going to want to create a youtube api key to use with mpsyt first. This is discussed at length in this thread #1063. It's reiterated multiple ways in the thread, but this specific comment #1063 (comment) quickly goes over the steps required for creating an api key:I wouldn't bother with a first launch yet to set your api key, because if you're using mpv, you're probably going to experience playback issues anyways.
Fixing MPV issues
So this issue has been discussed here #1134 (comment) and here #1128 (comment). Apparently the solution detailed in #1134 works, but I needed to follow the steps in #1128 to get it to work for me. The steps are self-explanatory, so try either method. The one thing to note is the location of these files. Use the following commands to find where mps-youtube is located on your system:
You'll ultimately end up in the ../site-packages/mps_youtube directory
Let's go over the steps in #1128 for fixing mpv playback. You'll have to add a line of code to two files.
The code:
if 'data' in resp:
The files:
../site-packages/mps_youtube/mpris.py
and
../site-packages/mps_youtube/player.py
(STABLE BRANCH)OR
../site-packages/mps_youtube/players/mpv.py
(DEV BRANCH)the code to edit comes after the comment in both files: "# deals with bug in mpv 0.7 - 0.7.3". Search this line in your editor and you should be able to easily spot where you need to add the code from there. The code must look like this:
mpris.py
++ if 'data' in resp: if resp.get('event') == 'property-change': self.setproperty(resp['name'], resp['data'])
player.py OR player/mpv.py
++ if 'data' in resp: if resp.get('event') == 'property-change' and resp['id'] == 1: if resp['data'] is not None: elapsed_s = int(resp['data'])
With all of that out of the way, we can go onto configuring mps-youtube.
First launch and configuration
Run
mpsyt
and type in set. You'll see a list of parameters you can specify. The most important beingapi_key
. Get the youtube api key you created and pass it into mpsyt. Additionally, you can set these extra parameters as well:With all that being done, type
q
to quit, navigate to ~/.config/mps-youtube and delete the cache file inside. Relaunch mpsyt and play your first video. I hope it worked!Closing
Thank you to the author of this program, all contributors, and everyone who left a comment addressing the issues that have popped up. Stuff like that is why I love the open-source community. This is a great project and with some tweaking here and there it's still perfectly usable. I hope this will benefit you and your workflow the way it has for me. Be sure to look into the set parameters and dialing them into what works best for you, for instance I have some arguments set for playerargs. Also, look into the help section, especially
help basic
help search
help invoke
help config
andhelp tips
. Enjoy mps-youtube :).TLDR
KeyError: data
when trying to play video??)Troubleshooting
The text was updated successfully, but these errors were encountered: