From 7169eaa885e90e67cffbc6c7fc7f20c2089fdb64 Mon Sep 17 00:00:00 2001 From: Arias800 <24809312+Arias800@users.noreply.github.com> Date: Sun, 12 Feb 2023 11:01:16 +0100 Subject: [PATCH] Detect redirection If the manifest is hidden behind a redirect, the url is not updated and the segments are created with the old url. I found a French service where this situation occurred. After this change, it was possible to correctly parse the mpd. --- devine/core/manifests/dash.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index dc00f7c..04bdc79 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -49,6 +49,9 @@ class DASH: raise TypeError(f"Expected session to be a {Session}, not {session!r}") res = session.get(url, **args) + if res.url != url: + url = res.url + if not res.ok: raise requests.ConnectionError( "Failed to request the MPD document.",