我有一个带有.txt链接列表的.m3u8文件。我想批量下载所有这些链接(视频),而不必手动输入一个一个。
我遇到的问题是:youtube-dl给输出文件取了相同的名称,这阻止了我批量下载文件,因为在下载了第一个文件之后,我得到了错误消息(对于以下文件):this file already exists.
因此,由于对任何下载都应用了相同的名称,所以我一次不能下载多个文件。
有人能帮我解决这个问题吗?
发布于 2020-05-14 10:54:27
使用-o选项:
youtube-dl -a batch_file \
-o "%(title)s by %(uploader)s on %(upload_date)s in %(playlist)s.%(ext)s" -o,--输出模板输出文件名模板,请参阅“输出模板”中的所有信息
有很多模式,您可以使用区分文件彼此。
id (string): Video identifier
display_id (string): An alternative identifier for the video
timestamp (numeric): UNIX timestamp of the moment the video became available
duration (numeric): Length of the video in seconds
view_count (numeric): How many users have watched the video on the platform
like_count (numeric): Number of positive ratings of the video
...发布于 2021-01-05 00:36:35
如果文件名不是一个主要问题,特别是在测试时,我建议使用autonumber变量和一个简单的id:
youtube-dl --batch-file batch_file.txt -o "File %(autonumber)s (%(id)s).%(ext)s"正如上面的注释所提到的,在文件名中使用url变量可能会很麻烦。
https://askubuntu.com/questions/1239414
复制相似问题