加载中…
个人资料
福盈陈富安
福盈陈富安
  • 博客等级:
  • 博客积分:0
  • 博客访问:3,190
  • 关注人气:1
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
相关博文
推荐博文
谁看过这篇博文
加载中…
正文 字体大小:

在linux中運用youtube-dl下載影片

(2015-10-18 08:48:03)
标签:

it

分类: linux

1. 到網頁http://yt-dl.org/ 點選Latest進入資料夾中下載youtube-dl.tar.gz最新版本安裝程式,
注意:youtube-dl.tar.gz 的版本更新頻繁,平均2-3天就會更新程式內容,所以每次操作前最好重新下載安裝。

2. 進入儲存下載程式的資料夾中,直接解壓縮,然後將解壓後的資料夾搬移到家目錄底下(因爲一定要放在一個可以自由存檔的資料夾)

3.搬移後,進入終端機界面,進入到家目錄/youtube-dl資料夾;輸入下面指令,就可以開始下載喜歡的影片了。當然要先找出預備下載影片的URL位置,例如輸入下面的影片位置後(紅色字體)及顯示的信息:

# ./youtube-dl{URL}(例如:http://youtu.be/iFDe5kUUyT0

[youtube] iFDe5kUUyT0: Downloading webpage

[youtube] iFDe5kUUyT0: Downloading video info webpage

[youtube] iFDe5kUUyT0: Extracting video information

[youtube] iFDe5kUUyT0: Downloading DASH manifest

[youtube] iFDe5kUUyT0: Downloading DASH manifest

WARNING: Your copy of avconv is outdated and unable to properly mux separate video and audio files, youtube-dl will download single file media. Update avconv to version 10-0 or newer to fix this.

[download] Destination: The Biggest Scam In The History Of Mankind (Documentary) - Hidden Secrets of Money 4 _ Mike Maloney-iFDe5kUUyT0.mp4

[download] 100% of 296.77MiB in 01:20

4.一般影片下載的位置在youbute-d的同一個資料夾中。用一般播放軟體就可以開始看影片了。

語法使用說明

To download a video

1- Go to youtube and search the video you want to download

2- Copy the Video URL from the browser's navigation(address) bar (As shown in the image)在linux中運用youtube-dl下載影片

3- Open up terminal and type in

youtube-dl {video URL}

~ Don't forget to replace '{video URL}' with the URL you copied from the browser's navigation(address) bar:

and your video will start downloading

~ But this will download video in some format that you don't want or it might be too heavy

For downloading video in format of your choice type in following

youtube-dl -F  {video URL}

~ Don't forget to replace '{video URL}' with the URL you copied from the browser's navigation(address) bar; as shown in the image below:在linux中運用youtube-dl下載影片

4-  If you choose to download video in format of your choice. you have one last step to follow: that is choosing the format of your choice.

When you type in the command for downloading video with format or your choice it'll give you list of different options, showing the formats and resolutions of that video.

choose the code of one you like and type in following:

youtube-dl -f  {format code} {video URL}

~ Don't forget to replace '{formate code}' with code of your choice and '{video URL}' with the URL you copied from the browser's navigation(address) bar; as shown in the image below:

In the example shown in the image above. I've chosen video in flv format with resolution [240*400] and its code is '5' as you can see in the image.

================================================================================

aaron@cfa4linux:~$ youtube-dl -h

Usage: youtube-dl [options] url [url...]

Options:

General Options:

-h, --help print this help text and exit

--version print program version and exit

-U, --update update this program to latest version

-i, --ignore-errors continue on download errors

-r, --rate-limit LIMIT download rate limit (e.g. 50k or 44.6m)

-R, --retries RETRIES number of retries (default is 10)

--dump-user-agent display the current browser identification

--list-extractors List all supported extractors and the URLs theywould handleVideo Selection:

--playlist-start NUMBER playlist video to start at (default is 1)

--playlist-end NUMBER playlist video to end at (default is last)

--match-title REGEX download only matching titles (regex or caselesssub-string)

--reject-title REGEX skip download for matching titles (regex orcaseless sub-string)

--max-downloads NUMBER Abort after downloading NUMBER files

Filesystem Options:

-t, --title use title in file name

-l, --literal use literal title in file name

-A, --auto-number number downloaded files starting from 00000

-o, --output TEMPLATE output filename template.

Use %(stitle)s to get thetitle,

%(uploader)s for the uploader name,

%(autonumber)s to get an automatically incrementednumber,

%(ext)s for the filename extension,

%(upload_date)s for the upload date (YYYYMMDD), and%% for a literal percent.

Use - to output to stdout.

-a, --batch-file FILE file containing URLs to download ('-' for stdin)

-w, --no-overwrites do not overwrite files

-c, --continue resume partially downloaded files

--no-continue do not resume partially downloaded files (restartfrom beginning)

--cookies FILE file to read cookies from and dump cookie jar in

--no-part do not use .part files

--no-mtime do not use the Last-modified header to set the file modification time

--write-description write video description to a .description file

--write-info-json write video metadata to a .info.json file

Verbosity / Simulation Options:

-q, --quiet activates quiet mode

-s, --simulate do not download the video and do not write anything to disk

--skip-download do not download the video

-g, --get-url simulate, quiet but print URL

-e, --get-title simulate, quiet but print title

--get-thumbnail simulate, quiet but print thumbnail URL

--get-description simulate, quiet but print video description

--get-filename simulate, quiet but print output filename

--get-format simulate, quiet but print output format

--no-progress do not print progress bar

--console-title display progress in console titlebar

-v, --verbose print various debugging information

Video Format Options:

-f, --format FORMAT video format code

--all-formats download all available video formats

--prefer-free-formats prefer free video formats unless a specific one is requested

--max-quality FORMAT highest quality format to download

-F, --list-formats list all available formats (currently youtube only)

Authentication Options:

-u, --username USERNAME account username

-p, --password PASSWORD account password

-n, --netrc use .netrc authentication data

Post-processing Options:

--extract-audio convert video files to audio-only files (requires ffmpeg and ffprobe)

--audio-format FORMAT "best", "aac", "vorbis", "mp3", "m4a", or "wav";

best by default

--audio-quality QUALITY ffmpeg audio bitrate specification, 128k by default

-k, --keep-video keeps the video file on disk after the post-processing; the video is erased by default

0

阅读 评论 收藏 禁止转载 喜欢 打印举报/Report
  • 评论加载中,请稍候...
发评论

    发评论

    以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

      

    新浪BLOG意见反馈留言板 电话:4000520066 提示音后按1键(按当地市话标准计费) 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

    新浪公司 版权所有