-
Notifications
You must be signed in to change notification settings - Fork 312
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
KeyError: dislike_count #306
Comments
Looks like there's a PR for it: |
I noticed it's kind of hit-or-miss: the like/dislike count metadata is there, but sometimes it gets fetched, sometimes it doesn't; could be something to do with privacy settings and/or is the case for running livestreams where the metadata isn't fetched properly sometimes. The issue was fixed with the merge of pull #288 and it's precisely the fix you mention: initialize 0 if said metadata isn't fetched properly. Unfortunately, the last pull committed in latest wheel release (0.5.5) is #235, so the bugfix is to be done manually till next release (if there will be one!) I agree however that the like/dislike (also a few other useless metadata) ought to be removed altogether. |
hotfix for pafy (fix for mps-youtube/pafy#306)
I just had the very same problem. I also installed an extension in firefox to still see the dislike_count But I also need to find out the duration of video length, without the Google API (I am not
Would be nice if pafy could be adapted to tolerate users using dislike_count (or |
I had gotten the same error many times, since YouTube has removed dislikes, pafy cannot fetch it for us. You will have to comment line 54 in pafy.backend_youtube_dl. Or if you are hosting, you can download the zip of the repository and then comment the line. Check out this code, you may get an idea of what to do, if you desperately need the dislike count. |
I faced the same issue. I installed the package directly from git using |
I try this way on heroku it's gives me this error:
|
@omegaab2, you have to include |
i fix it by install library from my code because pafy needs youtube-dl installed before but heroku install all of them together so you can install pafy from your code import subprocess, sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
try:
import pafy
except Exception as error:
print("Error: ", error)
install("git+https://github.com/mps-youtube/pafy.git")
import pafy |
When starting up mps-youtube, pafy is throwing an exception for unknown key for 'dislike_count'. Youtube is now hiding the thumbs down count, so I'm guessing the API data is now gone.
Manually setting the variable to 0 makes the problem go away. It seems like the metadata should be removed since its not accessible anymore.
The text was updated successfully, but these errors were encountered: