movie-scraper: Zenith Movies: The Scraper That Hides Its Handshake in WebAssembly

A tiny serverless stack that turns TMDB IDs into proxied HLS playback, then rewrites the stream so the browser never talks to the source.

6 to 8 min read • View on GitHub • More from 4texas4

A wide black-ink editorial scene shows a serverless function box receiving a sealed token from a compact WebAssembly engine, then handing a rewritten video stream to a browser player. A distant upstream provider sits behind it, visible but never directly connected to the browser. The image explains the repo’s split between handshake, proxying, and playback.
The real trick is not playback. It is separating access, rewrite, and delivery into different layers so the browser only ever sees the clean path.
Key Takeaways

Why the hard part is not playback, it is the handshake

At first glance, this looks like a simple movie scraper. It is not. The most interesting part is the bridge between the serverless function and the upstream provider: a compiled WebAssembly payload that helps generate the token needed to unlock the stream.

That matters because it shifts the repo out of the usual scrape-and-parse pattern. Instead of relying on brittle request strings or a shallow API wrapper, it hides the provider handshake inside a binary layer that is harder to inspect, harder to patch casually, and easier to keep stable when the upstream changes.

A WSJ hedcut-style portrait of the repository owner rendered in black ink on white. It gives the article a human anchor while keeping the focus on the project’s technical design rather than personality.

The system is easier to understand when you split it into control, unlock, and delivery paths. The browser never sees the raw provider route, only the rewritten one.

How the stream gets cleaned before the browser sees it

The second move is more practical than clever. Once the raw manifest is fetched, rewriteM3u8 rewrites the playlist so every segment URL points back through the app’s own /api?url=... endpoint. That keeps the browser on home turf, which sidesteps hotlink friction and makes CORS a non-event.

This is the kind of trick that makes a small scraper feel architectural. The app is not just relaying bytes. It is inserting itself into the delivery path, so every request after the manifest comes back through the same controlled edge.

A close-up black-ink scene shows a raw HLS manifest on the left, a rewrite tool in the center stamping internal routes onto each segment URL, and a browser player on the right receiving only proxied paths. The image explains how manifest rewriting keeps playback inside the app and away from the source host.
Manifest rewriting is the repo’s most tangible trick. It turns an outward-facing playlist into an inward-facing one before the browser ever starts fetching segments.
ProjectPrimary roleWhat it ownsStrengthWeakness
Zenith MoviesStreaming bridgeHandshake, manifest rewrite, delivery pathControls the whole path from token to playbackFragile and provider-specific
TMDb APIMetadata APIMovie and TV dataStructured, stable, easy to integrateDoes not deliver playback
OMDb APIMetadata APITitles, posters, and basic film dataSimple request-response modelLimited scope and key-gated
imdbpyScraping libraryIMDb data accessDeep IMDb coverageBreaks when the site changes
Kodi / Plex / JellyfinMedia suiteLibrary management and playbackOwns the full user-facing media experienceMuch heavier than a narrow scraper

That table is the useful frame. Zenith Movies does not compete by owning metadata better than TMDb or by being a full media platform like Plex. It wins, if that is the word, by owning a narrow and awkward middle layer: access plus delivery.

Why the frontend is intentionally thin

The UI is almost disposable. In index.html, the app reads a TMDB ID from the URL, fetches backdrop art, asks the serverless API for a stream, and then hands the result to hls.js. That is enough to make the whole stack feel like a finished product, even though the visible surface is doing very little.

<!-- Simplified flow from the frontend -->
const id = new URLSearchParams(location.search).get('id');
const stream = await fetch(`/api?id=${id}`).then(r => r.json());
const hls = new Hls();
hls.loadSource(stream.url);
hls.attachMedia(videoEl);

That thinness is a feature, not a missing piece. If the interesting logic lives in the handshake, the proxy, and the manifest rewrite, then the interface only has to get out of the way.

What this architecture says about modern scraping

The repo reads like a snapshot of how scraping has evolved. Simple request loops are no longer enough when providers add signature checks, anti-bot logic, and delivery constraints. So the stack spreads out: WebAssembly for the handshake, serverless for reachability, and proxy rewriting for clean delivery.

That also explains the project’s rough edges. Hardcoded values, fallback behavior, and a clearly experimental tone suggest something practical rather than polished. It feels like a tool built to solve one narrow problem reliably enough to be useful, not a platform designed to generalize.

LayerTraditional approachZenith Movies approach
AccessPlain HTTP requestsWASM-assisted token generation
DeliveryDirect provider playbackProxy-rewritten HLS segments
FrontendFeature-heavy player UIThin shell around playback
ResilienceBreaks when one route changesSurvives by splitting control and content paths

That split is the article’s core argument. The browser never touches the messy part directly. It only sees the sanitized path after the app has already done the awkward work behind the curtain.

What it is competing with

Zenith Movies sits in an odd lane between metadata services and full media centers. TMDb and OMDb are clean data providers. imdbpy is a scraping library with a very different target. Kodi, Plex, and Jellyfin own the whole media experience, from library management to playback.

ProjectLayer ownedBest atNot built for
TMDb / OMDbMetadataStructured film dataPlayback delivery
imdbpySource scrapingIMDb-specific retrievalStreaming infrastructure
Kodi / Plex / JellyfinFull stack mediaLibrary and playback managementTiny, provider-specific handshake tricks
Zenith MoviesAccess plus deliveryHiding the handshake and rewriting the streamGeneral-purpose media management

That is why the repo feels more like a private instrument than a platform. It owns one awkward slice of the stack, and it owns that slice with more sophistication than its size would suggest.

Why this repo feels like a private tool, not a platform

The public footprint is tiny, and the code reads that way too. It is pragmatic, narrow, and a little volatile. That is not a criticism. It is the shape of a project built to solve a specific problem under specific constraints.

Seen that way, Zenith Movies is less a movie app than a demonstration of a pattern. When the easy route is blocked, the solution can be to split the problem into separate layers, hide the fragile part in one layer, and rewrite the delivery path in another.