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

Need to update login detection: "cookie already expired or invalid" #658

Closed
connerbanner opened this issue Apr 1, 2020 · 23 comments
Closed

Comments

@connerbanner
Copy link

I just got this issue and cant seem to fix it on my own.

I saw another similar issue that got fixed with updating python and tried that to nothing.

Ive updated python

Ive logged out and re logged in to my pixiv account and it generates a new cookie code but even with that its still says its expired

Ive pasted that new generated code on a new and old version of PixivUtil2 several times to no luck

1st time this has happened in like a year of using this program

I'm at a lost

@bluerthanever
Copy link
Contributor

Did you try this one?
#505 (comment)

@connerbanner
Copy link
Author

yes ive been doing that over and over but each slightly new cookie value is still expired

@bluerthanever
Copy link
Contributor

Can you please tell us the version you are using, and the error details?

@connerbanner
Copy link
Author

connerbanner commented Apr 1, 2020

Screenshot (14)

oops thought i adding that in

and that might be a old one but i still tired on the newest version and put in JUST the code without my account pass and stuff

still 1st thing it tells me is that its expired...

@bluerthanever
Copy link
Contributor

hmm... I think this is maybe because the "https://www.pixiv.net" and "https://accounts.pixiv.net/login" pages are changed.

@bluerthanever
Copy link
Contributor

Could anyone please provide the page source of "https://www.pixiv.net" and "https://accounts.pixiv.net/login" ? I can login or login with saved cookie just fine... and you mentioned that pixiv updated and stuff. so I just wanna have a look into this...

@Romangelo
Copy link

Romangelo commented Apr 1, 2020

I guess they made some change to the site. I've been using it just fine, until I close the software and relaunch it today.

Edit: I tried with my alt. account and it's working fine. It looks like not all users are getting the updated version of the site.

@Shagiakhmetov
Copy link

I have the same problem and PHPSESSID does not help.
But when I created a new account PHPSESSID earned ...

@EfronC
Copy link

EfronC commented Apr 2, 2020

It doesn't work for me either, here is the source for accounts.pixiv.net, hope this is what is needed.

Login _ pixiv_files.zip

@bluerthanever
Copy link
Contributor

bluerthanever commented Apr 3, 2020

It doesn't work for me either, here is the source for accounts.pixiv.net, hope this is what is needed.

Login _ pixiv_files.zip

Sorry, I should have been more specific on my request. That was not what I wanted. Can you do as follows and tell me the result instead?

  1. Go to your browser, then go to "https://www.pixiv.net/", and make sure you are logged in.
  2. Get the page source (you can do this by using developer tools or other ways, but try avoiding using save page to local and then open it)
  3. Try looking for "logout.php" and "pixiv.user.loggedIn = true", and see if you get any result for each.

This is how the util tells if you are logged in and your PHPSESSID works.
If the site is updated on your side, maybe the two strings would not be found, so that your util doesn't work.

(Unless the page the util gets and you view from your browser are not the same.)

AND, if you can't find those two strings, and IF you can read the source, and find out how you can tell by some string like "pixiv.user.loggedIn = true" in it to tell if you are logged in, please tell as well.

@Shagiakhmetov
Copy link

3. Try looking for "logout.php" and "pixiv.user.loggedIn = true", and see if you get any result for each.

I could not find the lines you specified, but in the page code I see the following lines

<script>'use strict';var dataLayer = [{login: 'yes',gender: "male",user_id: "9473900",lang: "en",illustup_flg: 'not_uploaded',premium: 'yes',}];</script>
Perhaps they can show that the authorization was successful

@Terryble2
Copy link
Contributor

I've done the same as above, those strings are not present anywhere in the HTML. As Shagiakhmetov mentioned there are 2 script tags which contain some information about the logged in user. I've quoted them both below.

<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1830249-3']);
_gaq.push(['_setDomainName', 'pixiv.net']);
_gaq.push(['_setCustomVar', 1, 'login', 'yes', 3]);
_gaq.push(['_setCustomVar', 3, 'plan', 'normal', 1]);
_gaq.push(['_setCustomVar', 5, 'gender', 'male', 1]);
_gaq.push(['_setCustomVar', 6, 'user_id', "3145410", 1]);
_gaq.push(['_setCustomVar', 11, 'lang', "en", 1]);
_gaq.push(['_setCustomVar', 12, 'illustup_flg', 'not_uploaded', 3]);
_gaq.push(['_setCustomVar', 13, 'user_id_per_pv', "3145410", 3]);
_gaq.push(['_setCustomVar', 27, 'p_ab_d_id', "1828365849", 3]);
</script>
<script>
'use strict';
var dataLayer = [{ login: 'yes', gender: "male", user_id: "3145410", lang: "en", illustup_flg: 'not_uploaded', premium: 'no', }];
</script>

