Skip to content

add optional proxy support for stripchat.py [geo-restrictions bypass]#265

Closed
medi0x1 wants to merge 2 commits intolossless1024:masterfrom
medi0x1:stripchat-proxy-support
Closed

add optional proxy support for stripchat.py [geo-restrictions bypass]#265
medi0x1 wants to merge 2 commits intolossless1024:masterfrom
medi0x1:stripchat-proxy-support

Conversation

@medi0x1
Copy link

@medi0x1 medi0x1 commented Nov 26, 2025

Adds proxy support via HTTP_PROXY/HTTPS_PROXY environment 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

  • Added get_proxies() class method to read HTTP_PROXY and HTTPS_PROXY from environment
  • Updated all 4 requests.get() calls in stripchat.py to use proxies=cls.get_proxies()
  • Integrated python-dotenv for .env file support
  • Added .env.example template

Code:

@classmethod
def get_proxies(cls):
    http = os.getenv("HTTP_PROXY")
    https = os.getenv("HTTPS_PROXY")
    return {"http": http, "https": https} if (http or https) else None

Files Changed

  • streamonitor/sites/stripchat.py - proxy support implementation
  • .env.example - configuration template (new file)
  • .gitignore - added .env exclusion

Setup

pip install requests python-dotenv
pip install pysocks  # optional, for SOCKS5
cp .env.example .env
# edit .env with your proxy settings

Usage

Via environment variables:

export HTTP_PROXY="socks5://user:pass@proxy.example.com:1080"
export HTTPS_PROXY="socks5://user:pass@proxy.example.com:1080"
python downloader.py

Via .env file:

# .env
HTTP_PROXY=socks5://user:pass@proxy.example.com:1080
HTTPS_PROXY=socks5://user:pass@proxy.example.com:1080

.env.example

# StreaMonitor Proxy Configuration
# Copy to .env and configure as needed

# HTTP/HTTPS Proxy
# HTTP_PROXY=http://proxy.example.com:8080
# HTTPS_PROXY=https://proxy.example.com:8080

# SOCKS5 Proxy (requires: pip install pysocks)
# HTTP_PROXY=socks5://user:pass@proxy.example.com:1080
# HTTPS_PROXY=socks5://user:pass@proxy.example.com:1080

# Authenticated proxy
# HTTP_PROXY=http://username:password@proxy.example.com:8080
# HTTPS_PROXY=https://username:password@proxy.example.com:8080

# Exclude domains from proxying
# NO_PROXY=localhost,127.0.0.1,.local

Dependencies

Required:

  • requests (already in requirements)
  • python-dotenv

Optional:

  • pysocks (for SOCKS5 support)

Testing

Verified with:

  • HTTP/HTTPS proxies
  • SOCKS5 proxies (authenticated and anonymous)
  • No proxy configuration (default behavior)
  • All StripChat methods: getStatus(), getVideoUrl(), getPlaylistVariants(), getInitialData()

Backward Compatibility

Fully backward compatible. No breaking changes. Proxy support only activates when environment variables are set.

Allows using HTTP_PROXY and HTTPS_PROXY environment variables.
@medi0x1 medi0x1 changed the title Add optional proxy support for SC via environment variables add optional proxy support for stripchat.py [geo-restrictions bypass] Nov 26, 2025
medi0x1

This comment was marked as duplicate.

@elphabert
Copy link

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

@medi0x1 medi0x1 closed this Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants