goon/app/connectors/direct_scrapers/redtube.py
goon-foss ad0284585b Initial commit
Goon — self-hosted aggregator for adult-content scene metadata.

Indexes scenes from TPDB, StashDB, and 30+ public adult tube sites.
Cross-source deduplication via perceptual hash + Levenshtein distance.
FastAPI backend + APScheduler worker + React Native (Expo) mobile client.

FOSS, ad-free, donation-funded. See README for details.
2026-05-20 10:10:22 +02:00

22 lines
736 B
Python

"""RedTube.com — direct HTML scrape search results.
Search: `https://www.redtube.com/?search=<q>&page=<n>`
Scene URL: `https://www.redtube.com/<id>` (slug nie ma w URL — viewkey-only).
"""
from __future__ import annotations
import re
from app.connectors.direct_scrapers._search_base import BaseSearchScraper
class RedTubeScraper(BaseSearchScraper):
sitetag = "redtubecom"
_search_url_template = "https://www.redtube.com/?search={query}&page={page}"
_scene_url_re = re.compile(
r'href="(?P<url>https://www\.redtube\.com/(?P<slug>\d+))"',
)
def _title_from_slug(self, slug):
# Numeric ID jako tytuł nie ma sensu — placeholder, title backfill przy resolve.
return f"redtube:{slug}"