b站视频下载到电脑【亲测有效】

b站视频下载到电脑【亲测有效】
方法1:利用github的开源python项目---you-get
方法特点:下载简单,速度贼快网速保底3M/s比迅雷还快,而且好像默认下载就是最清晰版本。我下载的就是默认最清晰的!支持国内外很多网站:
b站视频下载到电脑【亲测有效】b站视频下载到电脑【亲测有效】
操作方法是:
(1)下载安装python3.7(最新)
(2)pip3 install you-get
(3)在命令行工具中输入“you-get 视频链接”点击“enter”键就可以下载了。

如:you-get https://www.bilibili.com/video/BV1LJ411Y7og?p=6

PS:其他实用技巧
(1)you-get -i URL 预览各个画质的format参数(只会预览,不会下载):
注意这里多了一个“-i”,加了它就可以先预览下载的画质选择,可以看到有超清、高清、标清和渣清。
you-get -i https://www.bilibili.com/video/BV1LJ411Y7og?p=3

(2)you-get --format=dash-flv URL 下载指定画质参数的视频:
我们把URL替换成视频链接,输入,enter,就可以下载1080P画质的了。
you-get --format=dash-flv https://www.bilibili.com/video/BV1LJ411Y7og?p=3

b站视频下载到电脑【亲测有效】
b站视频下载到电脑【亲测有效】
b站视频下载到电脑【亲测有效】
b站视频下载到电脑【亲测有效】

b站视频下载到电脑【亲测有效】

==============
此外,因为bili的一个专题视频就后面页码变化,所以批量下载可以写个bat这样!
b站视频下载到电脑【亲测有效】

其他方法:见知乎专栏:
https://www.zhihu.com/question/41367609
本文方法也是来自这个链接

备注:务必是python3环境,下面是我公司centos7系统,默认python2,我试了python2不行,知乎直接安装yum install python3 之后,完全可以使用啦,如下:


