A Python tool to upload a large number of media files to an Immich instance. This tool uses the original Python code from the Immich documentation and checks if the file is supported by Immich according to the supported media types list in the Immich documentation.
- Uploads a large number of images to an Immich instance.
- Checks if the file is supported by Immich.
- Provides statistics on uploaded and skipped files.
- Python 3.x
requests
library- An Immich instance with a valid API key
-
Clone the repository:
git clone https://github.com/carforge/immich_bulk_upload.git cd immich-bulk-uploader
-
Install the required dependencies:
pip install requests
-
Replace the
API_KEY
andIMMICH_URL
variables in the script with your actual Immich API key and URL.API_KEY = "your_api_key" # replace with a valid api key IMMICH_URL = "http://127.0.0.1:2283/api" # e.g. http://127.0.0.1:2283/api
-
Run the script with the path to the folder containing the images you want to upload:
python upload.py /path/to/your/images
immich_uploader
: A helper class to handle the upload process.is_supported
: A helper function to check if a file is supported by Immich.upload_file
: Uploads a single file to Immich if it is supported.main
: The main function that loops over all directories, sub-directories, and files, and uploads them to Immich.
Uploading files from folder: /path/to/your/images
Directory: /path/to/your/images
Sub-directory: subdir1
image1.jpg:
{'status': 'duplicate', 'id': 'id-of-th-ei-ma-ge'}
image2.png:
{'id': 'id-of-th-ei-ma-ge', 'status': 'created'}
Processed 2 files. 1 have been added to Immich, 1 have been skipped.