This tool automates taking screenshots of a list of domains while routing requests through a VPN. It manages sessions, retries on failures, and utilizes Selenium for capturing screenshots in a headless browser.
- VPN Management: Automatically connects to a random VPN configuration file from the specified directory and retries on failure.
- Session Management: Supports resuming previous sessions. Tracks processed domains and completed screenshots.
- Multithreading: Supports concurrent processing of domains with a specified number of threads.
- Progress Tracking: Displays progress bars for domains processed, screenshots taken, and requests made.
- Error Logging: Logs errors into a file in the output directory for further analysis.
- Delay Between VPN Changes: Allows specifying a delay (in seconds) before connecting to a new VPN after disconnecting the current one.
- Python 3.8+
requests
(for IP checking and network requests)tqdm
(for progress bars)selenium
(for web automation)
-
Clone the repository:
git clone https://github.com/yourusername/domain-screenshoter.git cd domain-screenshoter
-
Install the required dependencies:
pip install -r requirements.txt
-
Ensure you have
chromedriver
installed and configured:- Download from the official ChromeDriver repository.
- Update the path to
chromedriver
in theconfig.ini
file.
Run the script with the following command:
python dscreenshoter.py --vpn-dir <VPN_CONFIG_DIR> -d <DOMAIN_LIST_FILE> -s <OUTPUT_DIR> -n <MAX_REQUESTS> -t <THREADS> --timeout <TIMEOUT> --delay <DELAY>
--vpn-dir
: Directory containing.ovpn
configuration files.-d
,--domains
: File containing the list of domains to process (one domain per line).-s
,--screenshot-dir
: Directory to save the screenshots.-n
,--max-requests
: Maximum number of requests to process before changing VPN.-t
,--threads
: Number of threads to use for concurrent processing.--timeout
: Timeout (in seconds) for page loading in Selenium.--delay
: Delay (in seconds) before connecting to a new VPN after disconnecting the current one. Defaults to 0.
Take screenshots of domains listed in domains.txt
with 30 threads, switching VPN after 50 requests:
python dscreenshoter.py --vpn-dir ovpn-configs -d domains.txt -s screenshots -n 50 -t 30 --timeout 10
If the script is interrupted, it will ask to resume the session when re-run:
python dscreenshoter.py --vpn-dir ovpn-configs -d domains.txt -s screenshots -n 50 -t 30 --timeout 10
Output:
Session found for file 'domains.txt_screenshots.session' with 100/1000 domains processed and 90 screenshots completed. Continue? (y/n)
Add a 5-second delay between VPN disconnection and reconnection:
python dscreenshoter.py --vpn-dir ovpn-configs -d domains.txt -s screenshots -n 50 -t 30 --timeout 10 --delay 5
Errors are logged in error_log.txt
inside the output directory:
example.com: TimeoutException
testsite.org: WebDriverException
- VPN Configuration: Ensure your
.ovpn
files are configured correctly and can connect without additional inputs. - Chromedriver: Download and configure
chromedriver
compatible with your Chrome version from the official ChromeDriver repository. - Permissions: Running OpenVPN may require
sudo
. Adjust your environment accordingly.