wendru18 commited on
Commit
ac4f041
·
1 Parent(s): c9721d8

quick yt mobile url fix

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -29,7 +29,10 @@ def set_openai_key(key):
29
 
30
  def get_youtube_data(url):
31
 
32
- video_id = url.split("=")[1]
 
 
 
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)