通过youtube-dl下载时更改视频名称 [英] Changing name of the video while downloading via youtube-dl

查看:338
本文介绍了通过youtube-dl下载时更改视频名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在youtube中下载完整的播放列表,同时下载时我想输入序列号,同时在视频标题的前面进行下载,

I am trying to download a complete playlist in youtube, while downloading i want to enter serial number while downloading in front of the title of the video,

例如,如果播放列表中有视频:

For example if a playlist has a videos:

A.mp4
E.mp4
K.mp4
C.mp4
B.mp4

我希望成为

1. A.mp4
2. E.mp4
3. K.mp4
4. C.mp4
5. B.mp4.

我尝试了以下命令:

i=0;youtube-dl -cti https://www.youtube.com/playlist?list={(Any Playlist)} -o "{{$i++}%(title)s.%(ext)s}"

但是它给了我这个错误:

but its giving me this error:

youtube-dl:错误:使用输出模板与使用标题,视频ID或自动编号冲突

youtube-dl: error: using output template conflicts with using title, video ID or auto number

另外,我也不在搜索整个播放列表,然后一一重命名.

Also, Downloading the whole playlist and then renaming one by one is also not i am searching.

是否有任何命令可以下载播放列表并根据我的意愿并排重命名每个视频?

Is there any command which downloads the playlist and renames each video side by side according to my wish?

推荐答案

有时我很头疼,难以根据顺序对文件进行重命名和排序.

Sometimes I had headache to rename and sort the files based on the order.

因此要添加自动编号,请使用 -A 之类的

So to add auto-numbering, use -A like,

youtube-dl https://www.youtube.com/playlist?list=PLOU2XLYxmsILe6_eGvDN3GyiodoV3qNSC -A

或者保持播放列表索引,

Or to keep playlist index,

youtube-dl -o '%(playlist_index)s. %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLOU2XLYxmsILe6_eGvDN3GyiodoV3qNSC

这将为下载的文件添加漂亮的编号.

This will add nice numbering to the downloaded files.

如果您要下载不在播放列表中的文件,则可以手动在文件中添加数字,

And if you are downloading files which is not in playlist, you can add numbers manually to the file,

youtube-dl -o "1-%(uploader)s%(title)s.%(ext)s" https://youtu.be/862r3XS2YB0

在这里,我在下载时已将 1-手动添加到文件名中.

Here I have manually added 1- to the filename while downloading.

这篇关于通过youtube-dl下载时更改视频名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