aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/chevereto.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/chevereto.py')
-rw-r--r--gallery_dl/extractor/chevereto.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/gallery_dl/extractor/chevereto.py b/gallery_dl/extractor/chevereto.py
index de22a7b..c9ccb7d 100644
--- a/gallery_dl/extractor/chevereto.py
+++ b/gallery_dl/extractor/chevereto.py
@@ -9,7 +9,7 @@
"""Extractors for Chevereto galleries"""
from .common import BaseExtractor, Message
-from .. import text
+from .. import text, util
class CheveretoExtractor(BaseExtractor):
@@ -53,12 +53,22 @@ class CheveretoImageExtractor(CheveretoExtractor):
def items(self):
url = self.root + self.path
- extr = text.extract_from(self.request(url).text)
+ page = self.request(url).text
+ extr = text.extract_from(page)
+
+ url = (extr('<meta property="og:image" content="', '"') or
+ extr('url: "', '"'))
+ if not url or url.endswith("/loading.svg"):
+ pos = page.find(" download=")
+ url = text.rextract(page, 'href="', '"', pos)[0]
+ if not url.startswith("https://"):
+ url = util.decrypt_xor(
+ url, b"seltilovessimpcity@simpcityhatesscrapers",
+ fromhex=True)
image = {
"id" : self.path.rpartition(".")[2],
- "url" : (extr('<meta property="og:image" content="', '"') or
- extr('url: "', '"')),
+ "url" : url,
"album": text.extr(extr("Added to <a", "/a>"), ">", "<"),
"user" : extr('username: "', '"'),
}