Commit
•
23850d7
1
Parent(s):
5cfa43f
Update app.py
Browse files
app.py
CHANGED
@@ -32,15 +32,15 @@ def get_text(url):
|
|
32 |
|
33 |
yt = YouTube(url)
|
34 |
#if yt.length < 5400:
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
#else:
|
45 |
# return "Videos for transcription on this space are limited to 1.5 hours. Sorry about this limit but some joker thought they could stop this tool from working by transcribing many extremely long videos. Please visit https://steve.digital to contact me about this space."
|
46 |
#finally:
|
|
|
32 |
|
33 |
yt = YouTube(url)
|
34 |
#if yt.length < 5400:
|
35 |
+
video = yt.streams.filter(only_audio=True).first()
|
36 |
+
out_file=video.download(output_path=".")
|
37 |
+
base, ext = os.path.splitext(out_file)
|
38 |
+
new_file = base+'.mp3'
|
39 |
+
os.rename(out_file, new_file)
|
40 |
+
a = new_file
|
41 |
+
|
42 |
+
result = model.transcribe(a)
|
43 |
+
return result['text'].strip()
|
44 |
#else:
|
45 |
# return "Videos for transcription on this space are limited to 1.5 hours. Sorry about this limit but some joker thought they could stop this tool from working by transcribing many extremely long videos. Please visit https://steve.digital to contact me about this space."
|
46 |
#finally:
|