Skip to content

Quickly upload any image type to a web-hook. An efficient Python module designed to upload images to Discord via a webhook. The module ensures image validation, robust error handling, and implements efficient request streaming and concurrent retries for failed uploads.

License

Notifications You must be signed in to change notification settings

Daethyra/Discord-AIU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Image Uploader

Brief Description

Discord Image Uploader is an efficient Python module designed to upload images to Discord via a webhook. The module ensures image validation, robust error handling, and implements efficient request streaming and concurrent retries for failed uploads.

Installation Guide

To install Discord Image Uploader, use PDM (Python Development Master):

  1. Install PDM:

    • Follow the installation instructions here.
  2. Clone the Repository:

    • Clone the Discord Image Uploader repository to your local machine.
  3. Install Dependencies:

    • Navigate to the repository's root directory and run:

      pdm install

How to Use the Module

  1. Configure Webhook URL:

    • Replace YOUR_WEBHOOK_URL_HERE in WEBHOOK_URL with your Discord webhook URL.
  2. Place Images:

    • Place images in ./images/ directory.
  3. Run the Module:

    • Execute pdm run ./src/discord_aiu.py. The module will validate and upload the images, logging the process.
  4. Check Logs:

    • Review image_uploader.log for logs and metrics related to the uploads.

Features

  • Request Streaming: Utilizes requests.Session for efficient connection handling.

  • Session Reuse: The same session is used for resending failed images, ensuring connection reuse.

  • Concurrent Retries: Failed images are retried concurrently using ThreadPoolExecutor.

  • Image Validation: Validates image size and dimensions before upload.

  • Error Handling: Appropriately logs errors.

  • Periodic Metrics Logging: Logs metrics periodically during the upload process.


License

This project is licensed under the GNU Affero General Public License (APL).

About

Quickly upload any image type to a web-hook. An efficient Python module designed to upload images to Discord via a webhook. The module ensures image validation, robust error handling, and implements efficient request streaming and concurrent retries for failed uploads.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages