PixivUtil2 icon indicating copy to clipboard operation
PixivUtil2 copied to clipboard

Login/Download Issues see here (Oct-20)

Open NHOrus opened this issue 3 years ago • 168 comments

Edited by @Nandaka: Please follow this step first

https://github.com/Nandaka/PixivUtil2/wiki#pixiv-login-using-cookie

https://github.com/Nandaka/PixivUtil2/wiki#fanbox-login-using-cookie

Prerequisites

  • [x] Did you read FAQ section?
  • [x] Did you test with the latest releases or commit ?

Description

Trying to start PixivUtil to get pictures, connection fails

Steps to Reproduce

Start up configured PixivUtil2

Expected behavior:

Program starts normally, downloads work

Actual behavior:

Cannot Login! press enter to exit

2020-10-14 09:01:16,420 - PixivUtil20201009-beta1 - INFO - ###############################################################
2020-10-14 09:01:16,420 - PixivUtil20201009-beta1 - INFO - Starting with argument: [E:\conf\pixiv\pixivutil\PixivUtil2.exe].
2020-10-14 09:01:16,423 - PixivUtil20201009-beta1 - INFO - Setting log level to: DEBUG
2020-10-14 09:01:16,423 - PixivUtil20201009-beta1 - INFO - No default cookie jar available, creating... 
2020-10-14 09:01:16,565 - PixivUtil20201009-beta1 - INFO - Using default DB Path: E:\conf\pixiv\pixivutil\db.sqlite
2020-10-14 09:01:16,567 - PixivUtil20201009-beta1 - INFO - Using Username: nhorus
2020-10-14 09:01:16,567 - PixivUtil20201009-beta1 - INFO - Trying to log in with saved cookie
2020-10-14 09:01:16,765 - PixivUtil20201009-beta1 - ERROR - Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x41b9fa0 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x041E3148>)
2020-10-14 09:01:16,767 - PixivUtil20201009-beta1 - ERROR - Traceback (most recent call last):
  File "PixivUtil2.py", line 1077, in doLogin
    last_image_id = -1
  File "PixivBrowserFactory.pyc", line 317, in loginUsingCookie
  File "PixivBrowserFactory.pyc", line 206, in open_with_retry
  File "mechanize\_mechanize.pyc", line 253, in open
  File "mechanize\_mechanize.pyc", line 309, in _mech_open
mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper: HTTP Error 403: Forbidden

2020-10-14 09:01:16,767 - PixivUtil20201009-beta1 - ERROR - Cannot Login!
2020-10-14 09:01:16,768 - PixivUtil20201009-beta1 - ERROR - Traceback (most recent call last):
  File "PixivUtil2.py", line 1077, in doLogin
    last_image_id = -1
  File "PixivBrowserFactory.pyc", line 317, in loginUsingCookie
  File "PixivBrowserFactory.pyc", line 206, in open_with_retry
  File "mechanize\_mechanize.pyc", line 253, in open
  File "mechanize\_mechanize.pyc", line 309, in _mech_open
mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper: HTTP Error 403: Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "PixivUtil2.py", line 1278, in main
    parsed_page = BeautifulSoup(page.read().decode("utf-8"), features="html5lib")
  File "PixivUtil2.py", line 1084, in doLogin
    raise
PixivException.PixivException: 0 Cannot Login!, hasDumpPage=N, pageData=None

Versions

You can get this information from executing PixivUtil2.py --help. Latest version available in https://github.com/Nandaka/PixivUtil2/releases

NHOrus avatar Oct 14 '20 06:10 NHOrus

I just got this recently also, from the latest PixivDownloader

Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x4282d60 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x04292A68>) Cannot Login!

RighteousAnger avatar Oct 14 '20 06:10 RighteousAnger

I have the same problem

Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x3835bb0 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x03864968>) Cannot Login!

gnarf1975 avatar Oct 14 '20 06:10 gnarf1975

Same problem here too.

Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x3b60778 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x03B6F0C8>) Cannot Login!

kody180 avatar Oct 14 '20 06:10 kody180

Maybe because of this, Pixiv want you to change your password? image

Also, update your cookie again, looks like the format changed.

Works fine after changing my password and updating the cookie. image

