import requests import urllib.request import json #@url="http://api.gifshow.com/rest/n/magicFace/photograph?mod=OPPO(R7Plusm)&lon=0&country_code=cn&did=ANDROID_c52ff6fcfa276c1c&app=0&net=WIFI&oc=MYAPP&ud=756030030&c=MYAPP&sys=ANDROID_5.1.1&appver=5.4.4.5428&ftt=K-T-T&language=zh-cn&iuid=&lat=0&ver=5.4" url="http://api.ksapisrv.com/rest/n/feed/profile2?mod=OPPO(R7Plusm)&lon=117.45042&country_code=cn&did=ANDROID_c52ff6fcfa276c1c&app=0&net=WIFI&oc=MYAPP&ud=756030030&c=MYAPP&sys=ANDROID_5.1.1&appver=5.4.4.5428&ftt=K-T-T&language=zh-cn&iuid=&lat=38.867574&ver=5.4" headers={ 'X-REQUESTID':'928405', 'User-Agent':'kwai-android', 'Connection':'keep-alive', 'Accept-Language':'zh-cn', 'Content-Type':'application/x-www-form-urlencoded', 'Content-Length':'299', 'Host': 'api.ksapisrv.com', 'Accept-Encoding':'gzip' } data={ 'token':'6582742000a24a9ea50703162170bc5f-756030030', 'user_id':'12501365', 'lang':'zh', 'count':'30', 'privacy':'public', 'referer':'ks://profile/12501365/-1/-1/8,2', '__NStoken':'cc245624d01d384642201c9fd7b62aa1e38f50055a258403be9ef7ae5607b7f7', 'client_key':'3c2cd3f3', 'os':'android', 'sig':'93a3ab352ed2ead1eadf4d03e792d5af' } r=requests.post(url,data=data,headers=headers) json=json.loads(r.text) print(json) #urllib.request.urlretrieve(url,'344434.mp4')