Youtube-dl - 在一个命令中一次下载多个 youtube 视频
Youtube-dl - downloading several youtube videos at once in one command
我知道如何下载 1 个 youtube 视频命令、1 个 youtube 播放列表命令,但我不知道如何在一个命令中一次下载多个 youtube 视频。我该怎么做?
只需在调用 youtube-dl 后添加所有 URL,如下所示:
youtube-dl "https://www.youtube.com/watch?v=BaW_jenozKc" http://vimeo.com/56015672 "https://www.youtube.com/playlist?list=PLEBDE1E42B3A9BC37" "https://www.youtube.com/watch?v=IEge830cgHs"
大多数 shells 也允许多行命令,像这样:
youtube-dl \
"https://www.youtube.com/watch?v=BaW_jenozKc" \
http://vimeo.com/56015672 \
"https://www.youtube.com/playlist?list=PLEBDE1E42B3A9BC37" \
"https://www.youtube.com/watch?v=IEge830cgHs"
不要忘记引用包含和号 (&
) 的 URL 或 - 在某些 shell 中 - 问号 (?
)。您如何引用取决于您的 shell - 在大多数 shell 上,包括 '
或 "
中的 URL 应该就足够了。
您可以将所有网址写在一个文本文件中(以新行分隔)。例如,让我们编写一个名为 "urls" 的文本文件,内容如下:
https://www.youtube.com/watch?v=c7DpRIk4lKY
https://www.youtube.com/playlist?list=PLx_tr69QV8CDB-nn-pc5YZbDsdgjIQSII
https://www.youtube.com/watch?v=kh1sF-sbkbw
然后在shell中写:
youtube-dl -a urls
但是,如果您 运行 此命令位于与 urls 文件相同的路径中。
如果你想从另一个位置 运行 它只需在文件名后面添加路径,如:
youtube-dl -a path/to/file/urls
此外,在这个例子中我没有包含任何文件扩展名,但它也可以有一个像“.txt”这样的文件扩展名
我知道如何下载 1 个 youtube 视频命令、1 个 youtube 播放列表命令,但我不知道如何在一个命令中一次下载多个 youtube 视频。我该怎么做?
只需在调用 youtube-dl 后添加所有 URL,如下所示:
youtube-dl "https://www.youtube.com/watch?v=BaW_jenozKc" http://vimeo.com/56015672 "https://www.youtube.com/playlist?list=PLEBDE1E42B3A9BC37" "https://www.youtube.com/watch?v=IEge830cgHs"
大多数 shells 也允许多行命令,像这样:
youtube-dl \
"https://www.youtube.com/watch?v=BaW_jenozKc" \
http://vimeo.com/56015672 \
"https://www.youtube.com/playlist?list=PLEBDE1E42B3A9BC37" \
"https://www.youtube.com/watch?v=IEge830cgHs"
不要忘记引用包含和号 (&
) 的 URL 或 - 在某些 shell 中 - 问号 (?
)。您如何引用取决于您的 shell - 在大多数 shell 上,包括 '
或 "
中的 URL 应该就足够了。
您可以将所有网址写在一个文本文件中(以新行分隔)。例如,让我们编写一个名为 "urls" 的文本文件,内容如下:
https://www.youtube.com/watch?v=c7DpRIk4lKY
https://www.youtube.com/playlist?list=PLx_tr69QV8CDB-nn-pc5YZbDsdgjIQSII
https://www.youtube.com/watch?v=kh1sF-sbkbw
然后在shell中写:
youtube-dl -a urls
但是,如果您 运行 此命令位于与 urls 文件相同的路径中。 如果你想从另一个位置 运行 它只需在文件名后面添加路径,如:
youtube-dl -a path/to/file/urls
此外,在这个例子中我没有包含任何文件扩展名,但它也可以有一个像“.txt”这样的文件扩展名