WIN下利用PYTHON下载网页视频

上一篇文章讲了KALI系统下利用PYTHON下载网页视频,但实际情况下,绝大多数人不像我一样用LINUX系统,而用的WIN系统,下面讲一下如何在WIN下利用PYTHON库——you-get下载网页视频。

一、安装PYTHON,这个简单,到PYTHON官网下载安装包,直接安装就可以了,这个不多讲;

二、安装you-get库。快捷键WIN+R,打开“运行”,输入CMD,打开命令符界面,输入代码:pip3 install you-get,回车,等了半天出现安装错误;

C:\Users\hero>pip3 install you-get
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000201BBD29EA0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/you-get/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/you-get/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000201BBD2A3E0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/you-get/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000201BBD2A5C0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/you-get/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000201BBD2A7A0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/you-get/
ERROR: Could not find a version that satisfies the requirement you-get (from versions: none)
ERROR: No matching distribution found for you-get

三、解决思路有两个:1.安装翻墙软件(本人用的是蓝灯),然后再输入安装代码安装;2.更换国内的安装源(本人选阿里的源),这里推荐用第二种方法(你懂的),输入代码:pip3 install you-get -i http://mirrors.aliyun.com/pypi/simple/ –trusted-host mirrors.aliyun.com,回车,you-get安装成功;

C:\Users\hero>pip3 install you-get -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting you-get
  Downloading http://mirrors.aliyun.com/pypi/packages/a9/58/382ba8588318b1be53b2de34c136d81c04d2c997bd24c5e5c000d72f74f4/you_get-0.4.1545-py3-none-any.whl (228 kB)
     |████████████████████████████████| 228 kB ...
Installing collected packages: you-get
Successfully installed you-get-0.4.1545
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'C:\Users\hero\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.

四、输入代码: you-get https://www.bilibili.com/video/BV1u44y1x7yq?spm_id_from=333.6.0.0 (即:you-get 视频网址),回车,稍后视频会下载到 C:\Users\hero 文件夹中。

C:\Users\hero>you-get https://www.bilibili.com/video/BV1u44y1x7yq?spm_id_from=333.6.0.0
site:                Bilibili
title:               水友邮件诉苦毕业两年人生无望 周姐在线痛斥句句真实伤害
stream:
    - format:        flv
      container:     flv
      quality:       高清 1080P
      size:          33.7 MiB (35285590 bytes)
    # download-with: you-get --format=flv [URL]

Downloading 水友邮件诉苦毕业两年人生无望 周姐在线痛斥句句真实伤害.flv ...
 100% ( 33.7/ 33.7MB) ├████████████████████████████████████████┤[1/1]    0  B/s

Downloading 水友邮件诉苦毕业两年人生无望 周姐在线痛斥句句真实伤害.cmt.xml ...