Update tools/youtube_transcript.py
Browse files
tools/youtube_transcript.py
CHANGED
|
@@ -8,9 +8,8 @@ def youtube_transcript(video_id: str) -> str:
|
|
| 8 |
Fetches the transcript of a YouTube video using its video ID.
|
| 9 |
|
| 10 |
Args:
|
| 11 |
-
video_id (str): The unique identifier of a YouTube video.
|
| 12 |
-
|
| 13 |
-
the video_id is '12345'.
|
| 14 |
|
| 15 |
Returns:
|
| 16 |
str: The transcript of the specified YouTube video as bullet points.
|
|
@@ -21,7 +20,3 @@ def youtube_transcript(video_id: str) -> str:
|
|
| 21 |
bullet_points = '\n'.join(f"- {entry['text']}" for entry in transcript)
|
| 22 |
|
| 23 |
return bullet_points
|
| 24 |
-
|
| 25 |
-
if __name__ == "__main__":
|
| 26 |
-
transcript = youtube_transcript.invoke("1htKBjuUWec")
|
| 27 |
-
print(transcript)
|
|
|
|
| 8 |
Fetches the transcript of a YouTube video using its video ID.
|
| 9 |
|
| 10 |
Args:
|
| 11 |
+
video_id (str): The unique identifier of a YouTube video.
|
| 12 |
+
Example: For https://www.youtube.com/watch?v=12345, the video_id is '12345'.
|
|
|
|
| 13 |
|
| 14 |
Returns:
|
| 15 |
str: The transcript of the specified YouTube video as bullet points.
|
|
|
|
| 20 |
bullet_points = '\n'.join(f"- {entry['text']}" for entry in transcript)
|
| 21 |
|
| 22 |
return bullet_points
|
|
|
|
|
|
|
|
|
|
|
|