Spaces:
Running
Running
Update customtools.py
Browse files- customtools.py +1 -1
customtools.py
CHANGED
|
@@ -72,7 +72,7 @@ def youtube_transcript(url: str) -> str:
|
|
| 72 |
print(video_id)
|
| 73 |
try:
|
| 74 |
transcript = YouTubeTranscriptApi().fetch(video_id)
|
| 75 |
-
text = "
|
| 76 |
return text[:chars]
|
| 77 |
except Exception as exc:
|
| 78 |
print(f"Error fetching YouTube transcript: {exc}")
|
|
|
|
| 72 |
print(video_id)
|
| 73 |
try:
|
| 74 |
transcript = YouTubeTranscriptApi().fetch(video_id)
|
| 75 |
+
text = "\n".join(piece.text for piece in transcript)
|
| 76 |
return text[:chars]
|
| 77 |
except Exception as exc:
|
| 78 |
print(f"Error fetching YouTube transcript: {exc}")
|