| 317 | } |
| 318 | |
| 319 | async handleVlogTask() { |
| 320 | $.log("🔍 获取VLOG列表..."); |
| 321 | |
| 322 | const vlogRes = await this.request( |
| 323 | "GET", |
| 324 | `/qualcomm-app/api/article/vlogList?page=1&size=20&userId=${this.userId}&sortBy=1` |
| 325 | ); |
| 326 | |
| 327 | if (vlogRes.code === 200 && vlogRes.data?.records?.length) { |
| 328 | const vlogs = vlogRes.data.records; |
| 329 | $.log(`✅ 获取到 ${vlogs.length} 个VLOG`); |
| 330 | |
| 331 | // 只获取第一个VLOG,不管是否已观看 |
| 332 | const targetVlog = vlogs[0]; |
| 333 | $.log(`🎬 开始观看第一个VLOG: ${targetVlog.title.substring(0, 20)}...`); |
| 334 | $.log(`📊 时长: ${targetVlog.videoDuration} | 播放: ${targetVlog.playCountFormat} | 点赞: ${targetVlog.likeCount}`); |
| 335 | |
| 336 | const enterRes = await this.request( |
| 337 | "POST", |
| 338 | "/qualcomm-app/api/article/enterReadDaily", |
| 339 | `articleId=${targetVlog.id}&userId=${this.userId}` |
| 340 | ); |
| 341 | |
| 342 | if (enterRes.code === 200) { |
| 343 | $.log("✅ 进入VLOG观看成功"); |
| 344 | |
| 345 | // 固定观看70秒,不管视频时长 |
| 346 | const waitTime = 70000; |
| 347 | |
| 348 | $.log(`⏳ 模拟观看VLOG 70秒...`); |
| 349 | await $.wait(waitTime); |
| 350 | |
| 351 | const exitRes = await this.request( |
| 352 | "POST", |
| 353 | "/qualcomm-app/api/article/exitReadDaily", |
| 354 | `articleId=${targetVlog.id}&userId=${this.userId}` |
| 355 | ); |
| 356 | |
| 357 | if (exitRes.code === 200) { |
| 358 | $.log("✅ VLOG观看任务完成"); |
| 359 | |
| 360 | await this.request( |
| 361 | "GET", |
| 362 | `/qualcomm-app/api/article/like?articleId=${targetVlog.id}&userId=${this.userId}` |
| 363 | ); |
| 364 | |
| 365 | await this.request( |
| 366 | "POST", |
| 367 | "/qualcomm-app/api/article/shareDaily", |
| 368 | `articleId=${targetVlog.id}&userId=${this.userId}` |
| 369 | ); |
| 370 | |
| 371 | $.log("✅ VLOG点赞和分享完成"); |
| 372 | } else { |
| 373 | $.log(`⚠️ 退出VLOG观看失败: ${exitRes.message}`); |
| 374 | } |
| 375 | } else { |
| 376 | $.log(`❌ 进入VLOG观看失败: ${enterRes.message}`); |