The InstaPost classο
- class InstaTweet.instapost.InstaPost(data, client=None)[source]View on GitHubο
Bases:
objectMinimalistic API response wrapper for an Instagram post
- __init__(data, client=None)[source]View on GitHubο
Initialize an
InstaPost- Parameters
data (dict) β the JSON response data of a single Instagram post, found within the
user_data
- jsonο
Source data from API response
- idο
The post id
- filepath: strο
Path of downloaded media, set by
download_post()
- tweet_data: dictο
Limited data from a successful tweet based off this post, set by
send_tweet()
- property children: List[InstaPost]ο
If the post is a carousel, returns a list of child
InstaPostβs
- property media_url: strο
The direct URL to the actual post content
- Returns
the
video_urlif the post is a video, otherwise thethumbnail_url
- property filename: strο
Concatenates
id+filetypeto create the default filename, for use when saving the postFor Example:
>> print(post.filename) "2868062811604347946.mp4"
- add_tweet_data(tweet)[source]View on GitHubο
Used by
TweetClientto add minimal tweet data after the post has been tweeted