[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# python
Python 2.7.5 (default, Jun 17 2014, 18:11:42) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>> 
>>> quit()
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# pip install you-get
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:380: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning,
/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:139: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning,
Collecting you-get
/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:139: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning,
  Downloading https://files.pythonhosted.org/packages/ac/51/a4d8efe889cb550f3269a2fa4f445bb8969a5160ab6edc83f36d60bb3c1a/you-get-0.4.1456.tar.gz (158kB)
     |████████████████████████████████| 163kB 55kB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yQslu5/you-get/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yQslu5/you-get/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-yQslu5/you-get/pip-egg-info
         cwd: /tmp/pip-install-yQslu5/you-get/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-yQslu5/you-get/setup.py", line 10, in <module>
        proj_info = json.loads(open(os.path.join(here, PROJ_METADATA), encoding='utf-8').read())
    TypeError: 'encoding' is an invalid keyword argument for this function
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:139: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning,
WARNING: You are using pip version 19.3.1; however, version 20.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# you-get
-bash: you-get: 未找到命令
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# yum install python3
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
base                                                                              | 3.6 kB  00:00:00     
extras                                                                            | 2.9 kB  00:00:00     
updates                                                                           | 2.9 kB  00:00:00     
zabbix                                                                            | 2.9 kB  00:00:00     
zabbix-non-supported                                                              |  951 B  00:00:00     
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.huaweicloud.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 python3.x86_64.0.3.6.8-13.el7 将被 安装
--> 正在处理依赖关系 python3-libs(x86-64) = 3.6.8-13.el7,它被软件包 python3-3.6.8-13.el7.x86_64 需要
--> 正在处理依赖关系 python3-setuptools,它被软件包 python3-3.6.8-13.el7.x86_64 需要
--> 正在处理依赖关系 python3-pip,它被软件包 python3-3.6.8-13.el7.x86_64 需要
--> 正在处理依赖关系 libpython3.6m.so.1.0()(64bit),它被软件包 python3-3.6.8-13.el7.x86_64 需要
--> 正在检查事务
---> 软件包 python3-libs.x86_64.0.3.6.8-13.el7 将被 安装
--> 正在处理依赖关系 libtirpc.so.1()(64bit),它被软件包 python3-libs-3.6.8-13.el7.x86_64 需要
---> 软件包 python3-pip.noarch.0.9.0.3-7.el7_7 将被 安装
---> 软件包 python3-setuptools.noarch.0.39.2.0-10.el7 将被 安装
--> 正在检查事务
---> 软件包 libtirpc.x86_64.0.0.2.4-0.16.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=========================================================================================================
 Package                        架构               版本                        源                   大小
=========================================================================================================
正在安装:
 python3                        x86_64             3.6.8-13.el7                base                 69 k
为依赖而安装:
 libtirpc                       x86_64             0.2.4-0.16.el7              base                 89 k
 python3-libs                   x86_64             3.6.8-13.el7                base                7.0 M
 python3-pip                    noarch             9.0.3-7.el7_7               updates             1.8 M
 python3-setuptools             noarch             39.2.0-10.el7               base                629 k

事务概要
=========================================================================================================
安装  1 软件包 (+4 依赖软件包)

总下载量:9.5 M
安装大小:48 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): libtirpc-0.2.4-0.16.el7.x86_64.rpm                                         |  89 kB  00:00:00     
(2/5): python3-3.6.8-13.el7.x86_64.rpm                                            |  69 kB  00:00:00     
(3/5): python3-setuptools-39.2.0-10.el7.noarch.rpm                                | 629 kB  00:00:01     
(4/5): python3-pip-9.0.3-7.el7_7.noarch.rpm                                       | 1.8 MB  00:00:02     
(5/5): python3-libs-3.6.8-13.el7.x86_64.rpm                                       | 7.0 MB  00:00:18     
---------------------------------------------------------------------------------------------------------
总计                                                                     530 kB/s | 9.5 MB  00:00:18     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : libtirpc-0.2.4-0.16.el7.x86_64                                                       1/5 
  正在安装    : python3-setuptools-39.2.0-10.el7.noarch                                              2/5 
  正在安装    : python3-libs-3.6.8-13.el7.x86_64                                                     3/5 
  正在安装    : python3-3.6.8-13.el7.x86_64                                                          4/5 
  正在安装    : python3-pip-9.0.3-7.el7_7.noarch                                                     5/5 
  验证中      : python3-pip-9.0.3-7.el7_7.noarch                                                     1/5 
  验证中      : python3-3.6.8-13.el7.x86_64                                                          2/5 
  验证中      : libtirpc-0.2.4-0.16.el7.x86_64                                                       3/5 
  验证中      : python3-setuptools-39.2.0-10.el7.noarch                                              4/5 
  验证中      : python3-libs-3.6.8-13.el7.x86_64                                                     5/5 

已安装:
  python3.x86_64 0:3.6.8-13.el7                                                                          

作为依赖被安装:
  libtirpc.x86_64 0:0.2.4-0.16.el7                python3-libs.x86_64 0:3.6.8-13.el7                    
  python3-pip.noarch 0:9.0.3-7.el7_7              python3-setuptools.noarch 0:39.2.0-10.el7             

完毕!
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# python3
Python 3.6.8 (default, Apr  2 2020, 13:34:55) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>> quit()
[root@nessus ~]# pip3 install you-get
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting you-get
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/9b/2c/9cb2637be0f09499bcb54fdec2f58ae7fabb2a347c94f62b19bdd7ed450e/you_get-0.4.1456-py3-none-any.whl (217kB)
    100% |████████████████████████████████| 225kB 120kB/s 
Installing collected packages: you-get
Successfully installed you-get-0.4.1456
[root@nessus ~]# 
[root@nessus ~]# 
[root@nessus ~]# you-get   https://www.bilibili.com/video/BV1LJ411Y7og?p=3
you-get: This is a multipart video. (use --playlist to download all parts.)
site:                Bilibili
title:               老男孩教育 openstack全新架构实战 (P3. 03-openstack的基础服务安装)
stream:
    - format:        flv
      container:     flv
      quality:       高清 1080P
      size:          102.3 MiB (107239520 bytes)
    # download-with: you-get --format=flv [URL]

Downloading 老男孩教育 openstack全新架构实战 (P3. 03-openstack的基础服务安装).flv ...
 2.4% (  2.5/102.3MB) ├██───────────────────────────────────────────────────────────────┤[1/1]   67 kB/s

猜你喜欢

转载自blog.51cto.com/8189171/2535206