diff options
| author | 2025-12-20 05:49:11 -0500 | |
|---|---|---|
| committer | 2025-12-20 05:49:11 -0500 | |
| commit | c586ea4b3c871f5696626f9820e8c88a4e78f4a6 (patch) | |
| tree | e6d7bae96282c3d147159f091d451e53bdaa2efe /gallery_dl/extractor/pornstarstube.py | |
| parent | 01a2bf622c31072d1322884584404b9bd59b28cc (diff) | |
| parent | a24ec1647aeac35a63b744ea856011ad6e06be3b (diff) | |
Update upstream source from tag 'upstream/1.31.1'
Update to upstream version '1.31.1'
with Debian dir b5d91c25143175f933b1c69c7e82249cd7e145ab
Diffstat (limited to 'gallery_dl/extractor/pornstarstube.py')
| -rw-r--r-- | gallery_dl/extractor/pornstarstube.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gallery_dl/extractor/pornstarstube.py b/gallery_dl/extractor/pornstarstube.py new file mode 100644 index 0000000..82519a0 --- /dev/null +++ b/gallery_dl/extractor/pornstarstube.py @@ -0,0 +1,43 @@ +# -*- 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://pornstars.tube/""" + +from .common import GalleryExtractor +from .. import text + + +class PornstarstubeGalleryExtractor(GalleryExtractor): + """Extractor for image galleries from pornstars.tube""" + category = "pornstarstube" + root = "https://pornstars.tube" + pattern = (r"(?:https?://)?(?:www\.)?pornstars\.tube" + r"/albums/(\d+)(?:/([\w-]+))?") + example = "https://pornstars.tube/albums/12345/SLUG/" + + def __init__(self, match): + url = f"{self.root}/albums/{match[1]}/{match[2] or 'a'}/" + GalleryExtractor.__init__(self, match, url) + + def metadata(self, page): + gid, slug = self.groups + return { + "gallery_id": text.parse_int(gid), + "slug" : slug or "", + "title" : text.unescape(text.extr( + page, "<title>", " - PORNSTARS.TUBE</title>")), + "description": text.unescape(text.extr( + page, 'name="description" content="', '"')), + "tags": text.extr( + page, 'name="keywords" content="', '"').split(", "), + } + + def images(self, page): + album = text.extr(page, 'class="block-album"', "\n</div>") + return [ + (url, None) + for url in text.extract_iter(album, ' href="', '"') + ] |
