HTTP redirect when downloading json file
See original GitHub issueDescribe the bug I am trying to use Instaloader to download the thousands of tagged posts of a user, with the help of resumable iterations but I am only able to do about 100 to 200 a day before the json files are skipped due to a HTTP redirect message.
To Reproduce
I am using the following instaloader settings to download tagged posts:
L = instaloader.Instaloader(download_comments = False, compress_json = False)
And the following code:
for post in post_iterator:
try:
L.download_post(post, target = foldername)
Expected behavior
I expect Instaloader to download all three parts of the post: the post image/videos, the caption in a txt file, and the metadata as an uncompressed json file:
targetdir\2020-01-01_01-01-01_UTC.jpg [Post Caption1] json
Currently, Instaloader does this for about 150 posts before only downloading the image/video and caption, and skipping the json file completely.
Error messages and tracebacks
targetdir\2020-01-01_01-01-01_UTC.jpg [Post Caption1]
HTTP redirect from https://www.instagram.com/graphql/query to https://www.instagram.com/accounts/login/
targetdir\2020-02-02_02-02-02_UTC.jpg [Post Caption2]
HTTP redirect from https://www.instagram.com/graphql/query to https://www.instagram.com/accounts/login/
targetdir\2020-03-03_03-03-03_UTC.jpg [Post Caption3]
HTTP redirect from https://www.instagram.com/graphql/query to https://www.instagram.com/accounts/login/
(does this for remaining posts until I interrupt the program)
Instaloader version 4.5.5
Additional context
The reason for try:
in my for loop is due to several posts not downloading due to missing images.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Thanks for letting me know! I created a new bug report.
I also believe that with v4.6, I have not been able to encounter this problem. But thank you, I will make sure to use your fix in case I ever face this issue again.