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 ...

作者: 張津東

群而不黨,和而不同,自由理性皆容納。

發表回復