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

Method handle_unknown_task_cloud

daily/chinaUnicom.py:3241–3274  ·  view source on GitHub ↗
(self, task_code, task_name="")

Source from the content-addressed store, hash-verified

3239 self.finalize_generic_task_cloud(task_code, task_name)
3240
3241 def handle_unknown_task_cloud(self, task_code, task_name=""):
3242 token = getattr(self.cloudDisk, 'userToken', '')
3243 if not token:
3244 return False
3245 headers = {
3246 'User-Agent': 'LianTongYunPan/5.0.4 (iOS 16.3)',
3247 'Accept': 'application/json, text/plain, */*',
3248 'Content-Type': 'application/json',
3249 'Accept-Encoding': 'br;q=1.0, gzip;q=0.9, deflate;q=0.8',
3250 'Access-Token': token, 'X-YP-Access-Token': token,
3251 'Client-Id': '1001000035', 'X-YP-Client-Id': '1001000035',
3252 'App-Version': 'yp-app/5.0.4', 'app-type': 'liantongyunpanapp',
3253 'Sys-Version': 'iOS/16.3',
3254 'Accept-Language': 'zh-Hans-CN;q=1.0',
3255 }
3256 prefix = f"云盘任务: [{task_name}]" if task_name else "云盘任务: 未知任务"
3257 try:
3258 res = self.session.post(
3259 self.cloudDiskUrls['taskFinish'],
3260 json={"taskCode": task_code, "taskStatus": {"isBackUp": "1"}},
3261 headers=headers,
3262 timeout=10,
3263 ).json()
3264 meta_code = str(res.get('meta', {}).get('code'))
3265 if meta_code == '90003600':
3266 self.log(f"{prefix} 处理完成")
3267 return True
3268 if meta_code in ('200', '0') or str(res.get('code')) in ('200', '0', '0000'):
3269 self.log(f"{prefix} 处理完成: {res.get('msg', res.get('meta', {}).get('message', '成功'))}")
3270 return True
3271 self.log(f"{prefix} 处理失败: {res}")
3272 except Exception as e:
3273 self.log(f"云盘任务: [{task_name or task_code}] 处理失败: {e}")
3274 return False
3275
3276 def ltyp_task(self, is_query_only=False):
3277 self.log("==== 联通云盘任务 ====")

Callers 1

Calls 3

logMethod · 0.95
postMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected