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

KeyError: data #1134

Closed louisabraham closed 1 year ago

louisabraham commented 3 years ago

Issue / Suggestion

On any video:

Exception in thread Thread-2: Mb                                             
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/mpris.py", line 227, in bindmpv
    self.setproperty(resp['name'], resp['data'])
KeyError: 'data'
Traceback (most recent call last):
  File "/usr/bin/mpsyt", line 11, in <module>
    load_entry_point('mps-youtube==0.2.8', 'console_scripts', 'mpsyt')()
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/main.py", line 153, in main
    if matchfunction(i.function, i.regex, userinput):
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/main.py", line 70, in matchfunction
    func(*matches)
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/commands/play.py", line 102, in play
    g.PLAYER_OBJ.play(songlist, shuffle, repeat, override)
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/player.py", line 79, in play
    self._playsong()
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/player.py", line 138, in _playsong
    self._launch_player()
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/player.py", line 298, in _launch_player
    self.launch_player(cmd)
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/players/mpv.py", line 134, in launch_player
    self._player_status(self.songdata + "; ", self.song.length)
  File "/home/louisabraham/.local/lib/python3.8/site-packages/mps_youtube/players/mpv.py", line 187, in _player_status
    if resp['data'] is not None:
KeyError: 'data'

Your Environment

mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2020.12.14
Python version     : 3.8.6 (default, Oct  6 2020, 22:56:58) 
[GCC 10.2.0]
Processor          : 
Machine type       : aarch64
Architecture       : 64bit, ELF
Platform           : Linux-5.9.11-2-MANJARO-ARM-aarch64-with-glibc2.17
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /home/louisabraham/.config/mps-youtube
env:TERM           : xterm-256color
env:SHELL          : /bin/bash
env:LANG           : en_US.utf8
vabenil commented 3 years ago

I had the same issue on python3.9 and applying the https://github.com/louisabraham/mps-youtube/commit/234bc691f43f6df88d831409b2887fda45270636 commit fixed it.

vikasrawal commented 3 years ago

Is this going to be fixed? Makes mps-youtube unusable.

sgmihai commented 2 years ago

First time trying mps-youtube. First I had the dislike API error, which I fixed by using pafy-git instead of stable. Now I get this error. Is there any fork of this project that has at least the basic fixes implemented ?