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

Fanbox Download by artist id issue - access denied #565

Closed
densetsumeru opened this issue Nov 12, 2019 · 19 comments
Closed

Fanbox Download by artist id issue - access denied #565

densetsumeru opened this issue Nov 12, 2019 · 19 comments

Comments

@densetsumeru
Copy link

Using 20191111 updated version

Description

Unable to use pixivutil to download from my supported fanbox creators

Steps to Reproduce

Opened pixivdownloader
entered f2 download by artist id
entered artist ID
Max page = 0 or Max page = 1

Expected behavior: [What you expected to happen]

PixivUtil would download the various image posts for me.

Actual behavior: [What actually happened]

Following error text popped up:

Using 0Auth to retrieve member info for : [pixivID]
access_denied
Failed to login using 0Auth
press enter to exit.

pixivutil won't go any further.

Versions

20191111

You can get this information from executing PixivUtil2.py --help.

@yzaoui
Copy link
Contributor

yzaoui commented Nov 16, 2019

Been getting the same issue since I first started using PixivUtil2 two weeks ago. I've tried looking into the code to no avail. I feel like the culprit might be that https://oauth.secure.pixiv.net/auth/token has been moved? Can anyone else confirm that they don't get a 404 from requesting their token there?

@Nandaka
Copy link
Owner

Nandaka commented Nov 16, 2019

Weird, tested the PixivOAuth module and it able to login

@yzaoui
Copy link
Contributor

yzaoui commented Nov 16, 2019

It specifically only happens with Fanbox downloads. Looking at it more closely I seem to be getting {"has_error":true,"errors":{"system":{"message":"access_denied","code":1508}}} when requesting OAuth. No proxies, username/password/cookie present in config.ini.

Searching the web, this error code came up recently when X-Client-Time and X-Client-Hash were added as requirements, but that's not a problem anymore. Any ideas what else it could be?

@Syampuuh
Copy link

Also getting the issue, and I am also getting a 404 from https://oauth.secure.pixiv.net/auth/token.

@Nandaka
Copy link
Owner

Nandaka commented Nov 16, 2019

you will get 404 to that page if you supply it without any parameter. Check your PC clock because it quite time sensitive? If you have python 2.7 installed, maybe you can try to run it from sourcecode.

@yzaoui
Copy link
Contributor

yzaoui commented Nov 16, 2019

Right, looks like it returns a 404 but it's not actually missing, that's just their response. But with the provided headers, it returns the 1508 error I mentioned above. I've been running it from sourcecode on python 2.7. I've synced up my time with the internet.

@Nandaka
Copy link
Owner

Nandaka commented Nov 16, 2019

@yzaoui get the latest commit and can you run the PixivOAuth.py in the console and copy the refresh token to config.ini. It should do self test to retrieve the artist info with oAuth header

image

@yzaoui
Copy link
Contributor

yzaoui commented Nov 16, 2019

image
I don't think I ever get the chance to receive a refresh token because the request is denied every time. My config.ini is the default, except I filled in my username, password, and cookie from my PHPSESSID.

These four lines are logged everytime I run PixivOAuth.py:

INFO - Login to OAuth using username and password.
DEBUG - 400: {"has_error":true,"errors":{"system":{"message":"access_denied","code":1508}}}
ERROR - access_denied
ERROR - None

@Nandaka
Copy link
Owner

Nandaka commented Nov 16, 2019

Looks like your ip address is blocked/banned by pixiv? If you are using firewall/antivirus, maybe try to temporarily disable it (maybe it strip some headers value sent to the server). Alternatively, try to use proxy?

@yzaoui
Copy link
Contributor

yzaoui commented Nov 16, 2019

Hmm, I turned off my firewall, I tried a proxy with different IPs, I created a new account, all of these attempts give me the same access_denied response. I can access everything on the browser version just fine, I seem to only have an issue with OAuth. I barely use Pixiv and haven't abused its servers, I wonder why I'd be restricted..

The mobile apps use OAuth right? I just tried the Android app for the first time and it works just fine. Although there is no Fanbox on it.. I'm not sure what to try next.

@Nandaka
Copy link
Owner

Nandaka commented Nov 17, 2019

Can you try the latest commit 501498e? updated the android app version for oAuth and I can login just fine by running test_OAuth() method for testing.

@yzaoui
Copy link
Contributor

yzaoui commented Nov 17, 2019

Still the same error sadly. I even tried proxying to another country and creating a new account there, in case they store my sign up IP, and I still get access_denied. There must be something in common with me and the two people above with the same issue.

@Nandaka
Copy link
Owner

Nandaka commented Nov 17, 2019

can you try it on different computer?

@yzaoui
Copy link
Contributor

yzaoui commented Nov 17, 2019

Same issue on my other windows computer, hmm..

@Nandaka
Copy link
Owner

Nandaka commented Nov 17, 2019

Try to use fiddler and analyze the differences between your PC and android client? I'm using fiddler and as long it sent the same kind of request header during login, it will be accepted.

https://www.telerik.com/fiddler

@yzaoui
Copy link
Contributor

yzaoui commented Nov 17, 2019

Did you manage to analyze the official android app? I'm on Android 9, installed Fiddler's cert, I can sniff browser requests but not apps like Pixiv. I found out that starting with Android 7 apps no longer use user-installed certificates.
EDIT: Tried recompiling the APK with a modified network_security_config.xml to allow user certs, but Fiddler still can't read it.

Found the problem in the code! I'll try to fix it :)

@Nandaka
Copy link
Owner

Nandaka commented Nov 18, 2019

@yzaoui I'm using nox emulator, which still running on android 4 😄
anyway, merged the code.

@yzaoui
Copy link
Contributor

yzaoui commented Nov 18, 2019

Ohh yeah that makes sense.

@densetsumeru @Syampuuh can you guys confirm it's been fixed for you with the latest release? If so this can be closed :)

@densetsumeru
Copy link
Author

@yzaoui good to go!

@Nandaka Nandaka closed this as completed Dec 14, 2019
byjtje pushed a commit to byjtje/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

4 participants