File tree Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
6
6
class Video :
7
-
7
+ """
8
+ Create an instance of `Video` class.
9
+ ```python
10
+ video = Video(video_url="video_url")
11
+ ```
12
+
13
+ | Methods | Details |
14
+ | --------------- | ------------------------ |
15
+ | `.getDetails()` | Return the video details |
16
+ """
8
17
9
18
def __init__ (self , video_url ):
10
19
self .video_url = video_url
11
20
12
21
def getDetails (self ):
13
-
22
+ """
23
+ Class - `Video`
24
+ Example:
25
+ ```
26
+ video_data = Video("https://www.youtube.com/watch?v=pBy1zgt0XPc")
27
+ video_data.getDetails()
28
+ ```
29
+ Returns:
30
+ {
31
+ "title": Tile of the video
32
+ "description": Description of the video
33
+ "views_count": No. of views of the video,
34
+ "upload_date": Upload date of the video,
35
+ "comment_count": No. of comments,
36
+ "channel_name": Name of the channel,
37
+ "channel_avatar": Channel avatar,
38
+ "subscriber_count": No. of channel subscribers,
39
+ "channel_url": Link to the channel
40
+ }
41
+ """
14
42
url = self .video_url
15
43
try :
16
44
res = requests .get (url )
You can’t perform that action at this time.
0 commit comments