A tiny Falcon app for requesting images with cloudscraper and returning the image data as a base64 string.
You can choose to either follow the Docker route or plain (Python) route.
docker pull t0shy/cloudscraper-image:latest
# or
docker build -t t0shy/cloudscraper-image:latest --no-cache .
Install the requirements with pip
.
pip install -r requirements.txt
docker run -dit --name cloudscraper-image t0shy/cloudscraper-image:latest
Note: You can remove the container after usage:
docker rm -f cloudscraper-image
python setup.py
curl http://<container-ip>:8000/image?url=<encoded-url>
Note: You can get the IP address of the container by running the following command:
docker inspect --format "{{ .NetworkSettings.IPAddress }}" cloudscraper-image
curl http://127.0.0.1:8000/image?url=<encoded-url>
The response will be a base64 string. To test/verify if this data is correct, you can use tools like Base64.guru to convert it back to an image.
To simplify development, a Taskfile.yml
is included. While the usage is optional, Task simplifies
the
setup for your development environment. Installation guide for Task can be found
at taskfile.dev/installation.
Setting up pre-commit
code style & quality checks for local development.
pre-commit install
task up
task check
task fix