Skip to content

Commit fa311fd

Browse files
committed
Output Title, Views, Thumbnail
1 parent be62faa commit fa311fd

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

downloader.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
from yt_dlp import YoutubeDL
22

3+
# with YoutubeDL() as ydl:
4+
# info_dict = ydl.extract_info('https://www.youtube.com/watch?v=BaW_jenozKc', download=False)
5+
# video_title = info_dict.get('title', None)
6+
# print(f"The title of the video is: {video_title}")
7+
8+
print(f" ==========================\n Python YouTube Downloader \n​==========================\n")
9+
10+
# videoURL = str(input("Enter Video Link : "))
11+
videoURL = 'https://www.youtube.com/watch?v=HE7ViC-n25g'
12+
313
with YoutubeDL() as ydl:
4-
info_dict = ydl.extract_info('https://www.youtube.com/watch?v=BaW_jenozKc', download=False)
5-
video_title = info_dict.get('title', None)
6-
print(f"The title of the video is: {video_title}")
14+
vidInfo = ydl.extract_info(videoURL, download=False)
15+
16+
print("\n- Title 👉", vidInfo.get('title', None))
17+
print("- Views 👉", vidInfo.get('view_count', None), "views")
18+
print("- Thubnail 👉", vidInfo.get('thumbnail', None))
19+
20+

0 commit comments

Comments
 (0)