Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import os
|
|
9 |
from dotenv import load_dotenv
|
10 |
|
11 |
|
|
|
12 |
load_dotenv()
|
13 |
|
14 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
@@ -32,9 +33,7 @@ def youtube_video_downloader(url):
|
|
32 |
|
33 |
|
34 |
def audio_extraction(video_file, output_format):
|
35 |
-
|
36 |
-
|
37 |
-
video_path = f"{temp_filename}"
|
38 |
audio = extract_audio(
|
39 |
input_path=os.fspath(video_file), output_path=f"{str(video_path)[:-4]}.mp3", output_format=f"{output_format}"
|
40 |
)
|
@@ -100,7 +99,7 @@ with file_select_tab:
|
|
100 |
try:
|
101 |
#video_file = video_file.getvalue()
|
102 |
with open(video_file, "wb") as f:
|
103 |
-
f.write(
|
104 |
|
105 |
if video_file:
|
106 |
if st.button("Transcribe", key="vidfile"):
|
|
|
9 |
from dotenv import load_dotenv
|
10 |
|
11 |
|
12 |
+
|
13 |
load_dotenv()
|
14 |
|
15 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
|
33 |
|
34 |
|
35 |
def audio_extraction(video_file, output_format):
|
36 |
+
video_path = f"{video_file}"
|
|
|
|
|
37 |
audio = extract_audio(
|
38 |
input_path=os.fspath(video_file), output_path=f"{str(video_path)[:-4]}.mp3", output_format=f"{output_format}"
|
39 |
)
|
|
|
99 |
try:
|
100 |
#video_file = video_file.getvalue()
|
101 |
with open(video_file, "wb") as f:
|
102 |
+
f.write(video_file.getvalue())
|
103 |
|
104 |
if video_file:
|
105 |
if st.button("Transcribe", key="vidfile"):
|