环境

python3.7
bt 6.8.8

使用requests.Session()保存cookie

代码如下

# -*- coding: utf-8 -*- import requests s = requests.Session() headers = { 'Host':'1.1.1.1:5265', 'Connection':'keep-alive', 'Content-Length':'41', 'Accept':'*/*', 'Origin':'http://1.1.1.1:5265', 'X-Requested-With':'XMLHttpRequest', 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8', 'Referer':'http://1.1.1.1:5265/8e5457/', 'Accept-Encoding':'gzip, deflate', 'Accept-Language':'zh-CN,zh;q=0.9' } date = { 'username':'aaaaa', 'password':'bbbbb', 'code':'' } url = 'http://1.1.1.1:5265/8e5457/' req = s.post(url=url,data=date,headers=headers) url1 = 'http://1.1.1.1:5265/firewall' ser = s.get(url=url1,headers=headers) print(ser.text)

写这个主要懒为了每个月登录3次面板方便撸bt专业版
7.jpg

如果觉得我的文章对你有用,请随意赞赏