jackwener/OpenCLI · error · CommandExecutionError
Xiaoyuzhou playback progress exceeded duration for eid ${eid
Error message
Xiaoyuzhou playback progress exceeded duration for eid ${eid} What it means
parseProgressRows sanity-checks that a row's playback position never exceeds the episode duration learned from history. This error means the reported progress in seconds is larger than the episode's duration, indicating corrupted, mis-joined, or wrong-unit data.
Source
Thrown at clis/xiaoyuzhou/history.js:130
for (const [index, row] of response.data.entries()) {
if (!isRecord(row)) {
throw new CommandExecutionError(`Xiaoyuzhou playback progress row ${index + 1} is malformed`);
}
const eid = requiredId(row.eid, `progress eid in row ${index + 1}`);
const episode = requested.get(eid);
if (!episode) {
throw new CommandExecutionError(`Xiaoyuzhou playback progress returned unrequested eid ${eid}`);
}
if (progressById.has(eid)) {
throw new CommandExecutionError(`Xiaoyuzhou playback progress returned duplicate eid ${eid}`);
}
const pid = requiredId(row.pid, `progress pid in row ${index + 1}`);
if (pid !== episode.pid) {
throw new CommandExecutionError(`Xiaoyuzhou playback progress pid did not match history eid ${eid}`);
}
const progressSec = optionalSeconds(row.progress, `progress in row ${index + 1}`);
if (progressSec !== null && episode.durationSec !== null && progressSec > episode.durationSec) {
throw new CommandExecutionError(`Xiaoyuzhou playback progress exceeded duration for eid ${eid}`);
}
progressById.set(eid, {
progressSec,
playedAt: optionalIsoTime(row.playedAt, `playedAt in row ${index + 1}`),
});
}
for (const episode of episodes) {
if (!progressById.has(episode.eid)) {
throw new CommandExecutionError(
`Xiaoyuzhou playback progress omitted requested eid ${episode.eid}; the history join is incomplete`,
);
}
}
return progressById;
}
async function fetchHistory(args = {}) {
const fetchAll = args.all ?? false;View on GitHub (pinned to 49907e53dc)
Solutions
- Inspect row.progress and episode.durationSec units; convert progress to seconds (e.g. divide by 1000) if the API switched units.
- Re-fetch both history and progress so durations and progress come from the same snapshot.
- Clamp or filter progress values that exceed duration before parsing if you control the data source.
- Report the anomalous response to the API provider if live data is genuinely inconsistent.
Example fix
// before
const progressSec = optionalSeconds(row.progress, `progress in row ${index + 1}`);
// after (API changed to milliseconds)
const rawProgress = optionalSeconds(row.progress, `progress in row ${index + 1}`);
const progressSec = rawProgress === null ? null : Math.min(Math.round(rawProgress / 1000), episode.durationSec ?? Infinity); Defensive patterns
Strategy: validation
Validate before calling
for (const r of progressRows) {
const ep = episodesById.get(r.eid);
if (ep && ep.durationSec !== null && r.progress > ep.durationSec) {
throw new Error(`progress ${r.progress} exceeds duration ${ep.durationSec} for ${r.eid}`);
}
} Try / catch
try {
const progress = progressById(episodes);
} catch (e) {
if (e instanceof CommandExecutionError && /exceeded duration/.test(e.message)) {
console.error('Unit mismatch or bad progress data:', e.message);
} else throw e;
} Prevention
- Confirm progress and duration use the same time unit (seconds vs milliseconds).
- Clamp or drop physically impossible progress values at the data boundary.
- Fetch history and progress from the same snapshot.
When it happens
Trigger: A progress row has progress greater than the matching episode's durationSec — e.g. progress reported in milliseconds while duration is in seconds, a missing/zero duration from history, or the server returning garbage progress values.
Common situations: Upstream switches progress to milliseconds; history entries with missing durations paired with large progress values; fixtures with inconsistent units; bugs producing inflated progress values.
Related errors
- Bilibili view API returned duplicate page entries for p=${pa
- No user message found in request
- 获取到的视频播放信息对象不符合预期格式
- Bilibili view API returned a malformed ${label}
- Bilibili view API did not return pages[] for --page selectio
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/ed2711640ba72c7b.
Report an issue: GitHub.