对于下载,youtube 文件格式会因操作系统而异吗?

Rav*_*avi 0 ubuntu youtube windows

哦!看到我所看到的很难过。我正在使用来自 Ubuntu13.04 的命令行从 youtube 下载文件(视频为 1 小时),如下所示:

ravbholua@ravbholua-Aspire-5315:~$ youtube-dl "http://www.youtube.com/watch?v=d4Z8VI3myBw"
[youtube] Setting language
[youtube] d4Z8VI3myBw: Downloading video webpage
[youtube] d4Z8VI3myBw: Downloading video info webpage
[youtube] d4Z8VI3myBw: Extracting video information
[download] Destination: d4Z8VI3myBw.mp4
[download]   0.1% of 718.62M at   13.70k/s ETA --:--
Run Code Online (Sandbox Code Playgroud)

查看大小为 718 MB,类型为 mp4。

我之前使用 youtube 下载器从 Windows 7 操作系统下载的相同文件。然后文件的类型和大小是 flv 并且只有 130 MB。

同样,昨天和今天我通过我的 Ubuntu13.04 从 youtube 下载文件,所有文件都下载为 mp4 并且非常大。但是,当我早些时候通过 Windows 下载许多视频时,与 mp4 相比,所有文件都具有 flv 类型且大小非常小。

如果像这样下载 YouTube 视频(大尺寸的 mp4),我将无法下载它们。

有一点很清楚:区别在于操作系统和/或 Windows7 的 youtube 下载器。请问Ubuntu13.04这里需要修改什么设置?

ter*_*don 5

假设您在两个操作系统上使用相同的python 脚本,请查看其文档:

YouTube 格式

使用 -f 选项和其他相关选项,您可以指定要从 YouTube 下载的视频格式。如果您有优先顺序,请指定用斜杠分隔它们的格式:-f 22/17/18。我不会在此处保留视频格式表,而是向您推荐Wikipedia上的 YouTube 格式列表。

输出模板

-o 选项允许用户指定输出文件名的模板。基本用法是在下载单个文件时不设置任何模板参数,例如在 youtube-dl -o Funny_video.flv " http://some.video.com " 中。但是,它可能包含在下载每个视频时将被替换的特殊序列。特殊序列的格式为 %(NAME)s。澄清一下,这是一个百分比符号,后跟括号中的名称,后跟小写的 S。允许的名称是:

id: The sequence will be replaced by the video identifier.
url: The sequence will be replaced by the video URL.
uploader: The sequence will be replaced by the nickname of the person who uploaded the video.
upload_date: The sequence will be replaced by the upload date in YYYYMMDD format.
title: The sequence will be replaced by the video title.
ext: The sequence will be replaced by the appropriate extension (like flv or mp4).
epoch: The sequence will be replaced by the Unix epoch when creating the file.
autonumber: The sequence will be replaced by a five-digit number that will be increased with each download, starting at zero.
Run Code Online (Sandbox Code Playgroud)

您应该始终阅读程序的文档,因为它通常包含您正在寻找的答案。在该页面上,作者还解释了如何通过将相关选项添加到 来使您的选择永久化~/.config/youtube-dl.conf