infra/stacks/f1-stream/files/backend/extractors/subreddit.py

250 lines
8.5 KiB
Python
Raw Normal View History

f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
"""Subreddit extractor — pulls community-curated live-stream URLs from
the *MotorsportsReplays* subreddit (and a few siblings).
The community follows a stable pattern: a single mod-curated post titled
`[Watch / Download] <Series> <Year> - <Round> | <Event>` goes up on or
near each race weekend with a `**Watch Online:**` link in the selftext,
pointing at an admin-run WordPress site (motomundo.net for MotoGP, the
F1 equivalent has rotated over the years). That WordPress page hosts
iframe embeds whose m3u8 is JS-computed at load time ideal target for
the chrome-service pipeline downstream.
This extractor:
- Hits Reddit with a real-browser User-Agent (httpx default UA + cluster
IP combo gets HTTP 403'd on r/motogp; a Safari UA does not).
- Searches for the `[Watch` thread pattern AND scans `/new.json` for
any flair set to LIVE.
- Pulls selftext URLs and returns each candidate as an `embed`-type
ExtractedStream. The verifier already drives chrome-service for embed
streams, so the m3u8 capture happens there.
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
"""
import asyncio
import logging
import re
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
import urllib.parse
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
from typing import NamedTuple
import httpx
from backend.extractors.base import BaseExtractor
from backend.extractors.models import ExtractedStream
logger = logging.getLogger(__name__)
USER_AGENT = (
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) "
"AppleWebKit/605.1.15 (KHTML, like Gecko) "
"Version/17.4 Safari/605.1.15"
)
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
# Subreddits to scan.
# - r/motorsportsstreams2 is the active 12.5k-sub successor to the banned
# r/motorsportstreams; race-weekend "[F1 STREAM]" posts include
# `boxboxbox.pro/stream-1` URLs and similar fresh aggregator links.
# - r/MotorsportsReplays runs the [Watch / Download] mod-post pattern
# linking to motomundo.net (MotoGP) and sister sites.
# - The rest are low-yield but cost nothing.
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
SUBREDDITS: tuple[str, ...] = (
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
"motorsportsstreams2",
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
"MotorsportsReplays",
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
"f1streams",
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
"motorsports",
"formula1",
"motogp",
)
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
# Search queries fired against r/motorsportsstreams2 + r/MotorsportsReplays.
# The first set captures the [Watch / Download] mod posts; the second set
# catches race-weekend live discussion threads.
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
SEARCH_QUERIES: tuple[str, ...] = (
"Watch Download F1 2026",
"Watch Download MotoGP 2026",
"Watch Online F1 2026",
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
"F1 STREAM live",
"Sky Sports F1 live",
"Sky F1 stream",
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
)
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
# Hosts we accept as "interesting" stream-page URLs. These are the
# admin-curated WordPress / aggregator sites the community links to.
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
# Anchored to what r/motorsportsstreams2 currently posts (May 2026 sweep).
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
_INTERESTING_HOSTS = (
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
# WordPress wrappers / community-run sites
"motomundo.net", # MotoGP — admin-curated WP
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
"motomundo.top", # MotoMundo embed host
"motomundo.upns.xyz", # MotoMundo embed host (newer)
f1-stream: subreddit extractor scans r/motorsportsstreams2 (active sub) User asked specifically for r/motorsportstreams. Reddit banned that sub years ago; the active 12.5k-subscriber successor is r/motorsportsstreams2. Added it to SUBREDDITS plus r/f1streams (709 subs, public). Also extended: - SEARCH_QUERIES with three Sky Sports F1 / live-stream phrases that catch the `[F1 STREAM]` post pattern the community uses on race weekends (titles like "[F1 STREAM] Bahrain GP - Live Race | No Buffer | Mobile Friendly" linking to boxboxbox.pro/stream-1). - _INTERESTING_HOSTS allowlist with boxboxbox.{pro,live,lol}, pitsport.live, ppv.to, streamed.pk, acestrlms/aceztrims, and the Super Formula direct CDNs (racelive.jp, cdn.sfgo.jp) — all observed in last-50-posts on r/motorsportsstreams2. Where this leaves us, honestly: - The r/motorsportsstreams2 megathread "Where to watch every F1 race" recommends EXACTLY the four sites we already pull from: pitsport.xyz, streamed.pk, ppv.to, acestrlms. The community has the same broken JW Player chain we have for Sky Sports F1 24/7 streams. There is no free-and-working alternative they know about. - boxboxbox.pro (the most-promoted F1 stream domain in race-weekend posts) is currently NXDOMAIN; .live is parked, .lol unreachable. The domain rotates after takedowns; Reddit posts will surface fresh ones when posters share them. - For F1 specifically: extractor surfaces 2 motomundo.net candidates (MotoGP wrappers) and lights up to ~6+ during F1 race weekends as posters share fresh boxboxbox/equivalent URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:42:51 +00:00
"freemotorsports.com", # WAC successor curated link list
"boxboxbox.pro", # F1 race-weekend aggregator (community fav)
"boxboxbox.live", # boxboxbox sister
"boxboxbox.lol",
# Aggregators we already have direct extractors for, but Reddit may
# surface event-specific deeplinks (e.g. /watch/<UUID>) we'd miss
# otherwise.
"pitsport.xyz",
"pitsport.live",
"rerace.io",
"dd12streams.com",
"ppv.to",
"streamed.pk",
"acestrlms.pages.dev",
"aceztrims.pages.dev",
# Sport-specific direct CDNs that occasionally appear in posts
"racelive.jp", # Super Formula
"cdn.sfgo.jp", # Super Formula CDN
# Speculative F1 sister sites — pattern likely if motomundo for MotoGP
"f1mundo.net",
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
"f1.live",
"f1live",
"skystreams",
"raceon",
"watchf1",
)
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
# URLs we actively never try to scrape (auth-walled, social media,
# direct downloads with no live stream).
_REJECT_HOSTS = (
"discord.gg", "discord.com",
"twitter.com", "x.com",
"youtube.com", "youtu.be",
"instagram.com", "tiktok.com",
"f1tv.formula1.com",
"viktorbarzin.me",
"gofile.io",
"mega.nz", "drive.google.com",
"1fichier.com", "rapidgator", "uploaded.net",
"magnet:",
)
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
_URL_RE = re.compile(r"https?://[^\s\)\]\>\"']+")
class _Candidate(NamedTuple):
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
title: str
url: str
subreddit: str
flair: str
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
def _is_interesting(url: str) -> bool:
low = url.lower()
if any(host in low for host in _REJECT_HOSTS):
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
return False
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
return any(host in low for host in _INTERESTING_HOSTS)
def _has_live_marker(post: dict) -> bool:
title = (post.get("title") or "").lower()
flair = (post.get("link_flair_text") or "").lower()
if "[watch" in title or "watch online" in title or "live" in flair:
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
return True
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
return False
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
class SubredditExtractor(BaseExtractor):
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
"""Scan motorsport subreddits for community-curated live-stream URLs."""
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
@property
def site_key(self) -> str:
return "subreddit"
@property
def site_name(self) -> str:
return "Subreddit"
async def extract(self) -> list[ExtractedStream]:
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
# NB: do NOT send `Accept: application/json` — Reddit's anti-bot
# fingerprint flags that header from datacenter IPs and returns
# HTTP 403 with HTML. Default Accept (`*/*`) gets through fine
# and `.json` URLs always return JSON regardless.
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
async with httpx.AsyncClient(
timeout=15.0,
follow_redirects=True,
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
headers={"User-Agent": USER_AGENT},
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
) as client:
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
tasks = [self._fetch_new(client, sub) for sub in SUBREDDITS]
tasks.extend(self._search(client, q) for q in SEARCH_QUERIES)
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
results = await asyncio.gather(*tasks, return_exceptions=True)
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
candidates: list[_Candidate] = []
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
for r in results:
if isinstance(r, Exception):
logger.debug("[subreddit] fetch failed: %s", r)
continue
candidates.extend(r)
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
# Dedupe by URL, keep first occurrence.
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
seen: set[str] = set()
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
picks: list[_Candidate] = []
for c in candidates:
if c.url in seen:
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
continue
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
seen.add(c.url)
picks.append(c)
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
logger.info(
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
"[subreddit] scanned %d source(s) — %d unique candidate URL(s)",
len(SUBREDDITS) + len(SEARCH_QUERIES), len(picks),
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
)
return [
ExtractedStream(
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
url=c.url,
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
site_key=self.site_key,
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
site_name=f"r/{c.subreddit}",
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
quality="",
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
title=c.title[:100],
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
stream_type="embed",
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
embed_url=c.url,
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
)
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
for c in picks
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
]
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
async def _fetch_new(self, client: httpx.AsyncClient, sub: str) -> list[_Candidate]:
return await self._collect(
client,
f"https://www.reddit.com/r/{sub}/new.json?limit=25",
sub,
)
async def _search(self, client: httpx.AsyncClient, query: str) -> list[_Candidate]:
q = urllib.parse.quote_plus(query)
return await self._collect(
client,
f"https://www.reddit.com/r/MotorsportsReplays/search.json?q={q}&restrict_sr=on&sort=new&limit=10",
"MotorsportsReplays",
)
async def _collect(
self, client: httpx.AsyncClient, url: str, sub: str
) -> list[_Candidate]:
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
try:
resp = await client.get(url)
except Exception as e:
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
logger.debug("[subreddit] fetch %s failed: %s", url, e)
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
return []
if resp.status_code != 200:
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
logger.debug("[subreddit] %s -> HTTP %d", url, resp.status_code)
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
return []
try:
data = resp.json()
except Exception:
return []
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
out: list[_Candidate] = []
f1-stream: add chrome-browser, subreddit, dd12 extractors; fix streamed.pk User asked to broaden the source pipeline so f1-stream can find F1 (and adjacent motorsport) streams from Sky Sports / DAZN / Reddit / etc., using the in-cluster chrome-service headed browser where needed. Four changes: 1. **streamed.py**: BASE_URL streamed.su → streamed.pk. The .su domain stopped serving the API host in 2026 (only the marketing page is left); .pk hosts the JSON API now. Adds 3 events/round (currently all routed through embedsports.top — see #2 caveat). 2. **chrome_browser.py** (new): generic chrome-service-driven extractor. Connects to the existing chrome-service WS (CHROME_WS_URL + CHROME_WS_TOKEN env), navigates a list of TARGETS, captures any HLS playlist URL the page fetches at runtime, returns one ExtractedStream per discovery. Uses the same stealth init script as the verifier so anti-bot checks don't trip the page. Handles iframes (DD12-style /nas → /new-nas/jwplayer) and probes child-frame <video>/source elements after settle. Caveat: most aggregator sites (pooembed, embedsports, hmembeds, even DD12's JW Player path) use a broken runtime decoder that produces no m3u8 in our environment, so the TARGETS list is currently 0-yielding; the framework is the contribution and concrete sites can be added as they're discovered. 3. **subreddit.py** (new): scans r/MotorsportsReplays, r/motorsports, r/formula1, r/motogp via the public old.reddit.com JSON API for posts whose flair/title indicates a live stream. Discovered URLs are returned as embed-type streams; the verifier visits each via chrome-service to confirm playability. Note: Reddit currently HTTP 403's our cluster outbound IP for anonymous JSON requests; the extractor returns 0 in that state and logs a debug message. Will work from any IP Reddit isn't blocking. 4. **dd12.py** (new): inline-HTML scraper for DD12Streams. The site embeds `playerInstance.setup({file: "..."})` directly in HTML — no JS decoder needed. Currently surfaces NASCAR Cup Series 24/7 (clean BunnyCDN-hosted HLS at w9329432hnf3h34.b-cdn.net/pdfs/master.m3u8); add new `(path, label, title)` tuples to CHANNELS as DD12 expands. Result: /streams now shows 2 verified live streams (Rally TV via pitsport + DD12 NASCAR Cup 24/7). When the next F1 weekend (Canadian GP, May 22-24) goes live, pitsport will surface F1 sessions automatically via the existing pushembdz path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 16:05:25 +00:00
for child in (data.get("data", {}) or {}).get("children", []):
d = child.get("data", {}) or {}
f1-stream: subreddit extractor finds Reddit '[Watch / Download]' threads Two fixes for the previously-dormant subreddit extractor + a chrome-browser TARGETS pivot to MotoGP weekend live URLs. 1. **Reddit fetch was 403'd by `Accept: application/json`**. Cluster IP + that header trips Reddit's anti-bot fingerprint and returns HTML 403. Removing the explicit Accept (default `*/*`) restores HTTP 200 with JSON. Confirmed via direct httpx test from the f1-stream pod. 2. **Search the right things**. The community uses a stable `[Watch / Download] <Series> <Year> - <Round> | <Event>` post pattern with selftext links to admin-curated WordPress sites (motomundo.net for MotoGP, sister sites for F1 when active). New extractor: - Hits both /new.json and /search.json across r/MotorsportsReplays and three smaller motorsport subs. - Filters posts where title contains `[watch`, `watch online`, or flair = `live`. - Extracts URLs from selftext (regex), filters to a positive `_INTERESTING_HOSTS` allowlist (motomundo, freemotorsports, pitsport, rerace, dd12, etc.) so we don't drown the verifier in YouTube/Discord/gofile links. - Returns each as embed-type so the chrome-service verifier visits. 3. **chrome_browser.TARGETS pivoted** to the live MotoMundo MotoGP French GP iframes (motomundo.top/e/<id> + motomundo.upns.xyz/#<id>) while the weekend is on. The previous DD12 NASCAR + Acestrlms F1 targets were both broken JW Player paths anyway. State after deploy: - /streams: 3 verified live (WRC Rally Portugal, NASCAR 24/7, Premier League Darts) — Darts is currently active because UK is mid-match. - Subreddit extractor surfaces the live MotoMundo URL but the verifier marks the WordPress wrapper page playable=False (no top-level <video> element; the m3u8 lives in nested iframes). Next iteration: drill the verifier into iframe contentDocument and capture from there. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 18:37:11 +00:00
if not _has_live_marker(d):
continue
text = (d.get("selftext") or "")
title = d.get("title") or ""
flair = d.get("link_flair_text") or ""
# First, the linked URL itself (if it's a recognised live site).
top = d.get("url") or ""
if top and _is_interesting(top):
out.append(_Candidate(title, top, sub, flair))
# Then any URL embedded in the selftext that points at a
# community-curated live page.
for u in _URL_RE.findall(text):
if _is_interesting(u):
out.append(_Candidate(title, u, sub, flair))
return out