# Instagram Pixelfed Batch Upload

![Tool illustration](assets/pixelfed-bot_illustration_small.png "Littel Robot describing the pictures for you.")

This program takes a folder, iterates over the images and creates Pixelfed postings with a specified batch size. 

There are 4 different options for the image description (ALT text) supported now:

1. ChatGPT/OpenAI mode: generating the image description using the OpenAI API and respective model. You'll need to provide your OpenAI API access key and the model you wanna use. 

2. Local/Ollama mode: generate the image description using a local/own installation of Ollama. You'll have to configure the base URL of your ollama installation, an (optional) access key and the model to be used.

3.) File mode: reading the image description from a text file with the same name as the image + a configurable extension. 

4.) No description: don't generate an image description, just batch upload the pictures.


The description of the post can be given via the `config.json`. 
Two variables in the post description can be give (see the `config.json.example` ).

```
Usage: pixelfed_batch_uploader [OPTIONS] --title <TITLE> --image-path <IMAGE_PATH>

Options:
  -m, --mode <MODE>
          Image description mode

          [default: file]

          Possible values:
          - chat-gpt: Use ChatGTP
          - file:     Taking from a file
          - local:    Local LLM
          - none

  -t, --title <TITLE>
          The title of the posting

  -i, --image-path <IMAGE_PATH>
          The path to the file to read

  -c, --config <FILE>
          Sets a custom config file

  -v, --visibility <private>


  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version
```

Example: `Usage: `./pixelfed_batch_uploader -i ../../Downloads/Instagram-Backup/media/posts/201406 --title "June 2014" -m local`

The `config.json` must be in the same directory the program is called from (`$PWD`)



Check the [package of this repo](https://repos.mxhdr.net/maxheadroom/insta-import-pixelfed/packages) to get pre-compiled binaries for macOS (Apple Silicon), Linux x86_64, Windows ARM


