summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/wallpapercave.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/wallpapercave.py')
-rw-r--r--gallery_dl/extractor/wallpapercave.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/gallery_dl/extractor/wallpapercave.py b/gallery_dl/extractor/wallpapercave.py
index bce1026..faf3b0d 100644
--- a/gallery_dl/extractor/wallpapercave.py
+++ b/gallery_dl/extractor/wallpapercave.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2021 David Hoppenbrouwers
+# Copyright 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
@@ -22,7 +23,20 @@ class WallpapercaveImageExtractor(Extractor):
def items(self):
page = self.request(text.ensure_http_scheme(self.url)).text
+
+ path = None
for path in text.extract_iter(page, 'class="download" href="', '"'):
image = text.nameext_from_url(path)
yield Message.Directory, image
yield Message.Url, self.root + path, image
+
+ if path is None:
+ try:
+ path = text.rextract(
+ page, 'href="', '"', page.index('id="tdownload"'))[0]
+ except Exception:
+ pass
+ else:
+ image = text.nameext_from_url(path)
+ yield Message.Directory, image
+ yield Message.Url, self.root + path, image