thisisparker / xword-dl

⬛⬜⬛ Command line tool to scrape crosswords from online solvers and save them as .puz files ⬛⬜⬛
MIT License
145 stars 31 forks source link

New York Times changed puzzle format? #55

Closed mixographer closed 1 year ago

mixographer commented 2 years ago

I can't seem to get the Times puzzle starting today.

I get this: `Traceback (most recent call last): File "./xword_dl.py", line 1153, in main() File "./xword_dl.py", line 1142, in main puzzle, filename = by_keyword(args.source, **options) File "./xword_dl.py", line 65, in by_keyword puzzle = dl.download(puzzle_url) File "./xword_dl.py", line 267, in download puzzle = self.parse_xword(xword_data) File "./xword_dl.py", line 989, in parse_xword puzzle_data = xword_data['puzzle_data'] KeyError: 'puzzle_data'

and if I go for a certain date:

$ ./xword_dl.py https://www.nytimes.com/crosswords/game/daily/2022/10/02

Unable to find a puzzle at https://www.nytimes.com/crosswords/game/daily/2022/10/02.

`

thisisparker commented 2 years ago

These are two separate issues but fortunately both resolvable. (I ran into the first one myself!)

I think the problem is that your NYT-S token has expired or been rotated or something. There's a convoluted reason why the error message xword-dl gives on this is so bad, and I will fix it soon. If you re-authorize, or copy the value of your browser's NYT-S token into your config file, it should work again.

Separately, I haven't built search-by-URL into NYT downloads yet, but I may do that in the future. So it's "expected" that the URL search won't work, at least for now.

mixographer commented 1 year ago

This was the correct answer! My token had expired. I should have tried this first. Thank you.