Skip to content

stream.dash: various SegmentList/SegmentTemplate fixes #5247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
stream.dash: make SegmentList.SegmentURL optional
The number of `SegmentURL` nodes in `SegmentList` can be zero, e.g. when
the `SegmentList` gets overridden in a descendant node
  • Loading branch information
bastimeyer committed Mar 14, 2023
commit 724cd9d6a5ab6192dbb28d1b5f949ea59e3e2969
4 changes: 2 additions & 2 deletions src/streamlink/stream/dash_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def __init__(self, *args, period: "Period", **kwargs) -> None:
self.duration_seconds = self.duration / self.timescale if self.duration and self.timescale else None

self.initialization = self.only_child(Initialization)
self.segment_urls = self.children(SegmentURL, minimum=1)
self.segmentURLs = self.children(SegmentURL)

def segments(self) -> Iterator[Segment]:
if self.initialization: # pragma: no branch
Expand All @@ -569,7 +569,7 @@ def segments(self) -> Iterator[Segment]:
content=False,
byterange=self.initialization.range,
)
for number, segment_url in enumerate(self.segment_urls, self.startNumber):
for number, segment_url in enumerate(self.segmentURLs, self.startNumber):
yield Segment(
url=self.make_url(segment_url.media),
number=number,
Expand Down