I am unable to access posts from public accounts on Instagram

I am encountering an issue during the execution of the following code.:

import instaloader  
L = instaloader.Instaloader()

username = input("Username: ")

L.download_profile(username, profile_pic_only=False)

Initially, when I implemented the code to retrieve all posts simultaneously, it functioned as anticipated.

However, during the testing phase to achieve my desired objective, the following error has consistently occurred.

JSON Query to graphql/query: Expecting value: line 1 column 1 (char 0) [retrying; skip with ^C]
JSON Query to graphql/query: 401 Unauthorized - "fail" status, message "Please wait a few minutes before you try again." when accessing https://www.instagram.com/graphql/query?variables=%7B%22data%22%3A%7B%22count%22%3A12%2C%22include_relationship_info%22%3Atrue%2C%22latest_besties_reel_media%22%3Atrue%2C%22latest_reel_media%22%3Atrue%7D%2C%22username%22%3A%22yashinrush9%22%2C%22__relay_internal__pv__PolarisFeedShareMenurelayprovider%22%3Afalse%7D&doc_id=7898261790222653&server_timestamps=true [retrying; skip with ^C]

I would greatly appreciate your assistance with the situation at your earliest convenience.

read the error message

you are not allowed to make requests that often

alternatively, 401 means “Unauthorized”, but if you did not change anything in the credentials, you are making requests too fast