Skip to content

itag-18 fallback videos (low res 360p) fail to seek later in videos #4244

Description

@t6fb3m59

Official Instance

Describe the bug

In short it's a piped-proxy issue with how it interprets the length of the video in bytes for the headers.

I have solved this on my fork's image: logicalkarma/piped-proxy.

Write-up from Claude:
Since handle_range_response_correction uses the upstream response's Content-Length as total_size, any range request with a non-zero start byte produces a malformed Content-Range header. The upstream Content-Length reflects the size of the returned chunk, not the full file, so the synthesized header has end < start and the wrong denominator. Curl ignores the header mismatch, and Librewolf typically dodges the bug because its eager-prefetch behavior issues a single open-ended range from byte 0 and never seeks past the buffer. Vanilla Firefox and Chromium both hit it on seek-past-buffer in itag-18 (360p progressive) playback, presenting as an indefinite "loading" spinner; in Chromium, DevTools shows the response aborting after ~700 bytes. The fix is to use the clen query parameter (canonical full file size) instead of the upstream Content-Length.

To Reproduce

  1. Find a video that fallbacks to itag-18 (no configurable resolution - 360p)
  2. Go somewhere towards the end of the video.
  3. Player loads indefinitely

Expected behavior

  1. Find a video that fallbacks to itag-18 (no configurable resolution - 360p)
  2. Go somewhere towards the end of the video.
  3. Player moves to the expected time and plays

Logs/Errors

No response

Browser, and OS with Version.

Anything that does not cache the entire video. All browsers except some privacy centric ones which avoid this bug unintentionally (Ironwolf, Librewolf).

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions