youngtsai commited on
Commit
9de79a2
1 Parent(s): 2d3b891

if "yt_id" in gr.args:

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -906,4 +906,10 @@ if TRANSCRIPTS: # 确保列表不为空
906
  image.update(value=first_screenshot_path)
907
  text.update(value=first_text)
908
 
 
 
 
 
 
 
909
  demo.launch(allowed_paths=["videos"])
 
906
  image.update(value=first_screenshot_path)
907
  text.update(value=first_text)
908
 
909
+ # 假設 url params 有 video_id,yt_id=VIDEO_ID
910
+ # 如果有 yt_id,就貼上youtube_link
911
+ if "yt_id" in gr.args:
912
+ yt_id = gr.args["yt_id"]
913
+ youtube_link.update(value=f"https://www.youtube.com/watch?v={yt_id}")
914
+
915
  demo.launch(allowed_paths=["videos"])