Skip to content

ToshY/cloudscraper-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–ΌοΈ Cloudscraper for images

GitHub release (latest SemVer) Docker Hub repository Pylint Pip Audit Code style: black

A tiny Falcon app for requesting images with cloudscraper and returning the image data as a base64 string.

Setup

You can choose to either follow the Docker route or plain (Python) route.

πŸ‹ Docker

Pull or build

docker pull t0shy/cloudscraper-image:latest
# or
docker build -t t0shy/cloudscraper-image:latest --no-cache .

🐍 Plain

Install the requirements with pip.

pip install -r requirements.txt

Run webserver

πŸ‹ Docker

docker run -dit --name cloudscraper-image t0shy/cloudscraper-image:latest

Note: You can remove the container after usage:

docker rm -f cloudscraper-image

🐍 Plain

python setup.py

πŸ“¨ Request

πŸ‹ Docker

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

🐍 Plain

curl http://127.0.0.1:8000/image?url=<encoded-url>

πŸ“¬ Response

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.

πŸ› οΈ Contribute

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.

Pre-commit

Setting up pre-commit code style & quality checks for local development.

pre-commit install

Create container

task up

Quality & Code Style

task check

Code Style fix

task fix

About

A tiny Falcon app for requesting images with cloudscraper and returning the image data as a base64 string.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •