下載時,youtube 檔案格式會根據作業系統而改變?

下載時,youtube 檔案格式會根據作業系統而改變?

哦!看到我所看到的,我很難過。我正在使用 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 --:--

查看大小為 718 MB,類型為 mp4。

我之前使用 YouTube 下載器從 Windows 7 作業系統下載了相同的檔案。那麼檔案的類型和大小只有flv,只有130 MB。

同樣,昨天和今天我透過我的 Ubuntu13.04 從 youtube 下載了文件,所有文件都下載為 mp4 並且大小非常非常大。但是,當我之前透過 Windows 下載許多影片時,所有檔案都是 flv 類型,與 mp4 相比,大小非常小。

如果像這樣下載YouTube影片(大尺寸的mp4),我無法下載它們。

有一點很明確:差別在於 Windows7 的作業系統和/或 YouTube 下載器。請問在Ubuntu13.04需要更改什麼設定?

答案1

假設您使用相同的蟒蛇腳本在兩個作業系統上,檢查其文件:

YouTube 格式

使用 -f 選項和其他相關選項,您可以指定要從 YouTube 下載的影片格式。如果您有優先順序,請指定以斜線分隔它們的格式:-f 22/17/18。我不會在這裡保留影片格式表,而是建議您參考 YouTube 格式列表維基百科

輸出模板

-o 選項允許使用者指定輸出檔案名稱的範本。基本用法是在下載單一檔案時不設定任何範本參數,例如 youtube-dl -ounny_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.

您應該始終閱讀程式的文檔,因為它通常包含您正在尋找的答案。在該頁面上,作者還解釋瞭如何透過將相關選項新增至 來使您的選擇永久化~/.config/youtube-dl.conf

相關內容