aichina commited on
Commit
2fd9b5b
1 Parent(s): 638be90
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -3,12 +3,18 @@ import whisper
3
  from pytube import YouTube
4
 
5
  def get_audio(url):
 
6
  yt = YouTube(url)
7
- return yt.streams.filter(only_audio=True)[0].download(filename="tmp.mp4")
 
 
8
 
9
  def get_transcript(url, model_size, lang, format):
10
 
 
 
11
  model = whisper.load_model(model_size)
 
12
 
13
  if lang == "None":
14
  lang = None
 
3
  from pytube import YouTube
4
 
5
  def get_audio(url):
6
+ print(f'{url} start get audio ...')
7
  yt = YouTube(url)
8
+ audio_file = yt.streams.filter(only_audio=True)[0].download(filename="tmp.mp4")
9
+ print('aodio over ..')
10
+ return audio_file
11
 
12
  def get_transcript(url, model_size, lang, format):
13
 
14
+
15
+ print('whisper loading ...')
16
  model = whisper.load_model(model_size)
17
+ print('whisper over')
18
 
19
  if lang == "None":
20
  lang = None