Hi. , Hello, everyone , This is the demon king ~
Today, I accidentally opened a website , I saw the essence of its dance area MP4,
At first glance, it's out of control , But it's too bold , I'm afraid it's off the shelf , Hurriedly opened my python
Write this code and download them all , Enjoy ~
import requests
import re
url = 'https://v..com/api/stream/getStreamUrl'
data = {
'v': '220320220627',
'did': '10000000000000000000000000001501',
'tt': '1656318502',
'sign': 'f0194e25c25283cbd53ef52c0acf45f8',
'vid': 'kDe0W29DOwaMA4Bz',
}
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36'
}
response = requests.post(url=url, data=data, headers=headers)
print(response.json())
m3u8_url = response.json()['data']['thumb_video']['high']['url']
print(m3u8_url)
m3u8_data = requests.get(url=m3u8_url, headers=headers).text
m3u8_data = re.sub('#E.*', '', m3u8_data).split()
for ts in m3u8_data:
ts_url = 'https://play-tx-ugcpub..cn/live/high_33282775320220508200007-upload-d9f8/' + ts
ts_content = requests.get(url=ts_url, headers=headers).content
with open('【 Milk and rice 】05-07 This popularity value TOP2 dance .mp4', mode='ab') as f:
f.write(ts_content)
print(ts_url)
This code is provided by : Qingdeng Education - Self Travel
There is no fast track to success , There is no highway to happiness .
All the successes , All come from tireless efforts and running , All happiness comes from ordinary struggle and persistence
—— Inspirational quotes
This article is finished ~ Interested partners can copy the code to try
Your support is my biggest motivation !! Remember Sanlian ~ Welcome to read previous articles ~