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

Problem with python #1187

Closed brambori closed 2 years ago

brambori commented 2 years ago

When i try select any track i get python error

Issue / Suggestion

This problem prevents me from playing anything. I trying other os and mpsyt versions but it still not work

Traceback (most recent call last):
File "/usr/bin/mpsyt", line 33, in sys.exit(load_entry_point('mps-youtube==0.2.8', 'console_scripts', 'mpsyt')()) File "/usr/lib/python3.10/site-packages/mps_youtube/main.py", line 148, in main if matchfunction(i.function, i.regex, userinput): File "/usr/lib/python3.10/site-packages/mps_youtube/main.py", line 65, in matchfunction func(matches) File "/usr/lib/python3.10/site-packages/mps_youtube/commands/play.py", line 100, in play play_range(songlist, shuffle, repeat, override) File "/usr/lib/python3.10/site-packages/mps_youtube/player.py", line 49, in play_range video, stream = stream_details(song, override=override, softrepeat=softrepeat) File "/usr/lib/python3.10/site-packages/mps_youtube/player.py", line 159, in stream_details streams.get(song, force=failcount, callback=screen.writestatus) File "/usr/lib/python3.10/site-packages/mps_youtube/streams.py", line 51, in get p = util.get_pafy(vid, force=force, callback=callback) File "/usr/lib/python3.10/site-packages/mps_youtube/util.py", line 205, in get_pafy p = pafy.new(ytid, callback=callback_fn) File "/usr/lib/python3.10/site-packages/pafy/pafy.py", line 124, in new return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) File "/usr/lib/python3.10/site-packages/pafy/backend_youtube_dl.py", line 31, in init super(YtdlPafy, self).init(args, **kwargs) File "/usr/lib/python3.10/site-packages/pafy/backend_shared.py", line 97, in init self._fetch_basic() File "/usr/lib/python3.10/site-packages/pafy/backend_youtube_dl.py", line 54, in _fetch_basic self._dislikes = self._ydl_info['dislike_count'] KeyError: 'dislike_count'

This error i see when i select any track in mpsyt on garuda linux

Exception in thread Thread-1 (_preload): Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 946, in run self._target(*self._args, *self._kwargs) File "/usr/lib/python3.10/site-packages/mps_youtube/streams.py", line 180, in _preload streamlist = get(song) File "/usr/lib/python3.10/site-packages/mps_youtube/streams.py", line 51, in get p = util.get_pafy(vid, force=force, callback=callback) File "/usr/lib/python3.10/site-packages/mps_youtube/util.py", line 205, in get_pafy p = pafy.new(ytid, callback=callback_fn) File "/usr/lib/python3.10/site-packages/pafy/pafy.py", line 124, in new return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) File "/usr/lib/python3.10/site-packages/pafy/backend_youtube_dl.py", line 31, in init super(YtdlPafy, self).init(args, **kwargs) File "/usr/lib/python3.10/site-packages/pafy/backend_shared.py", line 97, in init self._fetch_basic() File "/usr/lib/python3.10/site-packages/pafy/backend_youtube_dl.py", line 54, in _fetch_basic self._dislikes = self._ydl_info['dislike_count'] KeyError: 'dislike_count'

this one from win10

Exception in thread Thread-1: Traceback (most recent call last): File "e:!!programy\python\lib\threading.py", line 917, in _bootstrap_inner self.run() File "e:!!programy\python\lib\threading.py", line 865, in run self._target(*self._args, *self._kwargs) File "e:!!programy\python\lib\site-packages\mps_youtube\streams.py", line 180, in _preload streamlist = get(song) File "e:!!programy\python\lib\site-packages\mps_youtube\streams.py", line 51, in get p = util.get_pafy(vid, force=force, callback=callback) File "e:!!programy\python\lib\site-packages\mps_youtube\util.py", line 205, in get_pafy p = pafy.new(ytid, callback=callback_fn) File "e:!!programy\python\lib\site-packages\pafy\pafy.py", line 124, in new return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) File "e:!!programy\python\lib\site-packages\pafy\backend_youtube_dl.py", line 31, in init super(YtdlPafy, self).init(args, **kwargs) File "e:!!programy\python\lib\site-packages\pafy\backend_shared.py", line 97, in init self._fetch_basic() File "e:!!programy\python\lib\site-packages\pafy\backend_youtube_dl.py", line 54, in _fetch_basic self._dislikes = self._ydl_info['dislike_count'] KeyError: 'dislike_count'

That is probably same problem or something similar

