Enhance Rootz API integration with page token and download improvements#199
Merged
Conversation
- Updated the RootzApi profile preset to include page token and referer fields for improved download handling. - Introduced a new `head_with_client` function to manage HTTP HEAD requests with session cookies and redirection. - Enhanced the download resolution process to handle signed CDN URLs and provide better error messages for various states. - Refactored the Rootz API interaction to extract and utilize page tokens for more reliable download links.
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.
This pull request significantly refactors and improves the handling of Rootz.so download resolution, making it more robust and browser-like, and adds better error handling and metadata support. The main focus is on reliably resolving signed CDN URLs from Rootz.so, handling page tokens, and providing clearer error messages for users. There are also some minor cleanups and exports.
Rootz.so Download Handling Improvements:
pageTokenfrom the download page, uses the proper API endpoints, and follows redirects to obtain a signed CDN URL (e.g., R2/Cloudflare Storage). This includes retry logic and fallback strategies for improved reliability. [1] [2]Network Layer and Profile Preset Updates:
ProfilePreset::RootzApivariant now requires apage_tokenandreferer, and these are used to set the appropriate headers for Rootz API requests, including the customX-Page-Tokenheader. [1] [2]head_with_clientfunction to the network layer, which performs HEAD requests with a shared client and follows redirects—crucial for resolving CDN URLs. [1] [2]General Codebase Cleanups:
matchermodule import for consistency.Hoster Resolution Logic:
These changes make Rootz.so downloads more reliable and user-friendly, and lay the groundwork for future hoster improvements.- Updated the RootzApi profile preset to include page token and referer fields for improved download handling.
head_with_clientfunction to manage HTTP HEAD requests with session cookies and redirection.