import instaloader def download_saved_videos(username, password, download_path): # Create an Instaloader instance L = instaloader.Instaloader() # Login (optional) L.login(username, password) # Login if you need to access private saved videos # Obtain profile metadata profile = instaloader.Profile.from_username(L.context, username) # Iterate over saved posts for post in profile.get_saved_posts(): # Check if the post is a video if post.typename == "GraphVideo": try: # Download the video L.download_post(post, target=download_path) print(f"Downloaded video: {post.shortcode}") except Exception as e: print(f"Error downloading video {post.shortcode}: {e}") # Logout (optional) L.context.logout() # Use raw string literal to avoid invalid escape sequence warning download_saved_videos('luctrudel69', 'k#gn6td6!DBtR7h3EX', r'\\BOXICUBE\video\INTERNET\dq')