File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ # -*- coding: utf-8 -*-
3+ from InstagramAPI import InstagramAPI
4+
5+ username ,password = "" ,""
6+ """
7+ ## Uploading a timeline album (aka carousel aka sidecar).
8+ """
9+ media = [ #Albums can contain between 2 and 10 photos/videos.
10+ {
11+ 'type' : 'photo' ,
12+ 'file' : '/path/to/your/photo.jpg' , # Path to the photo file.
13+ 'usertags' : [
14+ { # Optional, lets you tag one or more users in a PHOTO.
15+ 'position' : [0.5 , 0.5 ],
16+ # WARNING: THE USER ID MUST BE VALID. INSTAGRAM WILL VERIFY IT
17+ # AND IF IT'S WRONG THEY WILL SAY "media configure error".
18+ 'user_id' : '123456789' , # Must be a numerical UserPK ID.
19+ },
20+ ]
21+ },
22+ {
23+ 'type' : 'photo' ,
24+ 'file' : '/path/to/your/photo.jpg' , # Path to the photo file.
25+ },
26+ #{
27+ # 'type' : 'video',
28+ # 'file' : '/path/to/your/video.mp4', # Path to the video file.
29+ # 'thumbnail': '/path/to/your/thumbnail.jpg'
30+ #}
31+ ]
32+ captionText = 'caption 3' ; # Caption to use for the album.
33+ ig = InstagramAPI (username ,password )
34+ ig .login ()
35+ ig .uploadAlbum (media , caption = captionText )
You can’t perform that action at this time.
0 commit comments