summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/imgur.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-05-26 23:57:04 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2022-05-26 23:57:04 -0400
commitad61a6d8122973534ab63df48f6090954bc73db6 (patch)
treeaedce94427ac95fa180005f88fc94b5c8ef5a62a /gallery_dl/extractor/imgur.py
parentc6b88a96bd191711fc540d7babab3d2e09c68da8 (diff)
New upstream version 1.22.0.upstream/1.22.0
Diffstat (limited to 'gallery_dl/extractor/imgur.py')
-rw-r--r--gallery_dl/extractor/imgur.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/gallery_dl/extractor/imgur.py b/gallery_dl/extractor/imgur.py
index 2035655..fd78ce2 100644
--- a/gallery_dl/extractor/imgur.py
+++ b/gallery_dl/extractor/imgur.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2015-2021 Mike Fährmann
+# Copyright 2015-2022 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
@@ -201,17 +201,24 @@ class ImgurAlbumExtractor(ImgurExtractor):
("https://imgur.com/a/TcBmQ", {
"exception": exception.HttpError,
}),
+ ("https://imgur.com/a/pjOnJA0", { # empty, no 'media' (#2557)
+ "count": 0,
+ }),
("https://www.imgur.com/a/TcBmP"), # www
("https://m.imgur.com/a/TcBmP"), # mobile
)
def items(self):
album = self.api.album(self.key)
- album["date"] = text.parse_datetime(album["created_at"])
- images = album["media"]
+ try:
+ images = album["media"]
+ except KeyError:
+ return
+
del album["media"]
count = len(images)
+ album["date"] = text.parse_datetime(album["created_at"])
try:
del album["ad_url"]