logo

ScriptCat

  • Home
  • Community
  • Script List
  • Browser Extension
  1. /
  2. Script Market
  3. /
  4. OCS 网课助手
  • Overview
  • Code
  • Feedback
    108
  • Ratings
  • Version List
ScriptCat
GitHub
Audit Logs
Service Agreement
Privacy Policy
Disclaimer

© 2022-Present ScriptCat. All rights reserved.

智慧树无法找到学习视频bug
Pending#1578jimleeeCreated 9 months ago

Loading…
  • 言小溪enncy9 months ago

    Loading…
  • Clarity9 months ago

    Loading…
  • jimleee9 months ago

    Loading…
  • 言小溪enncy9 months ago

    Loading…
  • zero-5 days ago

    Loading…
No data
Login to comment
Labels
Watch
Participants

智慧树新形态课程AI界面显示未找到学习视频,但PPT和文档都可以刷,视频无法识别

已修复

我这里依然存在这个问题

已修复

还是无法识别到视频

已修复

还是无法识别到视频

截个图,或者去官方群私信我

补充复现:脚本 5.6.1(2026-11-24 版)仍然存在,智慧树 AI教学中心「新形态课程」的 .mp4 章节 100% 复现。

页面:https://hike-teaching-center.polymas.com/agent-course-full/{courseId}/stu/study 日志:每进入一个视频小节约 5 秒后必出「未找到学习视频,即将自动下一节!」,3 秒后跳下一节,整章 6~7 秒扫完;而此时视频其实正在正常播放。

定位:视频实际加载于 https://polymas.com/resource/online/preview/?fileId=...&studyReport=true 的跨域 iframe 内。zhs.hike_v2.study 的 doWork 中:

try {
  const wrapper = document.querySelector(".video-player-wrapper");
  if (!wrapper || wrapper.style.display === "none") throw new Error("视频加载失败");
  await waitForMedia({ timeout: 5 * 1e3, filter: (m) => m.src.length !== 0 });
} catch {
  const msg = "未找到学习视频,即将自动下一节!";
  lib.$message.warn(msg); $console.warn(msg);
  await lib.$.sleep(3e3);
  await next2();
  return;
}

而 waitForMedia 的实现是: const video = (options?.root || document).querySelector(${options?.videoSelector || "video"},${options?.audioSelector || "audio"}); 即只查当前 document。5.6.1 的 @match 已包含 ://.polymas.com/*,但顶层页面依然拿不到 iframe 里的 video,5 秒超时后直接 next2()。

建议:

  1. 超时后不要 next2(),改为原地重试或暂停提示——现在会把整章刷成「0 时长已完成」,对用户进度记录影响很大;
  2. 通过 postMessage 让 preview 域内的脚本回报 media 的 currentTime/duration/ended,或对同源 iframe 递归查找。

需要录屏与完整课程 URL 我可提供。