prntscget.app

Lightshot prnt.sc (and prntscr.com) gallery downloader.

Members

Enums

MagicNumber
enum MagicNumber

Magic numbers.

ShellReturn
enum ShellReturn

Shell return values.

Functions

buildHeaders
string[string] buildHeaders()

Builds an associative array of HTTP GET headers to use when requesting information of images from the server.

downloadAllImages
void downloadAllImages(RemoteImage[] images, Configuration config, string[string] headers)

Downloads all images in the passed images list.

downloadImage
int downloadImage(Appender!(ubyte[]) buffer, string url, string imagePath, Duration requestTimeout, string[string] headers, bool alwaysKeep)

Downloads an image from the prnt.sc (prntscr.com) server.

ensureImageDirectory
bool ensureImageDirectory(string targetDirectory)

Ensures the target image directory exists, creating it if it does not and returning false if it fails to.

enumerateImages
uint enumerateImages(Appender!(RemoteImage[]) images, JSONValue listJSON, Configuration config)

Enumerate images, skipping existing ones.

getImageList
string getImageList(string[string] headers, uint requestTimeoutSeconds)

Fetches the JSON list of images for a passed cookie from the prnt.sc (prntscr.com) server.

handleGetopt
auto handleGetopt(string[] args, Configuration config)

Handles getopt arguments passed to the program.

hasValidJPEGEnding
bool hasValidJPEGEnding(ubyte[] fileContents)

Detects whether or not a passed array of bytes has a valid JPEG ending.

hasValidPNGEnding
bool hasValidPNGEnding(ubyte[] fileContents)

Detects whether or not a passed array of bytes has a valid PNG ending.

main
int main(string[] args)

Program entry point.

plurality
T plurality(N num, T singular, T plural)

Chooses between two values based on if the passed numeric value is one or many.

printHelp
void printHelp(GetoptResult results, string[] args)

Prinst the getopt help screen to the terminal.

run
int run(string[] args)

Program main logic.

Structs

Configuration
struct Configuration

Aggregate of values supplied at the command line.

RemoteImage
struct RemoteImage

Embodies the notion of an image to be downloaded.

See Also

Meta