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
8k stars 643 forks source link

Doesn't start with "OSError: [Errno 22]" #1162

Closed galgot closed 1 year ago

galgot commented 3 years ago

mpsyt gives me this error :

Traceback (most recent call last):
  File "/Users/galgot/Library/Python/3.9/bin/./mpsyt", line 5, in <module>
    from mps_youtube import main
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/__init__.py", line 8, in <module>
    init.init()
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/init.py", line 57, in init
    _init_readline()
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/init.py", line 207, in _init_readline
    readline.read_history_file(g.READLINE_FILE)
OSError: [Errno 22] Invalid argument

I had mpsyt not working for a long time on a MBP 17 » running MacOSX 10.11.6. Knew it was something wrong with my Macports install, today finally resolved to completely remove, then reinstall Macports. Have Python39 and Pip39 installed via Macports. And thus proceeded in reinstalling mps-youtube. Followed this guide :

1143

Mpsyt version is:

mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2021.04.07
Python version     : 3.9.4 (default, Apr  6 2021, 11:29:52)
[Clang 8.0.0 (clang-800.0.42.1)]
Processor          : i386
Machine type       : x86_64
Architecture       : 64bit,
Platform           : macOS-10.11.6-x86_64-i386-64bit
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /Users/galgot/.config/mps-youtube
env:TERM           : xterm
env:SHELL          : /bin/bash
env:LANG           : fr_FR.UTF-8

My OS is MacOSX 10.11.6 El Capitan. Music player is MPV version 0.33.1 installed via Macports. And btw Macports installs YouTube-dl as a MPV dependency. So if I try : pip3 install —user YouTube-dl I get this: Requirement already satisfied: youtube-dl in /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (2021.4.7) Don’t know if that could be the cause of the trouble.

I really have problem having mpsyt running on this particular machine… Could have it to run on much older system , like OS X 10.4 Tiger PPC, but this one must have a bad mpsyt mojo. Any help appreciated.

galgot commented 3 years ago

Ok... So removing /user/galgot/.config/mps-youtube solved the "OSError: [Errno 22]" problem. mpsyt launched. But setting player to MPV , it play the track, but if I stop it (q) , it quits with

File "/Users/galgot/Library/Python/3.9/bin/./mpsyt", line 33, in <module>
    sys.exit(load_entry_point('mps-youtube==0.2.8', 'console_scripts', 'mpsyt')())
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/main.py", line 153, in main
    if matchfunction(i.function, i.regex, userinput):
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/main.py", line 70, in matchfunction
    func(*matches)
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/commands/play.py", line 102, in play
    g.PLAYER_OBJ.play(songlist, shuffle, repeat, override)
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/player.py", line 79, in play
    self._playsong()
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/player.py", line 138, in _playsong
    self._launch_player()
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/player.py", line 298, in _launch_player
    self.launch_player(cmd)
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/players/mpv.py", line 135, in launch_player
    self._player_status(self.songdata + "; ", self.song.length)
  File "/Users/galgot/Library/Python/3.9/lib/python/site-packages/mps_youtube/players/mpv.py", line 188, in _player_status
    if resp['data'] is not None:
KeyError: 'data'

setting player to Mplayer, it works fine. tho it displays

/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:941: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  self.stdout = io.open(c2pread, 'rb', bufsize)

Before playing the track...