0

This code is working for downloading Instagram videos

from instaloader import Instaloader, Profile

L = Instaloader()

L.login("username","Pass")

PROFILE = "instagram"
profile = Profile.from_username(L.context, PROFILE)

posts_sorted_by_likes = sorted(profile.get_posts(), key=lambda post: post.likes, reverse=True)

for post in posts_sorted_by_likes:
        if post.is_video:
                L.download_post(post, PROFILE)

But I want to download only photos from Instagram. I try change code in this line if post.is_video: but it's not working. How can I solve this?

Rasedul Islam
  • 77
  • 1
  • 9

0 Answers0