Nandaka avatar Oct 14 '20 07:10 Nandaka

Same problem.

I had tried change PHPSESSID and not working.

polujm9 avatar Oct 14 '20 07:10 polujm9

@polujm9 try to update your password in pixiv website and try to match the useragent value with your browser.

Nandaka avatar Oct 14 '20 07:10 Nandaka

Changing my password on the website and updating my config with the new PW, PHPSESSID, and UA appear to have fixed this for me. Edit: FWIW, I did not receive anything from Pixiv that would have prompted me/suggested that I should change my password.

jwshields avatar Oct 14 '20 07:10 jwshields

Changing Password works for me.

polujm9 avatar Oct 14 '20 07:10 polujm9

Changing password, changing session, none of that worked for me. I ended up creating a new account, and that worked just fine.

Interestingly the new session ID was shorter since it wasn't preceded by '10XXXXXX_'.

Tarried avatar Oct 14 '20 08:10 Tarried

Same error here too. I changed my PW, PHPSESSID and User Agent, but i still get the error:

Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x3bf03d0 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x03BE95C8>) Cannot Login!

I also gone through this: https://github.com/Nandaka/PixivUtil2/issues/505

Anything else i can try?

todesschnitzel avatar Oct 14 '20 09:10 todesschnitzel

I logged in and the prompt to change password appears, so I changed with that and updated the cookie (which formatted differently) and it works again. Maybe try to logout and login back and see if the prompt appears. Perhaps a simple password change if you're already logged in wouldn't work. Can't guarantee though as I didn't try it myself.

skyvory avatar Oct 14 '20 10:10 skyvory

Did not get prompt to change password. Changed nonetheless, new cookie, does not work. :(

pxssy avatar Oct 14 '20 10:10 pxssy

Didn't get the prompt, but changing the password worked. Added the new cookie and password to the config and it worked just as always. Back to pulling from multiple instances at once with no issues.

ItaloKnox avatar Oct 14 '20 10:10 ItaloKnox

I have the same problem like everyone above.

From the looks of it, it seems the solutions seem to be hit or miss,

Unfortunately, none of the solutions worked for me.

Tried changing password and updating the cookie and user agent - no luck

Hell, I tried making a new account and that didn't work either.

fanboy01 avatar Oct 14 '20 10:10 fanboy01

I also got it to work by changing my Pixiv password and then updating my configuration with the new password, new cookie and current user agent.

Hamuko avatar Oct 14 '20 10:10 Hamuko

I got the same problem: Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x3e7b3d0 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x03E81AC8>) Cannot Login! and changing password doesn't work

Baramanga avatar Oct 14 '20 13:10 Baramanga

I currently test out a way to download in full mode normally When you change the password and play this screen, use F12 to directly view the new PHPSESSID Can change the same password Don’t go to the pixiv homepage to check the PHPSESSID Will not display the number of ID "XXXXXXX_" but only the command line after _ EDIT: also check your browser user-agent to match with config.ini image

Current solution

ee092884 avatar Oct 14 '20 13:10 ee092884

Same issue. I've done the following:

logged out and back in. No prompt to change password. Updated cookie/useragent Changed password Updated cookie/useragent again no luck; problem persists.

The error I get is the same as the others: Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x7f8fa3adae18 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x7f8fa3929348>) Cannot Login!

viravera avatar Oct 14 '20 13:10 viravera

I'm adding my comment here with the same issue and the previous steps didn't work:

-Logged out and back in (I was not prompted to make any password change)

  • Changed password
  • Logged out and back in
  • Copy new cookie -Updated user agent

i don't want to create a new account so I didn't do that.

Error code: 'Error at doLogin(): (<class 'mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x3717a48 whose wrapped object = <HTTPError 403: 'Forbidden'>>, <traceback object at 0x03734768>) Cannot Login!'

DisasterInbound avatar Oct 14 '20 16:10 DisasterInbound

20201015014409 I managed to save the page retrieved in doLogin and it turns out to be as the picture above shows. Looks like they put more effort in anti-scraping.

bluerthanever avatar Oct 14 '20 17:10 bluerthanever

it seems to be cloudflare.... geez. I hate cloudflare.