@bluerthanever
Copy link
Contributor

bluerthanever commented Apr 3, 2020

To @Shagiakhmetov @Terryble2
Thank you guys. I can find pixiv.user.loggedIn = true and those you have mentioned as well....
That's weird.
@Nandaka, do you have any idea...? Do you think we should update logic to check these strings as well?

@connerbanner
Copy link
Author

So I don't know what any of the stuff you guys are talking about mean on a program-e level but im guessing form the sounds of it, this is a issue that might get fixed with an update and not something that can be fixed in my desktop? Just want to know whats up.

@Terryble2
Copy link
Contributor

@connerbanner Yes, the Pixiv website has been updated so until a fix comes out in a new release it won't work.

@connerbanner
Copy link
Author

@Terryble2 damn hope it wont take long, its already been like 4 days and lifes already not the same without it. Over 1,176 profiles downloaded that its basically become routine to search the boorus, find the artists and download their profiles. Now without it do I realize that "damn I really don't do much else huh?" Godspeed PixivUtil2.

@Nandaka
Copy link
Owner

Nandaka commented Apr 4, 2020

To @Shagiakhmetov @Terryble2
Thank you guys. I can find pixiv.user.loggedIn = true and those you have mentioned as well....
That's weird.
@Nandaka, do you have any idea...? Do you think we should update logic to check these strings as well?

it is already checked for that string though
https://github.com/Nandaka/PixivUtil2/blob/master/PixivBrowserFactory.py#L280

@Nandaka Nandaka closed this as completed in 24d9923 Apr 4, 2020
@Nandaka
Copy link
Owner

Nandaka commented Apr 4, 2020

I've done the same as above, those strings are not present anywhere in the HTML. As Shagiakhmetov mentioned there are 2 script tags which contain some information about the logged in user. I've quoted them both below.

<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1830249-3']);
_gaq.push(['_setDomainName', 'pixiv.net']);
_gaq.push(['_setCustomVar', 1, 'login', 'yes', 3]);
_gaq.push(['_setCustomVar', 3, 'plan', 'normal', 1]);
_gaq.push(['_setCustomVar', 5, 'gender', 'male', 1]);
_gaq.push(['_setCustomVar', 6, 'user_id', "3145410", 1]);
_gaq.push(['_setCustomVar', 11, 'lang', "en", 1]);
_gaq.push(['_setCustomVar', 12, 'illustup_flg', 'not_uploaded', 3]);
_gaq.push(['_setCustomVar', 13, 'user_id_per_pv', "3145410", 3]);
_gaq.push(['_setCustomVar', 27, 'p_ab_d_id', "1828365849", 3]);
</script>
<script>
'use strict';
var dataLayer = [{ login: 'yes', gender: "male", user_id: "3145410", lang: "en", illustup_flg: 'not_uploaded', premium: 'no', }];
</script>

added additional validation on latest commit. I will upload beta version later.

@Shagiakhmetov
Copy link

Shagiakhmetov commented Apr 4, 2020

I will upload beta version later.

Good afternoon.

Unfortunately, the error persists ... I attached a log with the parameter "loglevel = INFO" and a screenshot with the parameter "debughttp = True"

2020-04-04 (2)
pixivutil.log

@Nandaka Nandaka reopened this Apr 4, 2020
@Nandaka Nandaka changed the title "cookie already expired or invaild" Need to update login detection: "cookie already expired or invalid" Apr 4, 2020
Nandaka added a commit that referenced this issue Apr 4, 2020
@Nandaka
Copy link
Owner

Nandaka commented Apr 4, 2020

@Shagiakhmetov
Copy link

can you try it?

Thanks.
Now everything is working.

@Terryble2
Copy link
Contributor

@Nandaka Works perfectly, thank you!

@connerbanner
Copy link
Author

@Nandaka Huzzah, the fog has lifted!

35122 pushed a commit to 35122/PixivUtil2 that referenced this issue Oct 30, 2020
35122 pushed a commit to 35122/PixivUtil2 that referenced this issue Oct 30, 2020
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

8 participants
@Nandaka @EfronC @bluerthanever @Terryble2 @Romangelo @connerbanner @Shagiakhmetov and others