Welcome folks today in this tutorial we will be getting youtube video thumbnail
and views
and all sort of information in python using youtube-dl
and pafy
library. All the source code of the application is given below.
Get Started
In order to get started we need to install the following libraries by using the pip
command
pip install youtube-dl
pip install pafy
After installing all these libraries just make an app.py
file and copy paste the following code
app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import pafy # url of video url = "https://www.youtube.com/watch?v=vG2PNdI8axo" # getting video video = pafy.new(url) print(video) # printing the value print("Likes : " + str(likes)) print("VideoId : " + str(videoid)) print("Duration : " + str(duration)) print("Author : " + str(author)) #print("Subscribers :" + str(subscribers)) |