-
Notifications
You must be signed in to change notification settings - Fork 31
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 less brittle NYT authentication method #58
Comments
In case it helps: https://github.com/Q726kbXuN/nytxw_puz |
Looks like that script uses |
No interaction needed, just pass browser as |
How does the YML file need to look with NYT-S? As it started it is empty |
As it currently stands, it should look like: nyt:
NYT-S: long-NYT-S-key-here-pulled-from-your-browser-cookies In the future, in accordance with #92, I think that should probably be in a |
after hours of trying to figure out the NYT auth flow and getting it working in postman, i found this library https://github.com/GodTamIt/nytxw-puz-cli his puzzle parsing is outdated, but the auth flow looks perfect! |
Currently,
xword-dl
kind of spoofs the NYT Crosswords app with a request that passes a user-supplied username and password and then saves the authenticatedNYT-S
token it gets in response.1 That appears to work inconsistently, resulting in occasional 403 errors that have been difficult to diagnose and mitigate (e.g. #51). Given that this approach is unreliable now and subject to become even more reliable, it would be good ifxword-dl
had a more straightforward approach that was less subject to breakage.One option I'm considering is using browser-cookie3, which could retrieve a cookie from basically any browser's storage without interaction. It seems like there might be complications with casting a very wide net here, like a user might be logged in to different accounts on different browsers, or use some kind of custom profile that the library can't figure out, and debugging that might be a bit of a chore.
I could imagine combining it with a
webbrowser
approach, where--authenticate
wouldwebbrowser.controller
object, which I think would expose to me what the user's default ishttps://nytimes.com/login
browser-cookie3
to check thenytimes.com
specific cookies for that specific browserThat seems a little less invasive and could even be reused for other sites that require authentication. But I'm not sure if there's something I'm overlooking! Welcoming feedback here before I start trying to implement anything.
Footnotes
The
NYT-S
token is just saved in the config file for subsequent requests, so any manual approach to copy a valid token into that file will also work just as well. ↩The text was updated successfully, but these errors were encountered: