Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubleshooting #1182

Closed
AxlMemote opened this issue Dec 28, 2021 · 3 comments
Closed

Troubleshooting #1182

AxlMemote opened this issue Dec 28, 2021 · 3 comments

Comments

@AxlMemote
Copy link

Hello, there was problem with quota limit so I set my own API, however, I get this whenever I start playing anything:

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'
Traceback (most recent call last):                                                                                                                                                             
  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.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'
@Rom1deTroyes
Copy link

Rom1deTroyes commented Dec 29, 2021

Youtube has changed the dislike functionality : you can still vote to dislike a video, but there is no dislike count displayed with the video, thus this key is no more available in the video description.

@onixldlc
Copy link

onixldlc commented Jan 6, 2022

the dislike key error has been fixed... but for some reason the pafy that came with mps-youtube didnt have these changes (the fix was already from 10 months ago from today)
mps-youtube/pafy@110bf7c
just replace the old backend_youtube_dl.py with the new one from https://github.com/mps-youtube/pafy/blob/110bf7c01dcf57ec4e6e327e0c7907a4099d6933/pafy/backend_youtube_dl.py

or just change the
self._dislikes = self._ydl_info['dislike_count']
to
self._dislikes = self._ydl_info.get('dislike_count', 0)

the default location is:
/usr/local/lib/python3.8/site-packages/pafy/backend_youtube_dl.py

@iamtalhaasghar
Copy link
Contributor

closed in favor of #1180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants