From 1a0fbbc5d202fd025bd362d97adc5c8f5ae494f8 Mon Sep 17 00:00:00 2001 From: GamerNoTitle Date: Fri, 20 Nov 2020 17:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E9=83=A8=E5=88=86=E5=AE=8C=E6=88=90(=E4=BB=8D?= =?UTF-8?q?=E7=84=B6=E6=9C=AA=E8=83=BD=E6=8A=95=E5=85=A5=E4=BD=BF=E7=94=A8?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index d77ff5d..51be0f3 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,36 @@ import sys -import requests +import requests as r +import json + +sign='' +current='https://n.cg.163.com/api/v2/client-settings/@current' +cookie=sys.argv[1] + +header={ + 'Host': 'n.cg.163.com', + 'Connection': 'keep-alive', + 'Accept': 'application/json, text/plain, */*', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', + 'X-Platform': '0', + 'Authorization': cookie, + 'Origin': 'https://cg.163.com', + 'Sec-Fetch-Site': 'same-site', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Dest': 'empty', + 'Referer': 'https://cg.163.com/', + 'Accept-Encoding': 'gzip, deflate, br', + 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja-JP;q=0.6,ja;q=0.5' +} + +def post(url,data,header): + result=r.post(url=url,headers=header) + return result + +def getme(url,data,header): + result=r.get(url=url,headers=header) + print(result) + return result if __name__ == "__main__": - pass \ No newline at end of file + me=getme(current,None,header) + print(me.text) \ No newline at end of file