gallery-dl icon indicating copy to clipboard operation
gallery-dl copied to clipboard

pixiv oauth login error

Open eitimiyabi opened this issue 3 years ago • 7 comments

{'has_error': True, 'errors': {'system': {'message': 'The authorization code has expired', 'code': 1508}}, 'error': 'invalid_grant'} 'code' expired, try again

It comes up again and again.

eitimiyabi avatar Jun 12 '22 08:06 eitimiyabi

I'm sorry to say, but you just have to be faster. The note that says "'code' will expire 30 seconds after logging in." is there for this exact reason.

If you really can't do it fast enough, you can try some other methods like https://github.com/eggplants/get-pixivpy-token (https://github.com/mikf/gallery-dl/issues/2306#issuecomment-1046139416)

mikf avatar Jun 12 '22 09:06 mikf

By the way, seems like the pixiv had enhanced the authorization process: you can now click on the pop-up window and run the app like magnet links works. Can this be bound to gallery-dl somehow to easify the logging in process?

Gigas002 avatar Jun 13 '22 04:06 Gigas002

i have used a selenium implementation and was surprised by how user-friendly and easy the process was compared to the existing method that didnt work for me. https://gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde found on: https://github.com/upbit/pixivpy

thatDudo avatar Oct 03 '22 15:10 thatDudo

Well, not sure, you need Selenium and a WebDriver as additional dependencies in this case..

Also, based on your linked Gist, they use this URL in the first code block; https://chromedriver.storage.googleapis.com/index.html?path=91.0.4472.101/

Which is some old WebDriver version for Chrome, or did this still work for you?

Hrxn avatar Oct 04 '22 20:10 Hrxn

I have downloaded and installed the newest ungoogled chromium browser + web driver (https://github.com/ungoogled-software/ungoogled-chromium-debian/blob/unportable/README.md#installing) but it also works with firefox/librewolf if the browser is already installed with a profile (https://github.com/mozilla/geckodriver/releases/tag/v0.31.0).

driver = webdriver.Firefox(executable_path='./geckodriver', firefox_binary='/usr/bin/librewolf')

thatDudo avatar Oct 05 '22 10:10 thatDudo

And adding (optional) selenium dependencies might enable gallery-dl to get around cloudflare in the future.

thatDudo avatar Oct 05 '22 11:10 thatDudo

True. I'm not in the prediction business, but this might be the only real future-proof method at some point..

Hrxn avatar Oct 05 '22 16:10 Hrxn