Feature: Smart Rotators & Robust Library Management #41
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 introduces two major enhancements that significantly improve the library's anti-detection capabilities and overall robustness:
tls-clientC library.Detailed Changes:
1. The Rotator System
ProxyRotator,HeaderRotator, andTLSIdentifierRotator. These classes provide a unified sync/async API (next/anextmethods) for managing and cycling through resources.ClientandAsyncClientnow enable header and TLS identifier rotation by default, using a curated set of built-in, realistic templates.proxy,headers, andclient_identifierparameters now accept multiple types: a single value (for static use), alist(to automatically enable rotation), or a pre-configured Rotator instance.Clientnow automatically callsmark_result/amark_resulton theProxyRotator, providing performance feedback (success/failure, latency) to optimize the weighted rotation strategy.2.
TLSLibraryRefactorrequestsandtqdmdependencies have been completely removed. Library downloading now uses Python's built-inurllibandjsonmodules, making the library lighter and more portable.TLSLibraryclass is now version-aware. It compares the version of the local C library file against a required version constant (LATEST_VERSION_TAG_NAME) hardcoded in the package.TLSLibrary.load()will automatically download the correct version from GitHub.bindirectory are automatically deleted to prevent conflicts and keep the directory clean.These changes transform the library from a powerful tool into a more intelligent, self-managing, and reliable solution for automation and scraping tasks.