代码语言:javascript复制
import requests
import json
headers={
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
}
sd=int(input("请输入qq:"))
url=f'https://api.yum6.cn/qq.php?qq={sd}'
resu=requests.get(url=url,headers=headers)
resu.encoding='utf-8'
s=json.loads(resu.text)
print(f"你的qq名字:{s['name']}nqq头像照片地址:{s['img']}")