Update functions.py
Browse files- functions.py +2 -2
functions.py
CHANGED
@@ -113,7 +113,7 @@ def get_yt_audio(url):
|
|
113 |
title = yt.title
|
114 |
|
115 |
# Get the first available audio stream and download it
|
116 |
-
audio_stream = yt.streams.filter(
|
117 |
|
118 |
return audio_stream, title
|
119 |
|
@@ -200,7 +200,7 @@ def transcribe_yt_video(link, py_tube=True):
|
|
200 |
|
201 |
for i, chunk in enumerate(chunks):
|
202 |
chunk.export(f'output/chunk_{i}_{video_id}.mp4', format='mp3')
|
203 |
-
transcriptions.append(load_whisper_api(f'output/chunk_{i}_{video_id}.
|
204 |
|
205 |
results = ','.join(transcriptions)
|
206 |
|
|
|
113 |
title = yt.title
|
114 |
|
115 |
# Get the first available audio stream and download it
|
116 |
+
audio_stream = yt.streams.filter(only_audio=True).first().download()
|
117 |
|
118 |
return audio_stream, title
|
119 |
|
|
|
200 |
|
201 |
for i, chunk in enumerate(chunks):
|
202 |
chunk.export(f'output/chunk_{i}_{video_id}.mp4', format='mp3')
|
203 |
+
transcriptions.append(load_whisper_api(f'output/chunk_{i}_{video_id}.mp3')['text'])
|
204 |
|
205 |
results = ','.join(transcriptions)
|
206 |
|