Pynstagram is small python module and CLI tool that allows you to upload photo to Instagram.
pynstagram -u username -f ~/kittens/31415.jpg -t '#meow'
import pynstagram
with pynstagram.client('username', 'password') as client:
client.upload('~/kittens/31415.jpg', '#meow')
pip install pynstagram
To use a line break in caption text you need to properly escape \n
symbol. There are few options:
- Use
$' . . . '
escaping.
pynstagram -u username -f ~/kittens/31415.jpg -t $'line\nbreak'
- Use multiline argument.
pynstagram -u username -f ~/kittens/31415.jpg -t "line
> break"
Disclaimer: Pynstagram uses private API of Instagram, there is no guaranty that this library will work in the future. Instagram may not like that you use private API.
Many kudos to Lance G. Newman for his article.