https://github.com/bigsk1/cloudflare-image-upload
script automates the process of uploading images to Cloudflare and gets back .md with CF Image urls
https://github.com/bigsk1/cloudflare-image-upload
cf-image cloudflare image-hosting image-recognition python scripts
Last synced: about 2 months ago
JSON representation
script automates the process of uploading images to Cloudflare and gets back .md with CF Image urls
- Host: GitHub
- URL: https://github.com/bigsk1/cloudflare-image-upload
- Owner: bigsk1
- License: mit
- Created: 2024-02-11T10:02:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-11T10:55:40.000Z (over 1 year ago)
- Last Synced: 2025-08-19T07:56:25.160Z (about 2 months ago)
- Topics: cf-image, cloudflare, image-hosting, image-recognition, python, scripts
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare Image Uploader
## Overview
The Cloudflare Image Uploader is a Python script designed to automate the bulk uploading of images to Cloudflare. It handles image uploads, manages duplicates by renaming, moves processed images to a designated directory, and generates a Markdown file listing all uploaded images for easy access and reference. This tool simplifies the management of web content images, especially for users with multiple images to upload and organize.
## Features
- **Bulk Uploads**: Automatically uploads multiple images to Cloudflare in one go.
- **Duplicate Handling**: Renames duplicate images to ensure uniqueness without overwriting existing files.
- **Processed Images Directory**: Moves images to a "processed" directory after successful upload.
- **Markdown Catalog Generation**: Creates a `.md` file listing all uploaded images with URLs, making it easy to incorporate images into web content.## Prerequisites
- Python 3.6 or higher installed on your system.
- Cloudflare account and API token with permissions to upload images.
- Basic familiarity with Python and running scripts from the command line.## Setup
1. **Clone or Download the Script**: Obtain the script files from the repository or download them directly to your local machine.
2. **Install Required Python Packages**:
Open a terminal or command prompt and navigate to the script's directory. Install the required packages using pip:```bash
pip install requests### Create a folder called Image_To_Be_Uploaded
add all the files and folder INSIDE cloudflare-image-upload folder into it
### Open the upload_img_py.py file and add your details
Your settings
```bash
API_TOKEN = 'your_api_token'
ACCOUNT_ID = 'your_account_id'
IMAGES_DIRECTORY = 'X:\\Cloudflare Images\\Image_To_Be_Uploaded'
PROCESSED_DIRECTORY = 'X:\\Cloudflare Images\\Image_To_Be_Uploaded\\PROCESSED_DIRECTORY'
CATALOG_FILE_PATH = 'X:\\Cloudflare Images\\Image_To_Be_Uploaded\\image_catalog.md'
```Edit Start_Image_upload.bat
add your path to python, unsure type in CMD type: where python
add your folder path to Image_To_Be_Uploaded## Usage
### Windows
Double click the .bat file to run### Linux
python upload_img_cf.py
### markdown file
Check your markdown file for cloudflare url's
Export as index.html and have all your images in a web browser to scroll through, right click to copy image url for pasting in your applications!
Pro Tip use notepad + + with Markdown viewer and just click export to html, double click html to open in web browser, find your image and right click save image link ( which is the cloudflare image url! )
---