goon/app/extractors/tubes/pornmike.py
goon-foss b3e1092175 feat(pornmike): browse scraper behind a cast gate + direct-mp4 extractor
pornmike.com puts everything in JSON-LD @graph -> ItemPage.mainEntity
(name, duration, uploadDate, actor[], genre[], keywords, description,
thumbnail), so the parser reads one JSON blob instead of scraping markup.
Cast is clean: the whole scene page carries exactly as many /pornstar/
links as there are actors, none of the sidebar pollution that got xxxfiles
rejected. 82% of sampled performers already carry a tpdb/stashdb ref and
19-20 of 20 channels are studios we already know.

Ingest is gated on a non-empty actor[]: 23% of the catalog has no cast and
those scenes could neither be attributed nor deduped. Tags and categories
come only from JSON-LD (keywords + genre), never from the HTML, which
carries 38 /category/ and 22 /tag/ nav and sidebar links per page.
Pagination is ?p=N only: the /N/ form 404s and ?page=N is silently ignored,
returning page 1.

Playback is the simplest in the portfolio: a plain <source> mp4 on twincdn
with no token, no query string and no expiry. Verified 206 on a Range
request from the VPS and from another machine in another country, both
without a Referer, so it is neither hotlink-guarded nor IP-bound and the
phone streams it directly.

Two honest caveats recorded in the module docstring: these are 5-12 minute
clips (median ~487s against 1800-2400s for the tubes we accepted), so for
the ~20% of the catalog from Tushy/Blacked Raw/Milfy/Anilos they will sit
as a short shadow next to full canonical scenes; and uploadDate is the
tube's import date, not the studio release, so pages past the second are
marked backfill.

Pilot ingest of 3 pages: 127 seen, 49 merged into existing scenes, 66 new,
0 errors; on page one the gate passed 42 of 62 links with zero scenes
missing cast, duration or studio.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-07-27 10:42:39 +02:00

55 lines
1.9 KiB
Python

"""pornmike.com — direct mp4 z `<source>`. Dodany 2026-07-27.
Najprostszy stream w portfolio: zwykły video.js na natywnym `<video>`, dwie rendycje
(720p + 360p) na `*.twincdn.com`, **bez tokenu, bez query stringa, bez expiry**.
Zweryfikowane cross-IP (Range bytes=0-1023): 206 z VPS BEZ Referera, 206 z innej
maszyny w innym kraju również bez Referera → ani hotlink-guard, ani IP-binding.
Pierwszy KB zawiera `ftyp` + `moov` (faststart), więc seek działa od razu. Link
nie gnije: scena sprzed 9 miesięcy nadal oddaje 206.
Stąd `mobile_direct_ok` — telefon gra prosto z CDN, zero proxy i zero WebView.
Uwaga na fałszywy trop przy diagnozie: strona ma `m3u8` + `hls.js`, ale to widget
reklamowy live-cam (saawsedge/stripchat), nie ma nic wspólnego ze sceną.
"""
from __future__ import annotations
import logging
import re
from app.extractors._fetch import fetch_tube_html
from app.extractors._models import StreamSource
log = logging.getLogger(__name__)
_BASE = "https://pornmike.com"
_SOURCE_RE = re.compile(
r'<source\s+src="([^"]+\.mp4)"[^>]*data-res="(\d+)"', re.IGNORECASE
)
def extract(page_url: str, *, timeout: float = 60.0) -> list[StreamSource] | None:
html_text = fetch_tube_html(page_url, timeout=timeout)
seen: set[str] = set()
out: list[StreamSource] = []
for m in _SOURCE_RE.finditer(html_text):
url, res = m.group(1), m.group(2)
if url in seen:
continue
seen.add(url)
out.append(
StreamSource(
link=url,
type="mp4",
quality=f"{res}p",
# Referer zbędny (CDN go nie sprawdza), ustawiamy dla higieny.
referer=_BASE + "/",
raw={"mobile_direct_ok": True},
)
)
if not out:
log.info("pornmike: brak <source> mp4 na %s", page_url)
return None
out.sort(key=lambda s: int((s.quality or "0p")[:-1]), reverse=True)
return out