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

Newgrounds login credentials not recognized #2715

Closed
MarqFJA87 opened this issue Jun 28, 2022 · 6 comments
Closed

Newgrounds login credentials not recognized #2715

MarqFJA87 opened this issue Jun 28, 2022 · 6 comments

Comments

@MarqFJA87
Copy link

MarqFJA87 commented Jun 28, 2022

Everytime I try to download from Newgrounds, I keep getting "AuthenticationError: Invalid or missing login credentials" despite having put in my login credentials in the config file, which I've confirmed as being recognized by the app when downloading from other sites.

Verbose log follows:

[gallery-dl][debug] Version 1.22.2
[gallery-dl][debug] Python 3.10.0 - Windows-10-10.0.19043-SP0
[gallery-dl][debug] requests 2.26.0 - urllib3 1.26.7
[gallery-dl][debug] Starting DownloadJob for 'https://franktonius.newgrounds.com/art/'
[newgrounds][debug] Using NewgroundsArtExtractor for 'https://franktonius.newgrounds.com/art/'
[newgrounds][info] Logging in as MarqFJA87
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.newgrounds.com:443
[urllib3.connectionpool][debug] https://www.newgrounds.com:443 "GET /passport/ HTTP/1.1" 302 0
[urllib3.connectionpool][debug] https://www.newgrounds.com:443 "GET /social HTTP/1.1" 200 14352
[urllib3.connectionpool][debug] https://www.newgrounds.com:443 "POST /search/summary HTTP/1.1" 200 10421
[newgrounds][error] AuthenticationError: Invalid or missing login credentials

Just to confirm, this is how the relevant section in the config file should look like, right?

         "newgrounds":
        {
            "username": "[REDACTED]",
            "password": "[REDACTED]",
            "flash": true,
	    "format": "original",
            "include": "art"
        },
@kattjevfel
Copy link
Contributor

It seems to work just fine here, do you perhaps have backslash, quote marks or other stuff that needs to be escaped out?

@MarqFJA87
Copy link
Author

Not at all. If there was, in fact, I would've gotten a completely different error message that pointed me to the problematic line, like it had done so in the past when I forgot to add/remove a comma in the course of adding new configurations.

@mikf
Copy link
Owner

mikf commented Jun 28, 2022

I thought maybe the login on newgrounds broke or something, but no, it still works on my end:

$ gallery-dl -u d1618111 -p d1618111 -o cache.file= https://www.newgrounds.com/art/view/tomfulp/ryu-is-hawt -v
...
[newgrounds][info] Logging in as d1618111
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.newgrounds.com:443
[urllib3.connectionpool][debug] https://www.newgrounds.com:443 "GET /passport/ HTTP/1.1" 200 2053
[urllib3.connectionpool][debug] https://www.newgrounds.com:443 "POST /passport/appsession/50167181.8f59bb1dd6bb26eba09f9cbbadfd55cae81e557a4a8ec9 HTTP/1.1" 302 0
[urllib3.connectionpool][debug] https://www.newgrounds.com:443 "GET /social HTTP/1.1" 200 8976
[urllib3.connectionpool][debug] https://www.newgrounds.com:443 "GET /art/view/tomfulp/ryu-is-hawt HTTP/1.1" 200 12852
/tmp/newgrounds/tomfulp/newgrounds_94_Ryu is Hawt.gif

What is different for you is that the "GET /passport/ HTTP/1.1" 302 0 request for some reason redirects, while I get a proper response with 200 status code. No idea why, though.

Could you try again with -o write-pages=all and post the generated files here? Maybe they can tell us why things are different for you.

If nothing else helps, you can always directly use your browser's cookies. Either as cookies.txt file or with --cookies-from_browser.

@MarqFJA87
Copy link
Author

Had to convert the files from .DUMP to .TXT to attach them. They're still readable, though.

01_https_www.newgrounds.com_passport_.txt
02_https_www.newgrounds.com_social.txt
03_https_www.newgrounds.com_search_summary.txt

@mikf
Copy link
Owner

mikf commented Jun 28, 2022

Thanks!

You appear to already be logged in when visiting the /passport page, meaning gallery-dl already has the necessary cookies (NG_GG_username, vmk1du5I8m), which is probably why newgrounds sends you back to the homepage at /social.

Do you have a global cookies.txt file in your config or something like that?

Anyway, you can either remove your username&password to use your already exuisting cookies, or you disable those for newwgrounds with "cookies": null

And I should improve newground's login logic to not try to login if it isn't necessary like in your case.


I've also noticed that you are using a very old user agent string: Firefox/78.0. I don't think this is causing any problems here, but you might as well update it to the current version:

"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0",

@MarqFJA87
Copy link
Author

Disbaling cookies for Newgrounds worked like a charm! Thanks!

That aside, I got that user agent from the (more or less) complete example that is linked in the main page, back when I first made the config file back in February 2021.

@mikf mikf closed this as completed Jul 1, 2022
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

3 participants