MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / complete_task

Function complete_task

wxapp/quanmianshidai.py:333–355  ·  view source on GitHub ↗
(code, token, tid)

Source from the content-addressed store, hash-verified

331
332# 任务 数据
333def complete_task(code, token, tid): # 棉花工厂
334 url = "https://sg01.purcotton.com/api/task/complete-manual-task"
335 headers = create_headers(code, token)
336 payload = {
337 "tid": tid,
338 "relate_id": 0,
339 }
340
341 try:
342 response = requests.post(url, headers=headers, json=payload)
343 response.raise_for_status() # 检查HTTP响应状态码,如果不是200系列,则抛出异常
344
345 # 解析响应数据
346 response_data = response.json()
347 if response_data.get("code") == 200:
348 print("奖励领取成功。")
349 tjlq_mpjl(code, token, tid)
350 else:
351 # 如果响应中的code不是200,打印错误信息
352 print(f"任务失败:{response_data.get('msg')}")
353 except requests.exceptions.RequestException as e:
354 # 如果请求过程中发生异常,打印异常信息
355 print(f"请求失败: {e}")
356
357
358def lq_fd(code, token, tid): # 三餐福袋和签到

Callers 1

pdrwFunction · 0.85

Calls 5

create_headersFunction · 0.85
tjlq_mpjlFunction · 0.85
printFunction · 0.50
postMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected