Unable to fetch likes,dislikes using pafy

596 Views Asked by At

I am trying to webscrape youtube data to obtain the views,likes,dislikes,etc. I am using pafy library to achieve the same. While I am able to get the other info , I am unable to fetch the likes and dislikes as it is returning None. I have attached the output for reference. In order to run the code just replace the API key with your developer API Key. The screenshot of the output is as below:

Output

Here is the code:

#!pip install pafy

#!pip install --upgrade youtube_dl

import pafy

url="http://www.youtube.com/watch?v=YBLF6ZqhO5I"

pafy.set_api_key("YOUR API KEY")

v= pafy.new(url)

print(v.title)

print(v.viewcount)

print(v.published)

print(v.likes)

#print(v.url)

0

There are 0 best solutions below