Skip to main content

instagram: flush the gallery-dl cache before getting avatars

ID
b026e89
date
2026-04-18 21:47:22+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
b21bbd1
message
instagram: flush the gallery-dl cache before getting avatars
changed files
1 file, 5 additions

Changed files

yt-dlp_alexwlchan.py (7823) → yt-dlp_alexwlchan.py (8074)

diff --git a/yt-dlp_alexwlchan.py b/yt-dlp_alexwlchan.py
index e35e1d0..2da5aa3 100755
--- a/yt-dlp_alexwlchan.py
+++ b/yt-dlp_alexwlchan.py
@@ -85,6 +85,11 @@ def get_instagram_avatar(tmp_dir: Path, uploader_name: str) -> Path:
     """
     Download the avatar of an Instagram channel.
     """
+    # Somewhere gallery-dl is caching avatars, so the URL it returns
+    # can have an expired signature. For now, just clear the cache before
+    # every run to flush any stale data.
+    subprocess.check_call(["gallery-dl", "--clear-cache", "ALL"])
+
     output = subprocess.check_output(
         [
             "gallery-dl",