Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--resume-prefix to activate on errors #920

Closed
AlphaSlayer1964 opened this issue Dec 12, 2020 · 5 comments
Closed

--resume-prefix to activate on errors #920

AlphaSlayer1964 opened this issue Dec 12, 2020 · 5 comments
Labels
feature suggestion Feature suggestion

Comments

@AlphaSlayer1964
Copy link

Provide us a use case of the feature
Sometimes instagram accounts are marked as being hijacked for using instaloader giving a 400 error ending the download session. --resume-prefix would activate on these types of errors stopping you from having to re-download all the posts again to get to the remaining ones.

Describe the solution you'd like
--resume-prefix saves a json file when you encounter an error and not just when manually aborting the program. (maybe excluding 429 as sometimes you can wait it out)

Describe alternatives you've considered
Unless I’m miss understanding how the resume feature works I don't see a built in alternative.

If the feature request is accepted, would you be willing to submit a pull request?
No. Sorry I only no basic python

Additional context
None

@AlphaSlayer1964 AlphaSlayer1964 added the feature suggestion Feature suggestion label Dec 12, 2020
@aandergr
Copy link
Member

Instaloader does not abort when it encounters an error. Instead, it retries the request that has been responded with an error code, and when the request repeatedly failed, the corresponding post is skipped and Instaloader goes to the next post in the loop. The resume logic (i.e. saving the iterator file that is used for later resuming) is only triggered when manually aborting the loop, e.g. by hitting Control+C or by sending the SIGINT signal.

So the here-described feature suggestion might be that Instaloader should have a flag (e.g. --abort-on-400) that when a request is responded with the error code 400, the download loop is aborted and the resume logic is triggered.

I think this would be good to have in Instaloader, to alleviate the problems that are caused with the "400 Bad Request" lock that has been reported in #770 and #828, unless of course someone discovers a way to entirely avoid this error.

@aandergr
Copy link
Member

Implemented in upcoming/v4.7 (syntax is --abort-on=400).

@AlphaSlayer1964
Copy link
Author

Thank you so much for this! Another question maybe you could answer but if I use --resume-prefix and --fast-update will it go to where the resume json says to start then do the typical fast update procedure of stopping once a matched name is found? I'm trying to write a command that has --abort-on=400 --resume-prefix resume --fast-update so when downloading an account if my account gets timed out it will save the position it timed out on but when finished if run again would use the fats update.

@aandergr
Copy link
Member

Sure, --fast-update also works when resuming, aborting the download once the first already-downloaded post is encountered.

@AlphaSlayer1964
Copy link
Author

ok thanks for letting me know. Also I have noticed on the upcoming 4.7 build while it may still get stuck in a 429 loop and take a while to download stuff the new timing seems to prevent the account from being locked! I currently have three different accounts (on different ips) downloading posts for the last four days and no account locks have occurred. Though it is quite slow to download everything again but updating what's already ben downloaded should be super easy now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

2 participants