我们使用的是联图二维码
首先我们先获取登录接口
F12调试
https://user.liantu.com/login/i/
# -*- coding: utf-8 -*-
from urllib import request, parse
login_url = "https://user.liantu.com/login/i/"
headers={
"Host":"user.liantu.com",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
}
dict = {
"username": "**********",
"password": "**********"
}
data = bytes(parse.urlencode(dict), encoding='utf-8')
req = request.Request(url=login_url, data=data, headers=headers)
response = request.urlopen(req)
print(response.read().decode('utf-8'))
运行调试
接下来我们模式post传输数据并保存修改好的数据
# -*- coding: utf-8 -*-
import os
import login
from urllib import request, parse
qiansui_version = os.listdir(r'C:\Users\dev&keep\Desktop\kobe')
print(qiansui_version[0])
login_url = "https://user.liantu.com/live/save/"
headers={
"Host":"user.liantu.com",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
"Cookie":"PHPSESSID=nqq32rp1hmtkb27c04bk12od2o; Hm_lvt_8a9ea981831ca02c60b392502a9b2980=1591174481; Hm_lpvt_8a9ea981831ca02c60b392502a9b2980=1591688189",
}
dict = {
"name": "千随APP",
"link": "http://IP/test/{0}".format(qiansui_version[0]),
"id": "126646",
"style": "1",
}
data = bytes(parse.urlencode(dict), encoding='utf-8')
req = request.Request(url=login_url, data=data, headers=headers)
response = request.urlopen(req)
print(response.read().decode('utf-8'))
cookie改成自己的接口cookie
运行调试