Spaces:
Runtime error
Runtime error
wendru18
commited on
Commit
·
ac4f041
1
Parent(s):
c9721d8
quick yt mobile url fix
Browse files
app.py
CHANGED
@@ -29,7 +29,10 @@ def set_openai_key(key):
|
|
29 |
|
30 |
def get_youtube_data(url):
|
31 |
|
32 |
-
|
|
|
|
|
|
|
33 |
|
34 |
try:
|
35 |
raw = YouTubeTranscriptApi.get_transcript(video_id)
|
|
|
29 |
|
30 |
def get_youtube_data(url):
|
31 |
|
32 |
+
if "youtu.be" in url:
|
33 |
+
video_id = url.split("/")[-1]
|
34 |
+
else:
|
35 |
+
video_id = url.split("=")[1]
|
36 |
|
37 |
try:
|
38 |
raw = YouTubeTranscriptApi.get_transcript(video_id)
|