pytower.image_backends.imgur

class pytower.image_backends.imgur.ImgurBackend(client_id)[source]

Imgur backend that based on submitting POST requests to https://api.imgur.com/3/upload

__init__(client_id)[source]
Parameters:

client_id – Imgur client ID 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