question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP redirect when downloading json file

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Jong-Sigcommented, Feb 5, 2021

@Jong-Sig This looks like a different issue. Could you please create a bug report for that?

Thanks for letting me know! I created a new bug report.

1reaction
EpiPhobecommented, Jan 25, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to read JSON and redirect a download
You can destructure the URL from the JSON object and then open a new tab for that URL to initiate a download.
Read more >
Specify Redirect Rules in a JSON File
You can specify redirect rules for URLs in a JSON file. Use the following format in a JSON file to specify redirect rules...
Read more >
HTTP Redirect when calling changeFiles JSON with Power ...
Solved: In Power Automate, when requesting via POST to the changeFiles endpoint, I am redirected to an azure CDN.
Read more >
Programmatic file downloads in the browser
When you try accessing that URL on your web browser, it prompts you to download the resource file — whatever the file is....
Read more >
HTTP redirects - HTTPie 3.2.1 (latest) docs
The reason is to make piping HTTPie's output to another programs and downloading files work with no extra flags. Most of the time,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found