Spaces:
Sleeping
Sleeping
vvss
Browse files
app.py
CHANGED
@@ -29,7 +29,10 @@ def get_video(url):
|
|
29 |
# 如果是,将文件名添加到 mp4_files 列表中
|
30 |
mp4_files.append(filename)
|
31 |
print(mp4_files)
|
32 |
-
|
|
|
|
|
|
|
33 |
|
34 |
|
35 |
def create(prompt,openai_key):
|
@@ -112,6 +115,7 @@ def get_transcript(url,openai_key):
|
|
112 |
'language': (None, 'english'),
|
113 |
'language_behaviour': (None, 'automatic single language'),
|
114 |
}
|
|
|
115 |
response = requests.post('https://api.gladia.io/audio/text/audio-transcription/', headers=headers, files=files)
|
116 |
print(response.text)
|
117 |
del_down_file()
|
|
|
29 |
# 如果是,将文件名添加到 mp4_files 列表中
|
30 |
mp4_files.append(filename)
|
31 |
print(mp4_files)
|
32 |
+
mp4_file = mp4_files[0]
|
33 |
+
os.rename(mp4_file, 'my_mp4.mp4')
|
34 |
+
return 'my_mp4.mp4'
|
35 |
+
|
36 |
|
37 |
|
38 |
def create(prompt,openai_key):
|
|
|
115 |
'language': (None, 'english'),
|
116 |
'language_behaviour': (None, 'automatic single language'),
|
117 |
}
|
118 |
+
print('get transcription from api.gladia.io ...')
|
119 |
response = requests.post('https://api.gladia.io/audio/text/audio-transcription/', headers=headers, files=files)
|
120 |
print(response.text)
|
121 |
del_down_file()
|