[pornstarstube] add support (#8576)

* Add support for pornstars.tube
* update
    - adjust pattern/example/page_url
    - extract '' & '' metadata
    - prevent unnecessary request
    - fix result URLs
    - return list comprehension result
* update supportedsites
* update test results
* fix extractor name

---------

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
This commit is contained in:
MyFinalBellyache
2025-11-19 20:25:01 +05:00
committed by GitHub
parent cc7003a14c
commit a9687d2928
5 changed files with 109 additions and 0 deletions

View File

@@ -161,6 +161,7 @@ modules = [
"poringa",
"pornhub",
"pornpics",
"pornstarstube",
"postmill",
"rawkuma",
"reactor",

View File

@@ -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="', '"')
]