skip to Main Content

this is my code it is very simple:

import pafy
link = input("paste youtube link:  ")

video = pafy.new(link)
bestaudio = video.getbestaudio()
print(video.title)
bestaudio.download()

and this is the error:

Traceback (most recent call last): File "c:UsersneodiDesktopyt
to mp3input.py", line 4, in
video = pafy.new(link) File "C:UsersneodiAppDataRoamingPythonPython310site-packagespafypafy.py",
line 124, in new
return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) File
"C:UsersneodiAppDataRoamingPythonPython310site-packagespafybackend_youtube_dl.py",
line 31, in init
super(YtdlPafy, self).init(*args, **kwargs) File "C:UsersneodiAppDataRoamingPythonPython310site-packagespafybackend_shared.py",
line 97, in init
self._fetch_basic() File "C:UsersneodiAppDataRoamingPythonPython310site-packagespafybackend_youtube_dl.py",
line 54, in _fetch_basic
self._dislikes = self._ydl_info[‘dislike_count’] KeyError: ‘dislike_count’

can anyone help?
and thank you if you do

2

Answers


  1. Temporary fix:

    run pip install -e git+git://github.com/mohamed-challal/pafy.git@develop#egg=pafy
    or simply add -e git+git://github.com/mohamed-challal/pafy.git@develop#egg=pafy to your requirements.txt

    Login or Signup to reply.
  2. I commented the backend_youtube_dl.py file

    line 53 and 54.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search