SteveDigital commited on
Commit
786c176
·
1 Parent(s): 7086195

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -31,18 +31,18 @@ def get_text(url):
31
  output_text_transcribe = ''
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:
47
  #raise gr.Error("Exception: There was a problem transcribing the audio after successfully retrieving it from the video/URL.")
48
 
 
31
  output_text_transcribe = ''
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:
47
  #raise gr.Error("Exception: There was a problem transcribing the audio after successfully retrieving it from the video/URL.")
48