From 0a5f359217718c912c572f903a93ddd49e1246b9 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Wed, 8 Feb 2023 12:56:26 +0000 Subject: [PATCH] Fix FutureWarning when getting segment URLs from SegmentTemplate --- devine/core/manifests/dash.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index 976dab3..7160e5e 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -356,7 +356,10 @@ class DASH: fallback_query: Optional[str] = None ) -> list[str]: segment_urls: list[str] = [] - segment_template = representation.find("SegmentTemplate") or fallback_segment_template + if representation.find("SegmentTemplate") is not None: + segment_template = representation.find("SegmentTemplate") + else: + segment_template = fallback_segment_template base_url = representation.findtext("BaseURL") or fallback_base_url if segment_template is None: