fix(02moviedownloader): handle AES-256-CBC encrypted API response#41
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
02MovieDownloaderprovider stopped returning sources after the site introduced an encrypted response layer on the/api/download/movie/:idand/api/download/tv/:id/:season/:episodeendpoints.Previously the API returned plaintext JSON. It now returns an encrypted envelope:
{ "encrypted": true, "data": "<iv_base64>:<ciphertext_base64>" }The payload is AES-256-CBC encrypted using a key derived from
SHA-256(sessionToken), wheresessionTokenis the value issued by/api/verify-robot. This mirrors the browser-side slider CAPTCHA flow — the site's own JavaScript (decryptDownloadPayloadWithToken) performs the same decryption before rendering the download page.This PR adds server-side decryption of the payload using Node's built-in
cryptomodule, restoring full provider functionality with no new dependencies.Type of Change
Related Issues
Closes #
Changes Made
EncryptedResponseinterface to02moviedownloader.types.tsto type the new encrypted envelope responsecreateDecipherivandcreateHashfrom Node's built-incryptomodule in the providerdecryptPayload(cipherBundle: string, token: string)private method that replicates the browser's AES-256-CBC decryption: derives the 256-bit key viaSHA-256(token), splits the bundle on:to extract the IV and ciphertext, and returns the decryptedMovieDownloaderResponsefetchPage()to detectencrypted === truein the response and calldecryptPayload()before returning, with no change to the existing code path for unencrypted responsesProvider Information
Provider Details
02moviedownloaderhttps://02moviedownloader.siteProvider Testing
Tested with the following TMDB IDs:
Test Results:
Confirmed the three-step flow works end-to-end:
POST /api/verify-robot→ returns{ token, expiresIn: 300 }GET /api/download/movie/:idwithx-session-tokenheader → returns{ encrypted: true, data: "..." }SHA-256(token)as key → returns fullMovieDownloaderResponsewithdownloadsandexternalStreamsChecklist
General
npm run build)Provider Checklist
BaseProviderfrom@omss/frameworkidand descriptivenamecapabilities(movies/tv support)getMovieSources()andgetTVSources()correctlythis.createProxyUrl()for proxyingProviderResultformatDocumentation
Testing
How Has This Been Tested?
Manually verified the full token + decryption flow via Node.js against the live API.
Testing Steps:
POST https://02moviedownloader.site/api/verify-robotto obtain a session tokenGET https://02moviedownloader.site/api/download/movie/550withx-session-token: <token>header{ encrypted: true, data: "..." }SHA-256(token)as AES-256-CBC key — confirmedMovieDownloaderResponsestructure is intact with sources and subtitlesTest Output
Additional Context
Performance Impact
The decryption happens entirely in-process using Node's native
cryptomodule (no external dependency, no additional network call). The existinggetToken()call to/api/verify-robotwas already part of the flow.Breaking Changes
None. The
decryptPayloadpath is only entered whenencrypted === trueis present in the response. Unencrypted responses (if the site ever reverts) continue to work via the existing code path.Dependencies
No new dependencies. Uses Node.js built-in
cryptomodule.