mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.07k stars 648 forks source link

Error parsing commandline option title: option requires parameter #1058

Closed st-f closed 1 year ago

st-f commented 4 years ago

When playing a video (after entering a search result index)

Error parsing commandline option title: option requires parameter

Issue / Suggestion

Probably related to https://github.com/mps-youtube/mps-youtube/issues/1054

Your Environment

macOS Catalina mps-youtube 0.2.8

mirkojovanovic commented 4 years ago

Same version, same issue. Running Arch Linux.

belcerca commented 4 years ago

And in Fedora 31.

AdrienLemaire commented 4 years ago

Finally manually fixed my issue with #1063, but I'm now getting this error too ^^'

Arch linux mps-youtube 0.2.8-3 youtube-dl 2020.03.01-1

kernelkind commented 4 years ago

Also getting this error,

Arch Linux mps-youtube 0.2.8 youtube-dl 2020.02.16

cirrusUK commented 4 years ago

apparently this is a change in mpv code, as a workaround consider using cvlc in the interim

AdrienLemaire commented 4 years ago
  $ pacman -F cvlc
  extra/vlc 3.0.8-7
  $ pacman -S vlc
  $ rm ~/.config/mps-youtube/cache_py_3.8.*  # looks like I need to run this on a daily basis
  $ mpsyt
  > set player cvlc
  > /finally some music!

Thanks @cirrusUK !

cirrusUK commented 4 years ago

$ rm ~/.config/mps-youtube/cache_py_3.8.* # looks like I need to run this on a daily basis

try adding this to crontab

@daily rm -rf ~/.config/mps-youtube/cache_py_3.8.*

also ensure you have set your new api key in /lib/python3.8/site-packages/pafy/g.py as well as /lib/python3.8/site-packages/mps_youtube/config.py

diego-treitos commented 4 years ago

Another quick fix for this:

  1. Create script to launch mpv in /home/user/.config/mps-youtube/mpv.sh

    #!/bin/bash
    shift
    mpv --title=$@

    Do not forget to chmod 755 /home/user/.config/mps-youtube/mpv.sh

  2. Inside the application execute set player /home/user/.config/mps-youtube/mpv.sh

DONE

TalhaAkber commented 4 years ago

for Arch Users, I just downgraded mpv from mpv-1:0.32.0-1 to mpv-1:0.31.0-2 and that fixes the problem

pacman -U /var/cache/pacman/pkg/mpv-1:0.31.0-2-x86_64.pkg.tar.zst

kz6wk9 commented 4 years ago

This issue is already fixed in mspyt develop branch since the day mpv got it's release that changed the command line parameters, the best solution is to use the develop branch from this repository, it is not recommend downgrading mpv nor running scripts to try to solve this because it obviously can lead to other (even more harmful) problems (eg. mpv did not only changed the syntax for it's cli parameters with the latest release, but enhancements, bug fixes, feature additions and other improvements were made too), leave this kinda solutions as last resort, and use the recommended one. You can git clone this repo yourself or use pip +git<url> to install directly from here using pip.

AdrienLemaire commented 4 years ago

@deracinator when will a new version be released with this fix? I'd rather keep mps-youtube managed by my package manager (pacman). I've been using cvlc for the past month, but being unable to seek or go to next/previous tracks is a bit annoying.

edit: well, don't mind my message

darkhz commented 3 years ago

@st-f Hi there, I believe I've fixed this issue.

The fix needs to applied to: $PATH_TO_PYTHON_LIB/python3.9/site-packages/mps_youtube/player.py

In player.py, after this line of code (line number 316):

util.list_update("--no-ytdl", args)

Add the following lines of code:

util.list_update("--title", args, remove=True);
util.list_update("--title=" + song.title, args)

The code looks like this:

...
elif "mpv" in config.PLAYER.get:
            if "--ytdl" in g.mpv_options:
                util.list_update("--no-ytdl", args)

            util.list_update("--title", args, remove=True);
            util.list_update("--title=" + song.title, args)

            msglevel = pd["msglevel"]["<0.4"]

            #  undetected (negative) version number assumed up-to-date
            if g.mpv_version[0:2] < (0, 0) or g.mpv_version[0:2] >= (0, 4):
                msglevel = pd["msglevel"][">=0.4"]
...

Make sure you take care of the indents.

Note: If you get a "KeyError: data" exception, refer to this issue: #1128

This fixed it for me, and I'm able to play audio very well on mpv.

darkhz commented 3 years ago

This issue is already fixed in mspyt develop branch since the day mpv got it's release that changed the command line parameters, the best solution is to use the develop branch from this repository, it is not recommend downgrading mpv nor running scripts to try to solve this because it obviously can lead to other (even more harmful) problems (eg. mpv did not only changed the syntax for it's cli parameters with the latest release, but enhancements, bug fixes, feature additions and other improvements were made too), leave this kinda solutions as last resort, and use the recommended one. You can git clone this repo yourself or use pip +git<url> to install directly from here using pip.

I tried all possible combinations in my case, installing via package manager, then pip, even trying a docker image to see if this annoying issue gets resolved,but each method had its own issues.

I installed both the stable and development branch.No effect. I'm on Arch, so the specific packages are mps-youtube and mps-youtube-git.

After digging through the code, I procured the above fix.I don't know if its valid/will work for most users, but mpv works excellently for me now.No errors of any kind.