This page documents all configuration options available in Lightshot Scrape, including command-line arguments, file paths, and required dependencies.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/osctorand/lightshotscrape/llms.txt
Use this file to discover all available pages before exploring further.
Command-line arguments
The Lightshot Scrape CLI accepts command-line arguments to control its behavior.The main.py script is currently a work in progress and does not have full implementation. For direct usage, use singleImage.py which contains the core scraping functionality.
Mode selection
Specifies the operating mode for the scraper.Accepted values:
en- Single image mode (scrapes one image)loop- Loop mode (continuously scrapes images)
Usage examples
Argument parsing
The tool uses Python’sgetopt module to parse command-line arguments:
File paths
Image save path
By default, scraped images are saved to the Windows Pictures folder.The directory where downloaded images will be saved.Default value:
C:\Users\%username%\Pictures\Saved PicturesNote: The %username% variable should be expanded by the system to the current user’s username.Configuration in code
In the current implementation, there is commented-out code that would allow users to specify a custom save path via input. This feature is currently disabled:
Dependencies
Lightshot Scrape requires several Python packages to function properly.Required packages
cloudscraper
cloudscraper
Purpose: Bypasses Cloudflare protection on Lightshot pagesUsage in code:Why it’s needed: Lightshot uses Cloudflare protection, which blocks regular requests. Cloudscraper mimics a real browser to bypass this protection.Installation:
beautifulsoup4
beautifulsoup4
Purpose: Parses HTML to extract image URLsUsage in code:Why it’s needed: Extracts the image source URL from the Lightshot page HTML by finding
<img> tags.Installation:requests
requests
Purpose: HTTP library for making web requestsUsage in code:Why it’s needed: Used as a dependency for cloudscraper and for downloading images.Installation:
Standard library modules
The following Python standard library modules are also used (no installation required):random- Generates random characters for URL creationstring- Provides character sets (ascii_lowercase, ascii_uppercase, digits)time- Time-related functionsos- Operating system interfacesys- System-specific parameters and functionsgetopt- Command-line argument parser
Complete dependency list
Create arequirements.txt file with these dependencies:
requirements.txt
Environment requirements
Python version
Python 3.6 or higher recommended
Operating system
Designed for Windows (default save path uses Windows directory structure)
Internet connection
Required to access Lightshot URLs and download images
Disk space
Sufficient space in the save directory for downloaded images
Cloudscraper instance
The tool creates cloudscraper instances in multiple locations:Global instance
Created at module level in bothmain.py and singleImage.py:
Local instance
TheImageHandler function creates its own instance: