视频下载神器you-get使用方法

Posted ZONG_XP

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了视频下载神器you-get使用方法相关的知识,希望对你有一定的参考价值。

0 背景

还在为视频下载而烦恼吗?作为一名新时代农民工,代码就是最好的工具。推荐一款视频下载神器 you-get,只需要一个命令行,就可以下载到你想要的视频,不需要下载其他乱七八糟的工具,

项目地址:GitHub - soimort/you-get: Dumb downloader that scrapes the web:arrow_double_down: Dumb downloader that scrapes the web - GitHub - soimort/you-get: Dumb downloader that scrapes the webhttps://github.com/soimort/you-get

查看一下支持的网站你就知道多牛了

1 安装方法

如果是在 linux 上安装,可通过 pip 指令

$ pip3 install you-get

如果是在 windows 上使用,可直接下载安装包

2 下载视频

比如我们想下载一个B 站上的视频,链接为《C4D OC渲染器基础入门中文教程-(持续更新)Octane中文教程》,打开后找到视频地址

 复制一下,可以查看该视频支持的分辨率,标有 [DEFAULT] 的是下载的默认画质,为最高画质,下载时可以根据提示,使用 --format 指令指定要下载的分辨率

$ you-get -i "https://www.bilibili.com/video/BV1Dt4y1e7mM?share_source=copy_web"
site:                Bilibili
title:               C4D OC渲染器基础入门中文教程-(持续更新)Octane中文教程 (P1. 简介)
streams:             # Available quality and codecs
    [ DASH ] ____________________________________
    - format:        dash-flv
      container:     mp4
      quality:       高清 1080P
      size:          5.0 MiB (5284854 bytes)
    # download-with: you-get --format=dash-flv [URL]

    - format:        dash-flv720
      container:     mp4
      quality:       高清 720P
      size:          4.2 MiB (4354841 bytes)
    # download-with: you-get --format=dash-flv720 [URL]

    - format:        dash-flv480
      container:     mp4
      quality:       清晰 480P
      size:          3.2 MiB (3313700 bytes)
    # download-with: you-get --format=dash-flv480 [URL]

    - format:        dash-flv360
      container:     mp4
      quality:       流畅 360P
      size:          1.6 MiB (1722154 bytes)
    # download-with: you-get --format=dash-flv360 [URL]

    [ DEFAULT ] _________________________________
    - format:        flv
      container:     flv
      quality:       高清 1080P
      size:          6.8 MiB (7170233 bytes)
    # download-with: you-get --format=flv [URL]

    - format:        flv720
      container:     flv
      quality:       高清 720P
      size:          5.5 MiB (5746856 bytes)
    # download-with: you-get --format=flv720 [URL]

    - format:        flv480
      container:     flv
      quality:       清晰 480P
      size:          2.8 MiB (2983326 bytes)
    # download-with: you-get --format=flv480 [URL]

    - format:        flv360
      container:     flv
      quality:       流畅 360P
      size:          1.7 MiB (1752679 bytes)
    # download-with: you-get --format=flv360 [URL]

比如我们要下载一个 720p 分辨率的视频,输入指令如下

$ you-get --format=flv720 "https://www.bilibili.com/video/BV1Dt4y1e7mM?share_source=copy_web"
site:                Bilibili
title:               C4D OC渲染器基础入门中文教程-(持续更新)Octane中文教程 (P1. 简介)
stream:
    - format:        flv720
      container:     flv
      quality:       高清 720P
      size:          5.5 MiB (5746856 bytes)
    # download-with: you-get --format=flv720 [URL]

Downloading C4D OC渲染器基础入门中文教程-(持续更新)Octane中文教程 (P1. 简介).flv ...
 100% (  5.5/  5.5MB) ├████████████████████████████████████████┤[1/1]   12 MB/s

3 下载其它

当然该指令也可以下载图片或者其它媒体文件,直接给定 URL 即可,比如

$ you-get https://stallman.org/rms.jpg
Site:       stallman.org
Title:      rms
Type:       JPEG Image (image/jpeg)
Size:       0.06 MiB (66482 Bytes)

Downloading rms.jpg ...
100.0% (  0.1/0.1  MB) ├████████████████████████████████████████┤[1/1]  127 kB/s

或者给定一个网页,会自动检查可下载的媒体文件

$ you-get http://kopasas.tumblr.com/post/69361932517
Site:       Tumblr.com
Title:      kopasas
Type:       Unknown type (None)
Size:       0.51 MiB (536583 Bytes)

Site:       Tumblr.com
Title:      tumblr_mxhg13jx4n1sftq6do1_1280
Type:       Portable Network Graphics (image/png)
Size:       0.51 MiB (536583 Bytes)

Downloading tumblr_mxhg13jx4n1sftq6do1_1280.png ...
100.0% (  0.5/0.5  MB) ├████████████████████████████████████████┤[1/1]   22 MB/s

以上是关于视频下载神器you-get使用方法的主要内容,如果未能解决你的问题,请参考以下文章

You-Get开源在线下载神器,搭配python更加丝滑(文中案例演示)

You-Get开源在线下载神器,搭配python更加丝滑(文中案例演示)

You-Get 就是这么强势!

爬虫利器_you-get

爬虫利器_you-get

you-get:一行命令下载视频和Python简单使用you-get