pixiv oauth login error
{'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.
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)
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?
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
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?
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')
And adding (optional) selenium dependencies might enable gallery-dl to get around cloudflare in the future.
True. I'm not in the prediction business, but this might be the only real future-proof method at some point..