From 6379e98dd9a00f8165d3b753a24a00bd908e39c8 Mon Sep 17 00:00:00 2001 From: goon-foss Date: Thu, 15 Oct 2026 12:22:54 +0200 Subject: [PATCH] fix(latestpornvideo): miniatury z imgds zamiast martwego ticdn, bez tagu "mixed porn" Proxy miniatur oddaje 404 dla banera usunietego obrazka pixhost i dla odpowiedzi tekstowych (link do strony podgladu), zamiast 200 z atrapa. Kategorie mixed-porn i porn-movie pomijane: serwis daje je kazdemu wpisowi. Co-Authored-By: Claude Opus 5.5 --- app/api/stream_proxy.py | 9 +++++++++ app/connectors/direct_scrapers/latestpornvideo.py | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/api/stream_proxy.py b/app/api/stream_proxy.py index 3683e7a..34d7bb9 100644 --- a/app/api/stream_proxy.py +++ b/app/api/stream_proxy.py @@ -451,6 +451,15 @@ async def proxy_image( media_type="image/jpeg", ) ct = r.headers.get("content-type", "image/jpeg") + # Atrapy zamiast obrazka (zgloszenia eb20f1c0/4d8d5daf, latestpornvideo): pixhost + # przekierowuje usuniete obrazki na baner `/image/removed.png`, a link do strony + # podgladu (`pixhost.to/show/...`) daje HTML. Oba szly do apki jako 200, wiec kafelek + # pokazywal baner albo byl pusty. 404 = apka rysuje swoj zastepnik. + final_url = str(getattr(r, "url", "") or "") + # Tylko text/*: czesc CDN-ow (S3) podaje prawdziwe obrazki jako octet-stream. + if final_url.endswith("/image/removed.png") or ct.lower().startswith("text/"): + log.info("img proxy: atrapa zamiast obrazka (%s, %s) dla %s", ct, final_url[:80], target) + return Response(content=b"", status_code=404, media_type="image/jpeg") return Response( content=r.content, media_type=ct, diff --git a/app/connectors/direct_scrapers/latestpornvideo.py b/app/connectors/direct_scrapers/latestpornvideo.py index 714fc8b..c208d0f 100644 --- a/app/connectors/direct_scrapers/latestpornvideo.py +++ b/app/connectors/direct_scrapers/latestpornvideo.py @@ -45,6 +45,7 @@ _BASE = "https://latestpornvideo.com" _ARTICLE_RE = re.compile(r']*\bclass="([^"]+)"', re.IGNORECASE) _LINK_RE = re.compile(r'-YYYY-MM-DD--cover.jpg`. @@ -52,7 +53,9 @@ _THUMB_NAME_RE = re.compile(r"/([A-Za-z0-9][A-Za-z0-9-]*?)-(\d{4})-(\d{2})-(\d{2 # Tytuł: ` YY MM DD ` (np. "MySexMobile 20 10 23 Abella Danger"). _TITLE_DATE_RE = re.compile(r"^(.*?)\s*\b(\d{2})\s+(\d{2})\s+(\d{2})\b") # Karty homepage zawsze siedzą w kategorii "latest-porn-videos", to nie jest tag. -_CAT_SKIP = {"latest-porn-videos", "uncategorized", ""} +# "mixed-porn" i "porn-movie": od 09.2026 serwis daje KAZDEMU wpisowi tylko te kategorie, +# wiec nic nie mowia (zgloszenie 3204ee85, 2026-10-12: "tylko mixed porn"). +_CAT_SKIP = {"latest-porn-videos", "uncategorized", "", "mixed-porn", "porn-movie"} def _name_from_slug(slug: str) -> str: @@ -103,6 +106,10 @@ class LatestPornVideoScraper(BaseBrowseScraper): thumb_m = _THUMB_RE.search(window) thumb = thumb_m.group(1) if thumb_m else None + if thumb: + # ticdn.net (stary serwer miniatur DoodStream) nie istnieje, te same pliki + # leza na imgds.net (2026-10-15, 8 tys. martwych kafelkow). + thumb = _TICDN_RE.sub("https://imgds.net/snaps/", thumb) # Studio + release_date z nazwy thumba (`-YYYY-MM-DD-`). studio: RawStudio | None = None