Skip to content

Commit 14718fa

Browse files
authored
Create wxsp.py
1 parent eb3279a commit 14718fa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

moumoubaimifan/wxsp.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import requests,re
2+
3+
url = 'https://mp.weixin.qq.com/s/C6P5RwIejmUrnovom3lZFg'
4+
5+
result = requests.get(url).text
6+
biz = re.search(r'__biz=(.*?)&',result)[1]
7+
mid = re.search(r'mid=(.*?)&',result)[1]
8+
vid = re.search(r'wxv_(.*?)\"',result)[0].replace('\"', '')
9+
10+
video_url = f'https://mp.weixin.qq.com/mp/videoplayer?action=get_mp_video_play_url&preview=0&__biz={biz}&mid={mid}&idx=1&vid={vid}&uin=&key=&pass_ticket=&wxtoken=777&devicetype=&clientversion=&__biz={biz}&appmsg_token=&x5=0&f=json'
11+
12+
url_info = requests.get(video_url).json()['url_info'][0]['url']
13+
14+
resp = requests.get(url_info, stream=True )
15+
16+
with open('day10.mp4', 'wb') as f:
17+
f.write(resp.content)
18+
19+
print('视频下载完成')

0 commit comments

Comments
 (0)