mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-28 04:49:09 +00:00
Lift the 120s cap on Disney+ relative-seek so large seeks reach target
Disney+ has no absolute seek on its blob <video>, so absolute seeks are translated into repeated clicks of the player's relative skip button. The click count was capped at 12 (=120s at 10s/step), so any seek further than two minutes away silently landed short — breaking absolute-position sync (e.g. syncing to 5:00 from far away never arrived). Derive the step size from the matched button's own label (10s default, some UIs use 5/15/30) and issue enough clicks to cover the full delta, bounded at a sane maximum. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+13
-6
@@ -239,12 +239,19 @@
|
||||
textParts.push(text);
|
||||
}
|
||||
// Disney's scrubber aria-valuenow can lag several seconds behind
|
||||
// real playback; a "time remaining" indicator updates live, so
|
||||
// capture it and later derive current = duration - remaining.
|
||||
const remClass = String(node.getAttribute?.('class') || '') + ' ' + String(node.getAttribute?.('data-testid') || '');
|
||||
if (/remain/i.test(remClass)) {
|
||||
const remMatch = String(node.textContent || '').match(/\d{1,3}:\d{2}(?::\d{2})?/);
|
||||
const rem = remMatch ? parseClockTime(remMatch[0]) : null;
|
||||
// real playback; a "time remaining" indicator updates live, so
|
||||
// capture it and later derive current = duration - remaining.
|
||||
const remClass = String(node.getAttribute?.('class') || '') + ' ' + String(node.getAttribute?.('data-testid') || '');
|
||||
if (/remain/i.test(remClass)) {
|
||||
const remMatch = String(node.textContent || '').match(/\d{1,3}:\d{2}(?::\d{2})?/);
|
||||
const rem = remMatch ? parseClockTime(remMatch[0]) : null;
|
||||
if (Number.isFinite(rem) && rem >= 0) remainingSeconds = rem;
|
||||
}
|
||||
}
|
||||
|
||||
if (best && remainingSeconds !== null && best.duration > 0) {
|
||||
const liveCurrent = best.duration - remainingSeconds;
|
||||
if (liveCurrent >= 0 && liveCurrent <= best.duration + 5) {
|
||||
considerTimeline({ current: Math.min(liveCurrent, best.duration), duration: best.duration }, 'time-remaining', 1000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user