import urllib.request import urllib.parse headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62', 'cookie': 'dy_did=2d94e9b7d6a5001bc619003600071601; acf_did=2d94e9b7d6a5001bc619003600071601; dy_teen_mode=%7B%22uid%22%3A%22206418261%22%2C%22status%22%3A0%2C%22birthday%22%3A%22%22%2C%22password%22%3A%22%22%7D; dy_did=2d94e9b7d6a5001bc619003600071601; acf_auth=bb76xoxHtF%2FSmytd4WBdTzxrVyzB1AawmeD67ujBzfJtDZNcPx9la8F1UZkaahrJmHaoLwy1AGUfH3vc%2BDxwhPX3gPOd8VuRcqvI7ZNOEb5kzXGbTLCF%2FKc; dy_auth=84f2KLeFyQ0v3YgYuNTR635LsI81MMw0HIlETKDC8Hw2EcLq4eqzu34oIOkNZIlWfhhNFB6Q0rj2P4F7YR5zg5s8lFbuLEozVIPljhtK6B84C%2BPswFmub%2B4; wan_auth37wan=f79a56072603F18RPY%2F1RbR%2FZLt8HA4FqOhznEE22viuwkR60jXeginErnJBpdbwHl%2BI%2BTGCruPCW9Etapm3LOVAnuywHmhp2S%2BmVTd58os0JPZPDJg; acf_uid=206418261; acf_username=206418261; acf_nickname=%E4%B8%80%E4%B8%AA%E5%81%8F%E6%89%A7%E7%8B%82%E4%B8%BF; acf_own_room=0; acf_groupid=1; acf_phonestatus=1; acf_ct=0; acf_ltkid=99728742; acf_biz=1; acf_stk=119cc882f55f327a; Hm_lvt_e99aee90ec1b2106afe7ec3b199020a7=1695817772,1695897568,1695950375,1696033737; acf_ccn=5152c6ddc463fd654de6fb2311c52210; PHPSESSID=md3okopb68eohtdn7ktbpr92t6; acf_avatar=https%3A%2F%2Fapic.douyucdn.cn%2Fupload%2Favatar_v3%2F201904%2F8fe6042c89814fa28a9e708e41e11c3f_; Hm_lpvt_e99aee90ec1b2106afe7ec3b199020a7=1696075905', } url = 'https://www.douyu.com/lapi/member/api/getInfo?client_type=0&d=1696075932098' request = urllib.request.Request(url=url, headers=headers) response = urllib.request.urlopen(request) content = response.read().decode('utf-8') print(content)
标签:acf,22%,request,urllib,获取,cookie,3A%,dy,带上 From: https://www.cnblogs.com/sgj191024/p/17738318.html