Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import ast
|
|
11 |
from IPython.display import Audio, display
|
12 |
import requests
|
13 |
nltk.download('punkt_tab')
|
14 |
-
|
15 |
import ffmpeg
|
16 |
|
17 |
model = whisper.load_model("base")
|
@@ -31,7 +31,7 @@ def extract_yt_audio(it, video_url, video_file):
|
|
31 |
sample = AudioSegment.from_file(audio_file, format="mp4")
|
32 |
elif it == 'URL' and ("https://www" in video_url or "https://" in video_url or "www." in video_url):
|
33 |
response = requests.get(video_url)
|
34 |
-
video_data = BytesIO(response.content)
|
35 |
output_stream = io.BytesIO()
|
36 |
stream = ffmpeg.input('pipe:0')
|
37 |
stream = ffmpeg.output(stream, 'pipe:1', format='wav')
|
|
|
11 |
from IPython.display import Audio, display
|
12 |
import requests
|
13 |
nltk.download('punkt_tab')
|
14 |
+
mport io
|
15 |
import ffmpeg
|
16 |
|
17 |
model = whisper.load_model("base")
|
|
|
31 |
sample = AudioSegment.from_file(audio_file, format="mp4")
|
32 |
elif it == 'URL' and ("https://www" in video_url or "https://" in video_url or "www." in video_url):
|
33 |
response = requests.get(video_url)
|
34 |
+
video_data = io.BytesIO(response.content)
|
35 |
output_stream = io.BytesIO()
|
36 |
stream = ffmpeg.input('pipe:0')
|
37 |
stream = ffmpeg.output(stream, 'pipe:1', format='wav')
|