Which code i can add to take data for saved posts using instaloader? Python

349 views Asked by At

Which code i can add to this code to get information about data to each saved post using instalouder? Please help!

import instaloader

def save_insta_collection():

username = 'cursach2022'
loader = instaloader.Instaloader()
loader.load_session_from_file(username)

profile = instaloader.Profile.from_username(loader.context, username)

post_list = []
try:
    for saved_photos in profile.get_saved_posts():
        post_list.append(saved_photos)

    loader.download_post(post_list[0], 'mysavedcollection')

except IndexError:
    print('You have no saved posts.')

save_insta_collection()

save_insta_collection()

0

There are 0 answers