The Python CLI provides two modes for scraping random Lightshot images: single image mode and loop mode.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.
Prerequisites
Before using the CLI, ensure you have:- Python 3.x installed
- Required dependencies installed (see Installation)
- Write permissions to the Pictures folder
Command syntax
The CLI requires a mode argument to specify how it should operate:Available modes
- Single image mode
- Loop mode
Use This mode will:
-m en to scrape a single random image:- Generate one random Lightshot URL
- Download the image if available
- Save it to your Pictures folder
- Exit after completion
Usage examples
How it works
The scraper uses the following process:- URL Generation: Creates random 12-character strings using letters (a-z, A-Z) and digits (0-9)
- URL Format: Constructs URLs in the format
https://prnt.sc/{random-string} - Page Scraping: Uses BeautifulSoup and cloudscraper to extract image URLs from the page
- Image Download: Downloads the actual image file from the extracted URL
- Save: Stores the image in the configured directory
The tool uses
cloudscraper to bypass Cloudflare protection on the Lightshot website.Error handling
If you run the command without specifying a mode, you’ll see:Sample output
When running the script, you’ll see the parsed arguments:Stopping the loop mode
To stop the continuous loop mode, pressCtrl+C in your terminal:
Default save location
All scraped images are saved to:%username% is automatically replaced with your Windows username.
The save path is currently hardcoded in main.py:25. There was previously an option to customize it via input, but it’s now commented out.
Next steps
Windows GUI
Use the graphical interface for easier operation
Installation
Set up the tool on your system