我无法将 youtube_dl 的命令行参数转换为 ydl_opts

I can't convert command line params to ydl_opts for youtube_dl

我想在 python 代码中使用 youtube_dl。在命令行中,我使用此代码:"youtube-dl --external-downloader ffmpeg --external-downloader-args "-ss 00:01:00.00 -to 00:02:00.00" -f best "https://www.youtube.com/watch?v=dc7I-i7sPrg""

如何将此代码转换为 Python:

ydl_opts = {

}

with YoutubeDL(ydl_opts) as ydl:
    ydl.download(url)

感谢您的帮助。

ydl_opts = {
      'external_downloader': 'ffmpeg',
      'external_downloader_args': "-ss 00:01:00.00 -to 00:02:00.00",
      'format': 'best'
}

with YoutubeDL(ydl_opts) as ydl:
    ydl.download(url)

Python 个参数列出 here