-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathYT_data_crawler.py
More file actions
34 lines (23 loc) · 861 Bytes
/
Copy pathYT_data_crawler.py
File metadata and controls
34 lines (23 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pafy
#This is the documentation for Pafy - a Python library to download YouTube content and retrieve metadata
#Pafy object , argument as url
object = pafy.new("https://www.youtube.com/watch?v=nRW90GASSXE&list=PL6gx4Cwl9DGA8Vys-f48mAH9OKSUyav0q")
#Print title
print("Title : " + object.title)
#print viewcount
print("View Count : " + str(object.viewcount))
#print category
print("Category" + object.category)
#print author name
print("Author : " + object.author)
#length of video
print("Length : " + str(object.length))
#duration
print("Duration : " + object.duration)
#Published on date
print("Published on Date : " + str(object.published))
#likes and dislikes
print("Likes : " + str(object.likes) + "Dislikes : " + str(object.dislikes))
#Ratings
print("Ratings" , int(object.rating))
#read more at http://pythonhosted.org/Pafy/#Pafy.pafy.new