Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,7 @@ import ffmpeg
|
|
16 |
import subprocess
|
17 |
import tempfile
|
18 |
import os
|
|
|
19 |
|
20 |
model = whisper.load_model("base")
|
21 |
|
@@ -28,7 +29,7 @@ def extract_yt_audio(it, video_url, video_file):
|
|
28 |
"""
|
29 |
|
30 |
if it == 'URL' and ("youtube.com" in video_url or "youtu.be" in video_url):
|
31 |
-
yt = YouTube(video_url, use_oauth=True)
|
32 |
a = yt.streams.filter(only_audio=True).first()
|
33 |
audio_file = a.download()
|
34 |
sample = AudioSegment.from_file(audio_file, format="mp4")
|
|
|
16 |
import subprocess
|
17 |
import tempfile
|
18 |
import os
|
19 |
+
from pytubefix.cli import on_progress
|
20 |
|
21 |
model = whisper.load_model("base")
|
22 |
|
|
|
29 |
"""
|
30 |
|
31 |
if it == 'URL' and ("youtube.com" in video_url or "youtu.be" in video_url):
|
32 |
+
yt = YouTube(video_url, use_oauth=True, allow_oauth_cache=True, on_progress_callback = on_progress)
|
33 |
a = yt.streams.filter(only_audio=True).first()
|
34 |
audio_file = a.download()
|
35 |
sample = AudioSegment.from_file(audio_file, format="mp4")
|