dwb2023 commited on
Commit
06d68be
·
verified ·
1 Parent(s): 7505a12

Update app.py

Browse files

add _return_yt_html_embed function

Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -35,6 +35,14 @@ scheduler = CommitScheduler(
35
  path_in_repo="data",
36
  )
37
 
 
 
 
 
 
 
 
 
38
  @spaces.GPU(duration=120)
39
  @lru_cache(maxsize=10)
40
  def transcribe_audio(inputs, task):
 
35
  path_in_repo="data",
36
  )
37
 
38
+ def _return_yt_html_embed(yt_url):
39
+ video_id = yt_url.split("?v=")[-1]
40
+ HTML_str = (
41
+ f'<center> <iframe width="500" height="320" src="https://www.youtube.com/embed/{video_id}"> </iframe>'
42
+ " </center>"
43
+ )
44
+ return HTML_str
45
+
46
  @spaces.GPU(duration=120)
47
  @lru_cache(maxsize=10)
48
  def transcribe_audio(inputs, task):