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.09k stars 644 forks source link

Crashes on every video now #1127

Closed RLarkins closed 1 year ago

RLarkins commented 3 years ago

As of yesterday, though most likely the 25th, mps-youtube crashes on any video played. Either before the video starts or just after it finishes, mps-youtube crashes. This has been tested with the most recent version of mpsyt, to the same result.

The error message given is:

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

OS: Arch Linux Kernel: 5.4.79-1-lts mps-youtube version: 0.2.8.r163.g4c6ee0f-1 (as reported by package manager) mpv version: 1:0.33.0-3 (as reported by package manager)

selatinabi commented 3 years ago

Install vlc player instead of mpv player ' set player vlc '

mpsyt --version mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2020.11.26 Python version : 3.8.6 (default, Sep 30 2020, 04:00:38) [GCC 10.2.0] Processor : Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-5.9.10-arch1-1-x86_64-with-glibc2.2.5 sys.stdout.enc : utf-8 default enc : utf-8 Config dir : /home/user/.config/mps-youtube env:TERM : xterm-256color env:SHELL : /usr/bin/zsh env:LANG : tr_TR.UTF-8 env:LANGUAGE : tr:en_US

RLarkins commented 3 years ago

Given the mentions of mpv in both the code and documentation with explicit mention of it being a supported and, in some cases, recommended player, I cannot see the use of another player as a fix. Additionally, I cannot overstate my preference for mpv in this situation, as well as the degree in which it is integrated into the rest of my operating system experience.

Thus I prefer to submit this issue and information in the hopes of it being remedied, rather than the issue being ignored by moving to another player, and risking it also being affected by something similar in the future.

4nd3r50nm4ca8r3 commented 3 years ago

An alternative solution for using arch and downgrading the mpv version while they fix this bug, I tested the mpv-1 version: 0.32.0-6 and it works perfectly and can be downloaded from the arch archive link: https://archive.archlinux.org/packages/m/mpv/mpv-1%3A0.32.0-6-x86_64.pkg.tar.zst then use the command pacman -U mpv-1_0.32.0-6-x86_64.pkg.tar.zst. Note to update the system use the commandpacman -Syyu --ignore mpv

Masacaai commented 3 years ago

This is a duplicate of this issue. Apply the changes mentioned in that commit and it should start working as intended.