summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/chevereto.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-03-10 03:44:57 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-03-10 03:44:57 -0400
commit243d1f1beb4e4eb75a524f1aff948c47761a4f1d (patch)
tree54f7ada7698d946f410500ad14f62798ca646956 /gallery_dl/extractor/chevereto.py
parent889c7b8caec8fc0b9c7a583ed1d9cfa43518fc42 (diff)
New upstream version 1.29.1.upstream/1.29.1
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: "', '"'),
}