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

[instagram] error: HTTP redirect to login page #1230

Closed
Vishvamitra opened this issue Jan 7, 2021 · 19 comments
Closed

[instagram] error: HTTP redirect to login page #1230

Vishvamitra opened this issue Jan 7, 2021 · 19 comments

Comments

@Vishvamitra
Copy link

I've just tried to download pics from 10 profiles after 10 days of inactivity but all the downloads fail and the terminal prompts the following error message:
[instagram][error] HTTP redirect to login page (https://www.instagram.com/accounts/login/)
I'm running the latest version of gallery-dl (1.16.1).
Is there any workaround for this?

@mikf
Copy link
Owner

mikf commented Jan 7, 2021

Not really, except maybe increasing the delay between HTTP requests even more, or logging in. Changing your IP should also work.

Instagram only allows for a very limited amount of HTTP requests in a certain time interval before it always redirects to the login page for the next 12-24 hours.

@Vishvamitra
Copy link
Author

Thank you very much for replying. How do I increase the delay of HTTP requests? Is it possible by editing the gallery-dl config or is there another way of doing it?
As for the "logging in" part, I'm not sure of what you mean, since I always run gallery-dl with the -u and -p options to download content from instagram. Maybe I'm missing a step, though.

@mikf
Copy link
Owner

mikf commented Jan 9, 2021

Maybe the cached login session has expired? (Why else would you get redirected to the login page)

Run gallery-dl --clear-cache to force a re-login and renew the cached session the next time you download from Instagram. You should see a Logging in as ... message. Maybe that helps, but no guarantees.

How do I increase the delay of HTTP requests?

With the sleep-request option. Instagram uses 5 seconds by default.

@Vishvamitra
Copy link
Author

Vishvamitra commented Jan 10, 2021

After reading your reply, I tried to download the files a couple of times. Setting the --sleep 6 option only helpt for the first two downloads, whereas running the gallery-dl --clear-cache command allowed me to download everything else and to fix the problem. Thank you very much for the support!
Before closing the thread, I'd like to ask another question: since I also use gallery-dl for deviantart and since I've run the --clear-cache once already, will I have to regenerate the oauth for deviantart as well?

@mikf
Copy link
Owner

mikf commented Jan 11, 2021

Yes, dA refresh token(s) become invalid whenever the cache gets deleted.
It'd probably be a good idea to add a way to only remove cache entries for a particular site by adding an argument to --clear-cache and make it possible to do something like gallery-dl --clear-cache instagram.

@Vishvamitra
Copy link
Author

Yeah, adding an argument to the --clear-cache option would be lovely, indeed. What's strange, though, is that I didn't get the usual API responded with .... too many requests while I donwloaded some files from Deviantart yesterday; the program isn't allowing me to access premium content on DeviantArt, though.

@rufi-san
Copy link

rufi-san commented Jan 13, 2021

first of all sorry for my very bad english, it´s not my first languaje

second, i very very verrry noob on this, i dont now anything in programing, i use window 10 and i only learn how to do the simple comand like cd/ gallery-dl.exe instagram (da, twitter, etc), i now only that

three i have the same issue withe [instagram][error] HTTP redirect to login page (https://www.instagram.com/accounts/login/) , so i made another acount, but the solution no longer avaiable and i have againe the same problem, i cant create another acount in instagram and i have tried the --clear-cache thing and still nothing, so, please, can someane helpe me, i repeat, i realy noob on this

thanks and sorry for the problems, i hope someone can help me

edit: yes, i have the last version of the gallery-dl.exe for window

@github-account1111
Copy link

github-account1111 commented Jan 17, 2021

Getting the same error immediately even though I use my credentials. --clear-cache didn't fix the issue. Both sleep and sleep-request are set to 10 for the instagram category.

Edit: Never mind, running --clear-cache -c .\gallery_dl.conf instead fixed the problem.

@rufi-san
Copy link

Getting the same error immediately even though I use my credentials. --clear-cache didn't fix the issue. Both sleep and sleep-request are set to 10 for the instagram category.

Edit: Never mind, running --clear-cache -c .\gallery_dl.conf instead fixed the problem.

i have done that but dont resolve my problem, please, can you help me, i dont now what to do

@github-account1111
Copy link

The part after -c is your config file's location. Mine just happens to be in the same directory as the program (I set it that way). Yours can be in a different location.

@rufi-san
Copy link

rufi-san commented Jan 20, 2021

The part after -c is your config file's location. Mine just happens to be in the same directory as the program (I set it that way). Yours can be in a different location.

Ir I put it in another location, then my problem con be fixet? Because I Don't now ir the program gonna work if I change the location

@github-account1111
Copy link

github-account1111 commented Jan 27, 2021

No, all I said is if your config file's location is different from the default one (which is the case for me), you need to enter it manually after the -c flag.

@rufi-san
Copy link

No, all I said is if your config file's location is different from the default one (which is the case for me), you need to enter it manually after the -c flag.

i put the gallery-dl in another location but i dont now how to put the comand, usually i do this

cd/
gallery-dl.exe (insert instagram link)

but in the new location i dont now what comand to add

mikf added a commit that referenced this issue May 4, 2021
Allow for an optional argument to only delete cached entries from
a specific module.

delete all cache entries
$ gallery-dl --clear-cache
or
$ gallery-dl --clear-cache all

only delete entries for instagram
$ gallery-dl --clear-cache instagram
@phanirithvij
Copy link

For me, the cookies.txt for Instagram expired. Had to re-enter the cookies.txt contents.
I had "instagram" : { "cookies" : "/path/to/cookies.txt" } in the config.json
Got the new cookies as usual from Export cookies.txt chrome extension.

@Hrxn
Copy link
Contributor

Hrxn commented Aug 27, 2021

It's normal that (some) cookies expire..

By the way, I think this issue can be closed?

@mikf mikf closed this as completed Aug 29, 2021
@freshmre
Copy link

For those who are not logged in; logging in removes the error which you can do using gallery-dl -u <username> -p <password> <link>

@indianairlines
Copy link

indianairlines commented Apr 7, 2022

I used gallery-dl -u <username> -p <password> <link> but got "400 Bad Request' for 'https://www.instagram.com/accounts/login/ajax/" - I wonder why?

@mikf
Copy link
Owner

mikf commented Apr 7, 2022

@indianairlines you don't seem to be the only one (#2480), but I can still successfully login into my account. Output of --write-pages would/might be helpful.

@cobra4u
Copy link

cobra4u commented Apr 24, 2022

IT says the given below but how to use -o cursor?

Use '-o cursor=QVFBTWVJeW9fR3QyZG9GdzVvNndHbGZsRC1WUkttcHExcXh2VUluYVBaOUV5bHBCT1R3WTNORGlJQy1wSThOMVJFRDBnMUNmNjdQR1NLWTNqX0plYTNHcQ==' to continue downloading from the current position

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

No branches or pull requests

10 participants