[bunkr] fix ValueError on relative redirects (#6790)

This commit is contained in:
Mike Fährmann
2025-01-09 10:45:03 +01:00
parent 89276c5b3e
commit ba0443115a
2 changed files with 11 additions and 0 deletions

View File

@@ -80,6 +80,9 @@ class BunkrAlbumExtractor(LolisafeAlbumExtractor):
# redirect
url = response.headers["Location"]
if url[0] == "/":
url = text.root_from_url(response.url) + url
continue
root, path = self._split(url)
if root not in CF_DOMAINS:
continue

View File

@@ -208,4 +208,12 @@ __tests__ = (
"name" : "file",
},
{
"#url" : "https://bunkr.ph/v/rEeTUL8MXR17A",
"#comment" : "redirect to '/f/rEeTUL8MXR17A' (#6790)",
"#category": ("lolisafe", "bunkr", "media"),
"#class" : bunkr.BunkrMediaExtractor,
"#urls" : "https://meatballs.bunkr.ru/27-03-2024-Rp-0FfrropA.mp4",
},
)