📜  youtube-dl python 获取文件名 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:23.628000             🧑  作者: Mango

代码示例1
ydl_opts = {
  'format': 'bestaudio',
  'postprocessors': [{'key':'FFmpegExtractAudio'}],
} 

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
  info = ydl.extract_info(uri, download=True)
  filename = ydl.prepare_filename(info)