I trying many versions of mps-youtube and youdtube-dl from repository from aur from python via pip3 i tested vlc and mpv as player i changed api key (2 times) i changed python version from 3.7 to 3.8 -> 3.9 and finally 3.10 nothing hapend i tested it in windows 10 too but it still not work correctly.

I like your software and would like to keep using it, but I have no idea what else to do. Can someone tell me what i need to do for make it finally work?

Zrzut ekranu (3161) Zrzut ekranu z 2022-01-11 18-05-46

Your Environment

Primary pc for this issue is:

OS: Manjaro Linux x86_64 Host: LIFEBOOK NH570 Kernel: 5.10.89-1-MANJARO Shell: bash 5.1.12 DE: GNOME 41.2 WM: Mutter Terminal: gnome-terminal CPU: Intel i5 M 460 (4) @ 2.534GHz GPU: Intel Core Processor Memory: 3726MiB

mpsyt "set"

Key Value
order : relevance user_order : max_res : 2160p player : vlc playerargs : encoder : 0 [None] notifier : checkupdate : True show_status : True columns : ddir : /home/mangnom/Pobrane/mps overwrite : True show_video : False search_music : True download_command : lastfm_username : lastfm_password : lastfm_api_key : lastfm_api_secret : audio_format : auto video_format : auto api_key : (working api_key) autoplay : False set_title : True mpris : True

mpsyt version for manjaro

mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2021.12.17 Python version : 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0] Processor : Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-5.10.89-1-MANJARO-x86_64-with-glibc2.33 sys.stdout.enc : utf-8 default enc : utf-8 Config dir : /home/mangnom/.config/mps-youtube env:TERM : xterm-256color env:SHELL : /bin/bash env:LANG : pl_PL.UTF-8

mpv 0.34.0-120-gf40d66f624 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects built on UNKNOWN FFmpeg library versions: libavutil 57.13.100 libavcodec 59.15.102 libavformat 59.12.100 libswscale 6.1.102 libavfilter 8.21.100 libswresample 4.0.100 FFmpeg version: N-105049-g9cfc7a2440

mpsyt --version for win 10

mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2021.12.17 Python version : 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] Processor : AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD Machine type : AMD64 Architecture : 64bit, WindowsPE Platform : Windows-10-10.0.18362-SP0 sys.stdout.enc : utf-8 default enc : utf-8

mpsyt --version for garuda os in virutalbox (for testing)

mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2021.12.17 Python version : 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0] Processor : Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-5.15.12-zen1-1-zen-x86_64-with-glibc2.33 sys.stdout.enc : utf-8 default enc : utf-8 Config dir : /root/.config/mps-youtube env:TERM : xterm-256color env:SHELL : /bin/bash env:LANG : en_US.UTF-8

ximi75 commented 2 years ago

try it worked for me

an EndeavourOS

probier damit bei mir hat funktioniert

The easiest fix is to go into site-packages/pafy/backend_youtube_dl.py and comment out this line

self._dislikes = self._ydl_info['dislike_count']

brambori commented 2 years ago

try it worked for me

an EndeavourOS

probier damit bei mir hat funktioniert

The easiest fix is to go into site-packages/pafy/backend_youtube_dl.py and comment out this line

self._dislikes = self._ydl_info['dislike_count']

Thanks i will test it

brambori commented 2 years ago

try it worked for me

an EndeavourOS

probier damit bei mir hat funktioniert

The easiest fix is to go into site-packages/pafy/backend_youtube_dl.py and comment out this line

self._dislikes = self._ydl_info['dislike_count']

I tested it but still not work. Looks like same errror Screenshot_2022-01-17_16-05-44

brambori commented 2 years ago

i installed mps-youtube youtube-dl mpv vlc, I set mpv as a player and my api key

brambori commented 2 years ago

try it worked for me

an EndeavourOS

probier damit bei mir hat funktioniert

The easiest fix is to go into site-packages/pafy/backend_youtube_dl.py and comment out this line

self._dislikes = self._ydl_info['dislike_count']

You are genius, commenting that line solve my problem. Thank You

mlliarm commented 2 years ago

try it worked for me

an EndeavourOS

probier damit bei mir hat funktioniert

The easiest fix is to go into site-packages/pafy/backend_youtube_dl.py and comment out this line

self._dislikes = self._ydl_info['dislike_count']

Thanks, it worked for me too with python 3.9.0 on:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:    18.04
Codename:   bionic

Linux Newton 4.15.0-169-generic #177-Ubuntu SMP Thu Feb 3 10:50:38 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Great fix !