-
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
Can xword-dl download NYT variety puzzles? #59
Comments
It is possible in theory (for the subset of puzzles that can be represented in .puz files) but would require a little more code — namely, some glue to map from the URL to the underlying puzzle data. As it stands, when That oracle step is necessary because there is a behind-the-scenes mapping of dates to puzzle IDs for the daily crossword, and the puzzle ID is needed to request the right JSON, but fortunately for Variety it looks like there is a more direct transformation of the URL to the underlying data (e.g., it looks like the JSON data for the puzzle you were seeking is at https://www.nytimes.com/svc/crosswords/v6/puzzle/variety/2022-10-02.json). I haven't looked to see if that file is structured the same as the daily crossword JSON, which would determine whether you could use the existing parsing function. So! It would require a little more code and I think I'd probably want to structure it as a subclass of the existing |
Thank you for explaining!
Looking further, I see that this particular JSON (for a puns and anagrams puzzle, which theoretically could be represented as a Would you be willing to take on this additional work, beyond the simple glue to translate the date to the JSON URL? I don't want to burden you with a much larger feature request. For more background: I am interested in puns and anagrams and cryptic crossword downloads for https://github.com/eigenfoo/cryptics (both puzzle types can be represented as |
I think the answer is "possibly," although if you wrote the parsing code first I'd probably be just as happy to incorporate it. The longer answer is there's a big refactor that I've been meaning to do on |
Just a heads up: I recently completed the refactor described above and I think I will get a chance to add NYT Variety support this week. |
Closed in v2022.11.16 🎉 |
(I've manually edited my
xword-dl.yaml
to circumvent #58)I've determined that this is likely because
NewYorkTimesDownloader
isn't insupported_sites
:xword-dl/xword_dl.py
Lines 76 to 78 in bbb4877
However, adding
('nytimes.com', NewYorkTimesDownloader)
to the list produces a JSON error, which I don't think I'm well-equipped to make sense of:The text was updated successfully, but these errors were encountered: