jhtonyKoo commited on
Commit
aacd8f7
1 Parent(s): b6d1820

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -29,25 +29,25 @@ def get_audio_from_yt_video_input(yt_link: str):
29
  try:
30
  yt = pt.YouTube(yt_link)
31
  t = yt.streams.filter(only_audio=True)
32
- filename = os.path.join(yt_video_dir, "input.mp3")
33
- t[0].download(filename=filename)
34
  except VideoUnavailable as e:
35
  warnings.warn(f"Video Not Found at {yt_link} ({e})")
36
- filename = None
37
 
38
- return filename, filename
39
 
40
  def get_audio_from_yt_video_ref(yt_link: str):
41
  try:
42
  yt = pt.YouTube(yt_link)
43
  t = yt.streams.filter(only_audio=True)
44
- filename = os.path.join(yt_video_dir, "reference.mp3")
45
- t[0].download(filename=filename)
46
  except VideoUnavailable as e:
47
  warnings.warn(f"Video Not Found at {yt_link} ({e})")
48
- filename = None
49
 
50
- return filename, filename
51
 
52
  def inference(file_uploaded_in, file_uploaded_ref):
53
 
 
29
  try:
30
  yt = pt.YouTube(yt_link)
31
  t = yt.streams.filter(only_audio=True)
32
+ filename_in = os.path.join(yt_video_dir, "input.mp3")
33
+ t[0].download(filename=filename_in)
34
  except VideoUnavailable as e:
35
  warnings.warn(f"Video Not Found at {yt_link} ({e})")
36
+ filename_in = None
37
 
38
+ return filename_in, filename_in
39
 
40
  def get_audio_from_yt_video_ref(yt_link: str):
41
  try:
42
  yt = pt.YouTube(yt_link)
43
  t = yt.streams.filter(only_audio=True)
44
+ filename_ref = os.path.join(yt_video_dir, "reference.mp3")
45
+ t[0].download(filename=filename_ref)
46
  except VideoUnavailable as e:
47
  warnings.warn(f"Video Not Found at {yt_link} ({e})")
48
+ filename_ref = None
49
 
50
+ return filename_ref, filename_ref
51
 
52
  def inference(file_uploaded_in, file_uploaded_ref):
53