Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9b59e32

Browse files
updated video.py
1 parent 99785c9 commit 9b59e32

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

‎YouTube-Scraper/video.py‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,41 @@
44

55

66
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+
"""
817

918
def __init__(self, video_url):
1019
self.video_url = video_url
1120

1221
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+
"""
1442
url = self.video_url
1543
try:
1644
res = requests.get(url)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /