Spaces:
Running
Running
Commit ·
b9721d6
1
Parent(s): e4b4835
v10.1: Drop PurStream + MoviesHunt (Cloudflare-block HF IPs; worked only from sandbox)
Browse filesFinal registry: castle, netmirror, vidlove, playbox, movix, vegamovies - all live-verified from the Space
147 unmodified lines148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210151152153768 unmodified lines922923924985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105492592692712 unmodified lines94094194210731074107510761077107894394494583 unmodified lines102910301031116810321033103410358 unmodified lines10441045104610471048104910501051147 unmodified lines return re.sub(r"[^a-z0-9]", "", (s or "").lower())
# ---------- PurStream (Nuvio purstream.js): search + sheet API ----------
async def scrape_purstream(tmdb_id: int, media_type: str, season: int = None, episode: int = None): results = [] errors = []
try: info = await get_tmdb_info(tmdb_id, media_type) title = info.get("title") if not title: return [], ["PurStream: no TMDB title"]
headers = {"User-Agent": HEADERS["User-Agent"], "Referer": "https://purstream.club/"} async with httpx.AsyncClient(timeout=20, follow_redirects=True, headers=headers) as client: resp = await client.get(f"https://api.purstream.club/api/v1/search-bar/search/{quote(str(title))}") items = resp.json().get("data", {}).get("items", {}) candidates = [] for key in ("movies", "tv", "series", "tvshows"): bucket = items.get(key) or {} sub = bucket.get("items") if isinstance(bucket, dict) else bucket if isinstance(sub, list): candidates.extend(sub)
# catalog items lack tmdbId -> match by title, verify tmdbId via sheet media_id, sheet = None, None for item in candidates: if _sf_norm(item.get("title")) == _sf_norm(title): try: probe = (await client.get( f"https://api.purstream.club/api/v1/media/{item['id']}/sheet")).json() if str(probe.get("data", {}).get("items", {}).get("tmdbId")) == str(tmdb_id): media_id, sheet = item.get("id"), probe break except Exception: continue if not media_id or sheet is None: return [], ["PurStream: title not found in catalog"]
urls = sheet.get("data", {}).get("items", {}).get("urls", []) if media_type == "tv": s, e = season or 1, episode or 1 pat = re.compile(rf"/S{s:02d}/E{e:02d}/|S{s}\.?E{e}\b", re.I) urls = [u for u in urls if pat.search(u.get("url") or "") or pat.search(u.get("name") or "")]
for u in urls: url = u.get("url") if not url: continue name = u.get("name") or "PurStream" results.append(_sf_stream_result(f"PurStream/{name}", f"PurStream - {name}", url))
if not results: errors.append("PurStream: no stream urls")
except Exception as e: errors.append(f"PurStream: {str(e)}")
return results, errors
# ---------- Movix (Nuvio movix.js): api.movix.cash direct API ----------
async def scrape_movix(tmdb_id: int, media_type: str, season: int = None, episode: int = None):768 unmodified lines return results, errors
# ---------- MoviesHunt (Nuvio movieshunt.js port, v10): WP search -> post -> abhilinks -> hubcloud ----------# Live-tested: direct MKV via pixeldrain, movie+TV
_MH_SITES = ["https://movieshunt.casa", "https://movieshunt.run"]
async def scrape_movieshunt(tmdb_id: int, media_type: str, season: int = None, episode: int = None): results = [] errors = [] try: info = await get_tmdb_info(tmdb_id, media_type) title = info.get("title") or "" imdb_id = info.get("imdb_id") if not title: errors.append("MoviesHunt: no title") return results, errors
q = title.replace(" ", "+") async with httpx.AsyncClient(timeout=25, follow_redirects=True, headers=_SF_HUB_HEADERS) as client: post_url = None for site in _MH_SITES: try: sr = await client.get(f"{site}/", params={"s": q}) if sr.status_code != 200: continue post_links = re.findall( rf'href="({re.escape(site)}/[a-z0-9-]{{10,140}}/?)"', sr.text) post_links = [p for p in post_links if not re.search(r'(disclaimer|contact|how-to|request|find-movie|dmca|privacy|about|page/)', p)] if post_links: post_url = post_links[0] break except Exception: continue
if not post_url: errors.append("MoviesHunt: no matching post") return results, errors
pr = await client.get(post_url) content = pr.text
# abhilinks archive links (episode/movie pages) abhi_links = re.findall(r'https?://abhilinks\.site/archives/[a-z0-9]+/?', content) # direct hubcloud links hc_links = re.findall(r'https?://hubcloud\.[a-z]+/(?:video|drive)/[a-zA-Z0-9_]+', content)
resolved = [] for hl in hc_links[:8]: resolved.extend(await _sf_resolve_hubcloud(client, hl))
for al in list(dict.fromkeys(abhi_links))[:6]: if len(resolved) >= 8: break try: ar = await client.get(al, headers={"User-Agent": _SF_MOBILE_UA, "Referer": post_url}) except Exception: continue ahc = re.findall(r'https?://hubcloud\.[a-z]+/(?:video|drive)/[a-zA-Z0-9_]+', ar.text) for hl in ahc[:3]: resolved.extend(await _sf_resolve_hubcloud(client, hl))
results.extend(_sf_hubcloud_results("MoviesHunt", resolved, media_type, season, episode)) if not results: errors.append("MoviesHunt: no resolvable streams") except Exception as ex: errors.append(f"MoviesHunt: {str(ex)}") return results, errors
# ===== Source Map =====
SOURCE_MAP = {12 unmodified lines "movix": {"name": "Movix", "fn": lambda tid, mt, s, e: scrape_movix(tid, mt, s, e), "languages": ["English", "Multi"], "reliability": "high", "note": "api.movix.cash direct API, m3u8 1080p"}, "purstream": {"name": "PurStream", "fn": lambda tid, mt, s, e: scrape_purstream(tid, mt, s, e), "languages": ["English", "Multi"], "reliability": "high", "note": "purstream.club search+sheet API, m3u8, episodes supported"}, "movieshunt": {"name": "MoviesHunt", "fn": lambda tid, mt, s, e: scrape_movieshunt(tid, mt, s, e), "languages": ["Hindi", "English", "Multi"], "reliability": "medium", "note": "WP search (movieshunt.casa) + abhilinks + hubcloud, direct MKV via pixeldrain/r2"}, "vegamovies": {"name": "VegaMovies", "fn": lambda tid, mt, s, e: scrape_vegamovies(tid, mt, s, e), "languages": ["Hindi", "English", "Multi"], "reliability": "medium", "note": "search.php?q=imdb + nexdrive + vcloud chain, direct MKV up to 4K"},83 unmodified lines "VidLove - api.shows.st, m3u8 master multi-quality, movie+TV (replaces dead 111movies)", "PlayBox - streamdata.vaplayer.ru, multi-quality m3u8, movie+TV", ], "kept": ["Movix", "PurStream (verified still working)"], "kept": ["Movix (verified working)"], "removed": { "Cineby": "shutting down (user request)", "Videasy": "cineby-owned (user request)",8 unmodified lines "GoatAPI": "empty responses", "HDHub4u": "DNS dead", "Movies4u": "m4uplay player fully string-obfuscated, unverifiable", "PurStream": "API blocks HF IPs (worked from sandbox, fails on Space)", "MoviesHunt": "abhilinks/hubcloud Cloudflare-challenges HF IPs (worked from sandbox)", }, }, "source_repos": ["github.com/D3adlyRocket/All-in-One-Nuvio", "github.com/yogesh-hacker/MediaVanced"],main.py+3-137