fix(dash): require a matching 206 for the segmentbase init and fetch it from its sourceurl

This commit is contained in:
imSp4rky
2026-11-26 13:40:08 -07:00
parent 4738cc044a
commit 8cf915fd71
5 changed files with 115 additions and 23 deletions
+2 -2
View File
@@ -373,11 +373,11 @@ def test_a_single_file_dash_track_is_cut_by_its_segment_index(monkeypatch: pytes
box = sidx_box()
requested: list[str] = []
def get(url: str, headers: dict[str, str] | None = None) -> MagicMock:
def get(url: str, headers: dict[str, str] | None = None, stream: bool = False) -> MagicMock:
byte_range = (headers or {}).get("Range", "")
requested.append(byte_range)
content = box if byte_range == f"bytes=800-{800 + len(box) - 1}" else b"\x00" * 800
return MagicMock(content=content, headers={"Content-Range": "bytes 0-799/900000"})
return MagicMock(content=content, status_code=206, headers={"Content-Range": "bytes 0-799/900000"})
tree = load_xml(SIDX_MPD.format(last=800 + len(box) - 1).encode())
period = tree.find("Period")