Skip to content

Commit be62faa

Browse files
committed
Extract the Title from a YouTube Video
1 parent 20d0fd1 commit be62faa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

downloader.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from yt_dlp import YoutubeDL
2+
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}")

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
yt_dlp==2023.12.30

0 commit comments

Comments
 (0)