SteveDigital
commited on
Commit
•
9e07c40
1
Parent(s):
9ec122f
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,15 @@ def get_text(url):
|
|
18 |
#if video_length < 5400:
|
19 |
video = yt.streams.filter(only_audio=True).first()
|
20 |
out_file=video.download(output_path=".")
|
|
|
|
|
|
|
|
|
21 |
base, ext = os.path.splitext(out_file)
|
22 |
new_file = base+'.mp3'
|
23 |
os.rename(out_file, new_file)
|
24 |
a = new_file
|
25 |
|
26 |
-
logging.info("Size of audio file: %s", str(len(a)))
|
27 |
result = model.transcribe(a)
|
28 |
return result['text'].strip()
|
29 |
#else:
|
|
|
18 |
#if video_length < 5400:
|
19 |
video = yt.streams.filter(only_audio=True).first()
|
20 |
out_file=video.download(output_path=".")
|
21 |
+
|
22 |
+
file_stats = os.stat(out_file)
|
23 |
+
logging.info("Size of audio file: %s", str(out_file.st_size))
|
24 |
+
|
25 |
base, ext = os.path.splitext(out_file)
|
26 |
new_file = base+'.mp3'
|
27 |
os.rename(out_file, new_file)
|
28 |
a = new_file
|
29 |
|
|
|
30 |
result = model.transcribe(a)
|
31 |
return result['text'].strip()
|
32 |
#else:
|