Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ from pytube.exceptions import VideoUnavailable
|
|
21 |
from inference.style_transfer import *
|
22 |
|
23 |
|
24 |
-
yt_video_dir = "./yt_dir"
|
25 |
os.makedirs(yt_video_dir, exist_ok=True)
|
26 |
|
27 |
|
@@ -29,7 +29,7 @@ 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.
|
33 |
t[0].download(filename=filename)
|
34 |
except VideoUnavailable as e:
|
35 |
warnings.warn(f"Video Not Found at {yt_link} ({e})")
|
@@ -41,7 +41,7 @@ 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.
|
45 |
t[0].download(filename=filename)
|
46 |
except VideoUnavailable as e:
|
47 |
warnings.warn(f"Video Not Found at {yt_link} ({e})")
|
|
|
21 |
from inference.style_transfer import *
|
22 |
|
23 |
|
24 |
+
yt_video_dir = "./yt_dir/0"
|
25 |
os.makedirs(yt_video_dir, exist_ok=True)
|
26 |
|
27 |
|
|
|
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})")
|
|
|
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})")
|