1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[bunkr] fix URLs returned by API (#3481)

This commit is contained in:
Mike Fährmann 2023-01-01 14:07:15 +01:00
parent 1fc3845cf6
commit dc8e7ff54e
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Mike Fährmann
# Copyright 2022-2023 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@ -56,8 +56,12 @@ class BunkrAlbumExtractor(LolisafeAlbumExtractor):
files = album["files"]
except Exception as exc:
self.log.debug("%s: %s", exc.__class__.__name__, exc)
self.log.debug("Falling back to lolisafe API")
self.root = root.replace("://", "://app.", 1)
files, data = LolisafeAlbumExtractor.fetch_album(self, album_id)
# fix file URLs (bunkr..ru -> bunkr.ru) (#3481)
for file in files:
file["file"] = file["file"].replace("bunkr..", "bunkr.", 1)
else:
for file in files:
file["file"] = file["cdn"] + "/" + file["name"]