lanbogao commited on
Commit
41bc28a
1 Parent(s): a0a2680

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -6,6 +6,7 @@ import yt_dlp
6
  import uvicorn
7
  import re
8
  import os
 
9
  from typing import Optional
10
 
11
  CUSTOM_PATH = "/gradio"
@@ -34,7 +35,7 @@ def download_subtitle(url: str, lang: Optional[str] = None) -> Optional[str]:
34
  }
35
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
36
  info_dict = ydl.extract_info(url, download=False)
37
- print(info_dict)
38
  if info_dict.get("subtitles"):
39
  # get first available subtitle
40
  subtitle_url = info_dict["subtitles"][0]["url"]
 
6
  import uvicorn
7
  import re
8
  import os
9
+ import json
10
  from typing import Optional
11
 
12
  CUSTOM_PATH = "/gradio"
 
35
  }
36
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
37
  info_dict = ydl.extract_info(url, download=False)
38
+ print(json.dumps(info_dict))
39
  if info_dict.get("subtitles"):
40
  # get first available subtitle
41
  subtitle_url = info_dict["subtitles"][0]["url"]