import requests
#找媒体的请求url即可。
url = ‘https://f3e3963e336d9d3bdc18adcb0240e796.v.smtcdns.com/music.qqvideo.tc.qq.com/AIRFhqAd3UEXqwLOz5sfupz_V8TD-xZxVeAZnZUXZJYg/B_JxNyiJmktHRgresXhfyMep_mLAvgwYmAjetftmCCCW-f7a09P0_-_3BS3XuKJsUR/k0012md5982.mp4?sdtfrom=v1010&guid=a322e9450a981bf9&vkey=BB8D1AFC4C01F96A9FF0DCABDAC60CF21E0F1288C1BE1E8C49F49C7B89BD548F81B2E1F2D9AF2D550A2F3BA3D8C4934A754DAC8C8ADF662F67F6199FBCFCA2CDB205BC5179CE5ABAC0325A36448F9D2BCF441F9E80705963C39E8D8E118A2ED353AD385241218109506C20E2270A5B6A30AC4CFC42C94C711386EA51C51629A8315F869BEDDD3994DF71A46C4911B8599AED9A8C6B071171A2A51CC3A031FB007305F0A26824FF0C185B3924E5EB44A7CC76CC5032839545’
he = {
‘user-agent’:‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0’,
‘referer’:‘https://v.qq.com/’
}
resp = requests.get(url)
print(resp.status_code)#响应码,200成功,403拒绝,404丢失,500错误。
open(f’富士山下.mp4’, mode=‘wb’).write(resp.content)
print(f"音乐mv保存完成!")