diff options
| author | 2025-12-20 05:49:04 -0500 | |
|---|---|---|
| committer | 2025-12-20 05:49:04 -0500 | |
| commit | a24ec1647aeac35a63b744ea856011ad6e06be3b (patch) | |
| tree | ae94416de786aeddd05d99559098f7f16bb103a6 /gallery_dl/extractor/sxypix.py | |
| parent | 33f8a8a37a9cba738ef25fb99955f0730da9eb48 (diff) | |
New upstream version 1.31.1.upstream/1.31.1
Diffstat (limited to 'gallery_dl/extractor/sxypix.py')
| -rw-r--r-- | gallery_dl/extractor/sxypix.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gallery_dl/extractor/sxypix.py b/gallery_dl/extractor/sxypix.py new file mode 100644 index 0000000..c9a1701 --- /dev/null +++ b/gallery_dl/extractor/sxypix.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +# 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 +# published by the Free Software Foundation. + +"""Extractors for https://sxypix.com/""" + +from .common import GalleryExtractor +from .. import text + + +class SxypixGalleryExtractor(GalleryExtractor): + """Extractor for image galleries from sxypix.com""" + category = "sxypix" + root = "https://sxypix.com" + pattern = r"(?:https?://)?(?:www\.)?sxypix\.com(/w/(\w+))" + example = "https://sxypix.com/w/2bbaf1b24a5863d0e73436619bbaa7ee" + + def metadata(self, page): + return { + "gallery_id": self.groups[1], + "title": text.unescape(text.extr( + page, '<meta name="keywords" content="', '"')), + } + + def images(self, page): + data = { + "aid" : text.extr(page, "data-aid='", "'"), + "ghash": text.extr(page, "data-ghash='", "'"), + } + gallery = self.request_json( + "https://sxypix.com/php/gall.php", method="POST", data=data) + + base = "https://x." + return [ + (base + text.extr(entry, "data-src='//.", "'"), None) + for entry in gallery["r"] + ] |
