Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -206,10 +206,10 @@ def _download_yt_audio(yt_url, filename):
|
|
206 |
raise gr.Error(f"Requested format not available. Available formats: {available_formats}", duration=20)
|
207 |
|
208 |
def _return_yt_video_id(yt_url):
|
209 |
-
if "
|
210 |
-
video_id = yt_url.split("?v=")[
|
211 |
-
elif "
|
212 |
-
video_id = yt_url.split("be/")[1]
|
213 |
return video_id
|
214 |
|
215 |
def _return_yt_html_embed(yt_url):
|
|
|
206 |
raise gr.Error(f"Requested format not available. Available formats: {available_formats}", duration=20)
|
207 |
|
208 |
def _return_yt_video_id(yt_url):
|
209 |
+
if "youtube.com/watch?v=" in yt_url:
|
210 |
+
video_id = yt_url.split("?v=")[1].split("&")[0]
|
211 |
+
elif "youtu.be/" in yt_url:
|
212 |
+
video_id = yt_url.split("youtu.be/")[1]
|
213 |
return video_id
|
214 |
|
215 |
def _return_yt_html_embed(yt_url):
|