pytower.image_backends.catbox

class pytower.image_backends.catbox.CatboxBackend(user_hash=None)[source]

Catbox backend that submits multipart form to https://catbox.moe/user/api.php

Parameters:

user_hash (str | None)

__init__(user_hash=None)[source]
Parameters:

user_hash (Optional[str]) – (Optional) Catbox user hash to use

upload_file(path)[source]

upload_file takes as input a path and returns the uploaded url

Parameters:

path (str) – Path to the file to upload

Return type:

str | None

Returns:

Uploaded URL as a string, or None if failed

upload_files(files)[source]

Upload multiple files. Default implementation can be overridden for performance and to avoid rate limiting

Parameters:

files (Iterable[str]) – List of file paths

Return type:

dict[str, str]

Returns:

Dictionary where paths are keys and urls are values