add optional proxy support for stripchat.py [geo-restrictions bypass]#265
Closed
medi0x1 wants to merge 2 commits intolossless1024:masterfrom
Closed
add optional proxy support for stripchat.py [geo-restrictions bypass]#265medi0x1 wants to merge 2 commits intolossless1024:masterfrom
medi0x1 wants to merge 2 commits intolossless1024:masterfrom
Conversation
Allows using HTTP_PROXY and HTTPS_PROXY environment variables.
|
Instead of reading from the environment directly in stripchat.py probably better to load it in parameters.py and load it in Bot.py session definition so all modules to can benefit from it. Will also require updating stripchat.py to use the session definition and manually reference the proxies for the class object. Similar to my changes in #264 |
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.
Adds proxy support via
HTTP_PROXY/HTTPS_PROXYenvironment variables. Supports HTTP, HTTPS, and SOCKS5 proxies.Motivation
No built-in proxy configuration exists. Users need this for geo-restrictions, corporate networks, or privacy. Currently requires system-wide proxy settings or forking the repo.
Implementation
get_proxies()class method to readHTTP_PROXYandHTTPS_PROXYfrom environmentrequests.get()calls instripchat.pyto useproxies=cls.get_proxies()python-dotenvfor.envfile support.env.exampletemplateCode:
Files Changed
streamonitor/sites/stripchat.py- proxy support implementation.env.example- configuration template (new file).gitignore- added.envexclusionSetup
Usage
Via environment variables:
Via .env file:
# .env HTTP_PROXY=socks5://user:pass@proxy.example.com:1080 HTTPS_PROXY=socks5://user:pass@proxy.example.com:1080.env.example
Dependencies
Required:
requests(already in requirements)python-dotenvOptional:
pysocks(for SOCKS5 support)Testing
Verified with:
getStatus(),getVideoUrl(),getPlaylistVariants(),getInitialData()Backward Compatibility
Fully backward compatible. No breaking changes. Proxy support only activates when environment variables are set.