A thumbor server extension for DASH
Project description
thumbor_dash
A thumbor server extension for DASH
Setup
Requirements
- Python >= 3.9
- Pip >= 21.1
- Install thumbor_dash
pip install thumbor_dash
Note: thumbor_dash, thumbor, and other required dependencies will be installed
- Create a thumbor configuration file
thumbor-config > thumbor.conf
- Add these lines to
thumbor.conf
file
# Set allowed dimensions
MIN_WIDTH = 1
MIN_HEIGHT = 1
MAX_WIDTH = 1200
MAX_HEIGHT = 800
# Set security key
SECURITY_KEY = "0"
# Use only signed URL
ALLOW_UNSAFE_URL = False
# Set user moderation rules
REQUEST_TIME_LIMIT = 1 # time between requests in minutes
USAGE_VIOLATION_LIMIT = 5 # total number of times a requester can violate the time limit before ban
BAN_DURATION = 10 # requester ban duration in minutes
Usage
-
Start thumbor_dash server
thumbor_dash --conf=thumbor.conf
-
Sign image URL
thumbor_dash-url --key=<securityKey; must be "0"> --width=<width> --height=<height> --dashauth=<dashauth> --filters=<filters> <imageURL>
output:
/<signature>/<width>x<height>/dashauth:requester(<requesterId>):contract(<contractId>):document(<documentType>):field(<field>):owner(<ownerId>):updatedAt(<updatedAt>)/filters:format(<format>)/<encodedImageUrl>
-
Thumbor_dash image retrieval URL
http://<thumbor_dash-server>/<signature>/<width>x<height>/dashauth:requester(<requesterId>):contract(<contractId>):document(<documentType>):field(<field>):owner(<ownerId>):updatedAt(<updatedAt>)/filters:format(<format>)/<encodedImageUrl>
Note: If running the server locally, <thumbor_dash-server> should be
localhost:8888
Example
http://localhost:8888/Ai-ZyWWtJ0MHUQAm0GAlBTQMZ_Y=/1200x800/dashauth:requester(GCAFKUdw7PtUcDEG8j3sicMJ4ngx1aTqCdb4HD5n5WZ7):contract(En3GRoMNAnt69firp32h3NEBxyveLcHQMUbwhDW2UqoX):document(thumbnailField):field(avatarUrl):owner(GCAFKUdw7PtUcDEG8j3sicMJ4ngx1aTqCdb4HD5n5WZ7):updatedAt(1627076771396)/filters:format(jpeg)/https%3A//github.com/thumbor/thumbor/raw/master/example.jpg
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file thumbor_dash-0.0.4.tar.gz
.
File metadata
- Download URL: thumbor_dash-0.0.4.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3c64bc1efe05824847fe09df0701d902e493a316f3db0c70e36d1e968a37c35 |
|
MD5 | 293728236a3827abc3398dd83b18c9c1 |
|
BLAKE2b-256 | 351a9ed4bd97a211861ce4e644b99a32c07f8ce3bd75f1e6fade11e585fbf1a4 |
File details
Details for the file thumbor_dash-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: thumbor_dash-0.0.4-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a41de42d45350d9265dd6c9a8a3171aea3e72052bfecb1c13c4144167d10300 |
|
MD5 | 938158c341ece8418843af744e8d6e47 |
|
BLAKE2b-256 | 78fb71b6f8893b563dbe7dedb4db160f3118399dc64983ec8a4f50f12c3cd39c |