Skip to content

Commit

Permalink
Fix Python 3.5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sixinchfootlong committed Sep 17, 2023
1 parent 7819b9e commit a3767a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gallery_dl/extractor/bunkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ def fetch_album(self, album_id):
# thumbnail because the file has no preview.
# e.g. "/d/Resources-iwizfcKl.url"
download_path = text.filename_from_url(media_path)
url = f"{cdn}/{download_path}"
url = "{}/{}".format(cdn, download_path)

elif media_path.startswith("/i/") or media_path.startswith("/v/"):
# For media preview pages, derive the download URL.
if thumbnail_url and original_name:
thumb_name = text.filename_from_url(thumbnail_url)
thumb_base, _, thumb_ext = thumb_name.rpartition(".")
orig_base, _, orig_ext = original_name.rpartition(".")
url = f"{cdn}/{thumb_base}.{orig_ext}"
url = "{}/{}.{}".format(cdn, thumb_base, orig_ext)

# If we still don't have a download URL, use the slow method.
# This is always required for MP3 files as they use a `/v/` media
Expand Down

0 comments on commit a3767a0

Please sign in to comment.