This is a script to batch-upload images inside a directory to imgbb cloud. It will write the URLs returned by the API to a spreadsheet.
Verify if you have Python 3.8.* installed. If not, checkout these resources:
- Be sure to have correct version of
Python 3
- Create an account at imgbb and get one API_KEY.
- Create a new file called .env and write your API_KEY on it. See the Example bellow
Run on terminal, inside imgbb directory
pip install -r requirements.txt
Inside your .env file type the following
API_KEY=YOUR_API_KEY
Before any execution
Examples of the arguments of send_imgs function
send_imgs(full_folder_path:str, full_spread_sheet_path:str)
OS | full_folder_path | full_spread_sheet_path |
---|---|---|
Linux | /home/user1/Documents/photos/ | /home/user1/Documents/urls.xlsx |
Windows | C:\Users\user1\Documents\photos | C:\Users\user1\Documents\urls.xlsx |
Inside the imbb directory type the following on the terminal
Plataform | Comand |
---|---|
Windows | python sendImagens.py |
Linux | python3 sendImages.py |
demon_slayer UPLOADED SUCCESSFULLY!!!
FULL_PATH: /home/<user>/<Directory>/demon_slayer.jpg
URL: https://i.ibb.co/StX4kjY/demon-slayer.jpg
demon_slayer UPLOADED SUCCESSFULLY!!!
FULL_PATH: C:\Users\<user>/<Directory>/demon_slayer.jpg
URL: https://i.ibb.co/StX4kjY/demon-slayer.jpg
Antes de começar, verifique se você atende aos seguintes requisitos:
- Você instalou a versão 3.8.*
Python 3
- Criar uma conta imgbb and get one API_KEY.
- Criar um arquivo chamado .env e colocar sua API_KEY. Veja o exemplo abaixo
pip install -r requirements.txt
API_KEY=YOUR_API_KEY
Examplos dos argumentos da função send_imgs
send_imgs(full_folder_path:str, full_spread_sheet_path:str)
OS | full_folder_path | full_spread_sheet_path |
---|---|---|
Linux | /home/user1/Documents/photos/ | /home/user1/Documents/urls.xlsx |
Windows | C:\Users\user1\Documents\photos | C:\Users\user1\Documents\urls.xlsx |
No terminal, dentro do diretório imgbb digite:
Plaforma | Comando |
---|---|
Windows | python sendImagens.py |
Linux | python3 sendImages.py |
demon_slayer UPLOADED SUCCESSFULLY!!!
FULL_PATH: /home/<user>/<Directory>/demon_slayer.jpg
URL: https://i.ibb.co/StX4kjY/demon-slayer.jpg
demon_slayer UPLOADED SUCCESSFULLY!!!
FULL_PATH: C:\Users\<user>/<Directory>/demon_slayer.jpg
URL: https://i.ibb.co/StX4kjY/demon-slayer.jpg