I used to watch a video , You may also have to find the download button , Or there are some disguised download buttons , Result one click , What pops up is an advertisement , It's bad …
however
When there's a Python after , We just need to run , Download it in minutes , As long as you want , There is nothing that cannot be downloaded .
development environment :
edition Ben : python 3.8
Editor :pycharm 2021.2
Third party Library :
requests >>> pip install requests
tqdm >>> pip install tqdm
I explained everything in detail in the video , Just learned Python My brother can watch the video and follow the operation .
Python Reptiles : Parse any video
I have blocked the download address , See the video for detailed operation
import requests
import re
from tqdm import tqdm
print(requests.get('https://***.com/20210731/Ippn8ThS/index.m3u8').text)
response = requests.get('https://.....com/20220205/B7TL7zXw/index.m3u8')
ts_list = re.sub('#E.*', '', response.content.decode()).split()
for ts in tqdm(ts_list):
video_data = requests.get(ts).content
with open('1.mp4', mode='ab') as f:
f.write(video_data)
function
Here I name the download as 1, You can change your name in the code .
Brothers, go and have a try !