Replies: 2 comments
-
哦没事了,脑子坏掉了,全功率写了两天python |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
def createOrder():
url = "https://show.bilibili.com/api/ticket/order/createV2"
data = {
"project_id": BasicInfo.config["ShowID"],
"screen_id": BasicInfo.config["DateID"],
"sku_id": BasicInfo.config["TypeID"],
"tel": BasicInfo.config["Phone"],
"token": BasicInfo.config["Token"],
"count": BasicInfo.config["BuyerCount"],
"pay_money": int(BasicInfo.config["PriceTotal"]) * 100,
"timestamp": int(time.time() + 5),
"order_type": 1,
"again": 1,
"newRisk": True,
}
buyers = []
loc = 0
for buyer in BasicInfo.config["Buyers"]:
buyers.append(Cache.CacheInfo.buyerCache[buyer])
loc += 1
data["buyer_info"] = buyers
data["buyer"] = buyers[0]["name"]
BasicVoid.sendInfo(json.dumps(data, sort_keys=True, indent=4, separators=(',', ':')))
result = BasicInfo.session.post(url, headers=BasicInfo.headers, data=data)
BasicVoid.sendInfo(str(result))
returnCode = int(result["errno"])
if returnCode == 0:
BasicVoid.sendInfo("抢票成功!")
return result
if returnCode == 100051:
BasicVoid.sendWarn("Token已过期!重新获取!")
API.APIGetPrepare.getPrepare()
return result
return result
以上为这部分的代码实现(我自己的)
其中包含了一些debug用的东西可以无视
当我用以上方法发起请求时,收到的响应只有
<Response [200]>
这一行
请问可能是什么原因呢(?
希望有大佬解惑
Beta Was this translation helpful? Give feedback.
All reactions