Spaces:
Sleeping
Sleeping
internomega-terrablue commited on
Commit ·
3c3a632
1
Parent(s): 0b6760c
you tube api fix
Browse files
ingestion_engine/transcripter.py
CHANGED
|
@@ -10,8 +10,9 @@ def extract(url: str) -> str:
|
|
| 10 |
if not video_id:
|
| 11 |
raise ValueError(f"Could not parse YouTube video ID from: {url}")
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
def _parse_video_id(url: str) -> str | None:
|
|
|
|
| 10 |
if not video_id:
|
| 11 |
raise ValueError(f"Could not parse YouTube video ID from: {url}")
|
| 12 |
|
| 13 |
+
ytt = YouTubeTranscriptApi()
|
| 14 |
+
transcript = ytt.fetch(video_id)
|
| 15 |
+
return " ".join(snippet.text for snippet in transcript)
|
| 16 |
|
| 17 |
|
| 18 |
def _parse_video_id(url: str) -> str | None:
|