bluerthanever avatar Oct 14 '20 17:10 bluerthanever

@polujm9 try to update your password in pixiv website and try to match the useragent value with your browser.

Worked for me using v20201009-beta1 and I used Chrome 86.0.4240.75 to get my PHPSESSID value

First I changed my password and PHPSESSID cookie value to see if that alone would work. It did not.

Then used this site (https://www.whatismybrowser.com/detect/what-is-my-user-agent) to detect my useragent and replaced whatever was in the config.ini WORKED

aksskl avatar Oct 14 '20 19:10 aksskl

@polujm9 try to update your password in pixiv website and try to match the useragent value with your browser.

Worked for me using v20201009-beta1 and I used Chrome 86.0.4240.75 to get my PHPSESSID value

First I changed my password and PHPSESSID cookie value to see if that alone would work. It did not.

Then used this site (https://www.whatismybrowser.com/detect/what-is-my-user-agent) to detect my useragent and replaced whatever was in the config.ini WORKED

Hit or miss for sure... using v20201009-beta1 and I used Chrome 86.0.4240.75 (Latest) I go to Pixiv website to change password with no prompt encountered Put in my new password along with the new cookie using Chrome in the config and logged out Headed over to detected my useragent and copy what was there and replaced in the config Open up the downloader and still same error results...I also tried on two different accounts, no avail. (Giving me the same error) Something must've changed recently no...?

RighteousAnger avatar Oct 14 '20 20:10 RighteousAnger

I managed to get it working again. I had no prompt to change my password, but doing so provided me with a new PHPSESSID that is in a new format. The old format had 6 digits and an underscore prepended (######_RestOfID). The new format does not.

Note that I had previously attempted setting a matching useragent and logging out and in to generate a new PHPSESSID. Before I changed my password, it simply gave me a new PHPSESSID in the old format, which did not work.

Kotters avatar Oct 14 '20 21:10 Kotters

Changed password, updated cookie, logged out. Problem persists.

maxiy01 avatar Oct 14 '20 21:10 maxiy01

Keeping the SESSID unique auth token (the part that is after the underscore) and removing your user ID as well as the underscore will allow you to log in just fine, for now at least. You'll still have to manually provide your user ID to PixivUtil for this to work. I suspect this is part of #807 as user IDs classify as trackable information but @bluerthanever raised a valid concern with the verification process. pixiv probably didn't even think ahead nor test it at all as usual.

I cannot guarantee this will help solve the issue as I tried both a rather old release and the latest one, both run into #817 when trying to download something. Nothing seems to generate the new format or any prompt for that matter, no matter the browser, method or password complexity so for now stuck with this like everyone else encountering it.

If someone manages to grab a link to the password change prompt, maybe that would also force reformat the stored cookie instead of pushing the ID to force a manual check which is what seems to be happening.

AgentThirteen avatar Oct 14 '20 23:10 AgentThirteen

Ok. I didn't do any test yesterday. But here is what I did, and I have no problem for now.

  1. Deleted all cookie in browser with extension, not logging out (not sure if there are any differences)
  2. Logged in again in browser, somehow this time they asked for recaptcha, and password update.
  3. Updated the new PHPSESSID in config.in and viola.

Edit: Didn't try out any of the menu items yet. And the new PHPSESSID seems to be in new format as well.

bluerthanever avatar Oct 15 '20 02:10 bluerthanever

Changed password and re-login Updated the new PHPSESSID in config.in Updated user agent Problem persists.

walrus263 avatar Oct 15 '20 03:10 walrus263

try to login in incognito mode? ensure the new cookie value doesn't have _ in it (e.g. 189000_abcdefghijkalmnoxxxx <- old version)

Nandaka avatar Oct 15 '20 05:10 Nandaka

I can't get it to work. Tried to export the cookie through different browsers, even android but still get one with an underscore (e.g. 189000_abcdefghijkalmnoxxxx). If i remove the "189000_" from the cookie i get

Trying to log in with saved cookie Login successful. Unable to get User Id, please check your cookie.

Also changed the User Agent, but it doesn't seem to matter, at least on my side... I already changed my PW, didn't get me a "good" cookie.

todesschnitzel avatar Oct 15 '20 06:10 todesschnitzel