Turn NY Times crosswords into Across Lite files

Overview

NYT Crossword to Puz

Logo

A windows program to convert NY Times crosswords from the web to Across Lite compatible files.

To run this, first download and decompress the release. Then, run the executable, and answer the two questions:

Enter the NY Times crossword URL: https://www.nytimes.com/crosswords/game/daily/1994/02/14
Enter the output filename: example.puz
Loading https://www.nytimes.com/crosswords/game/daily/1994/02/14...
Created example.puz

Note: Running this script requires you're logged into nytimes.com in your browser.

Alternatively, you can pass in the URL and filename from the command line.

To run the Python script directly, clone this repo, then setup the venv to download packages:

python -m venv .venv
.venv\Scripts\activate.bat

And install the packages:

python -m pip install -r requirements.txt

Then, to use:

nyt.py https://www.nytimes.com/crosswords/game/daily/2021/08/03 2021-08-03.puz

Mini FAQ

  • What? Why?

The New York Times announced that on August 10th, they will no longer provide Across Lite .puz files for download. This tool was made in response to that decision, allowing users of that tool to continue to solve crossword puzzles in their favorite program.

  • Why not just use the NY Times app?

For me personally, I want something that works completely offline, and doesn't require I stare at my phone even more. I'm sure other people have other reasons, so I decided to put my little tool online for others to use.

  • Anything else?

Feel free to contact me on reddit.

Comments
  • Http clickthrough prevents puz gereration

    Http clickthrough prevents puz gereration

    The http version of the crossword now serves up a popup with class="xwd__modal--body xwd__start-modal" and a button to proceed with class="pz-moment__button". I believe those have to be acted upon before being able to access the puzzle information.

    At the current moment, it appears that .puz generation of NYT is broken.

    opened by deliciouslysmug 8
  • Decide how to handle HTML in clues

    Decide how to handle HTML in clues

    Today's (Oct. 10, 2021) Sunday puzzle contains clues like:

    4 Across: The universe has an estimated 10<sup>82 </sup> of them 23 Across: <i>Field of Dreams</i>

    As of now, any HTML contained in clues is passed through unchanged. How this is handled on the user side depends on the client. Black Ink doesn't process any HTML tags, and shows them verbatim to the user. downforacross.com shows the <sup> tag verbatim but applies the <i></i> tag to the rendered clue, yielding italicized text.

    How to handle this is a matter of debate. The worst solution IMHO is removing all HTML because that can render clues meaningless; see how 4 Across is handled here. It may be possible to convert certain tags to sensible Latin-1 equivalents; for example the above clue could be rendered as The universe has an estimated 10^82 of them, although whether that is clearer to the average person is debatable. Yet a final option is to leave it as-is, which seems reasonable as long as HTML doesn't appear too often in clues.

    opened by jkboyce 4
  • Windows Defender Virus Threat

    Windows Defender Virus Threat

    I assume it's a false positive, but just a heads up that the default Windows Defender settings detect a virus and deletes the .exe:

    https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?name=Trojan%3aScript%2fWacatac.B!ml&threatid=2147735503

    However, VirusTotal shows only 3 vendors flagging it.

    Probably not a lot you can do about it (I'm guessing it doesn't like scraping browser cookies?), but maybe add a note on the Readme so people aren't caught off guard?

    opened by hankscorpio83 4
  • Sunday (May 1, 2022) grid is incorrect

    Sunday (May 1, 2022) grid is incorrect

    Today's puzzle is being parsed so that the grid is incorrect, which in turn makes the grid numbering and clue placement incorrect.

    In the following grid answers, extra single black squares are being inserted (numberings are from the original NYT puzzle):

    • 28 across
    • 36 across
    • 41 across
    • 85 across
    • 96 across
    • 100 across
    • 133 across
    • 138 across

    The issue may be related to the puzzle's note: "After you've finished solving, look for an appropriate bonus phrase."

    opened by jkboyce 3
  • Handle non-Latin-1 characters properly

    Handle non-Latin-1 characters properly

    Today's (Sep. 23, 2021) puzzle has a Unicode character (em dash, Unicode '\u2014') in some of the clues, which causes puz.py to throw an exception because the character is outside of Latin-1.

    There are two ways to handle this. Method 1 is this pull request, which substitutes sensible Latin-1 alternatives for non-Latin-1 Unicode characters.

    The second method would be to output puz files in the v2 format, which supports UTF-8 encodings. The version of puzpy you're using supports this. I haven't investigated how widely-supported the v2 format is; I'll do some further research. In the meantime this pull request addresses the issue.

    opened by jkboyce 3
  • Circle markup needs to call markup.save()

    Circle markup needs to call markup.save()

    https://github.com/Q726kbXuN/nytxw_puz/blob/master/nyt.py#L308

    Puzzles with circle markups don't get output properly, markup.save() needs to get called to save the markups to the puz extension. E.g. The 2020-10-12 puzzle

    opened by tkoft 2
  • Add support for puzzle notes

    Add support for puzzle notes

    This change checks if the puzzle contains any solving notes, and adds them to the output's 'notes' field.

    Solving notes are not uncommon in themed puzzles. Example: nyt.py Chrome https://www.nytimes.com/crosswords/game/daily/2008/09/11 Sep1108.puz

    Note about notes: When the NYT was publishing in .puz format, they would often put notes into the puzzle title. For example here is their own published version of the above Sep 11, 2008 puzzle. (In the JSON version this actually contains two notes; in the published .puz file one ended up in the title and the other in the notes field.) I'm guessing they did this for compatibility in case software ignored the notes field. However the solvers I've tested (macOS Black Ink and downforacross.com) both handle notes properly so I'm disinclined to put them in the title.

    opened by jkboyce 1
  • Handle circled grid squares in puzzle

    Handle circled grid squares in puzzle

    Detects if there are any marked up (circled) squares in the puzzle and adds them to the output file.

    Recent example: nyt.py Chrome https://www.nytimes.com/crosswords/game/daily/2021/09/12 Sep1221.puz

    opened by jkboyce 1
  • Update Latin-1 conversion table

    Update Latin-1 conversion table

    Great list @Q726kbXuN that you compiled at glyph_counts.txt. Very interesting to see the frequency of unusual characters in NYT crosswords.

    I dropped your list as-is into the code, but removed:

    • Glyphs from u0000-u00ff inclusive, since these are valid Latin-1, and
    • Emojis, since the encoder's replacements like \N{WINKING FACE} are as good as anything I could come up with.

    So this is apparently every non-Latin-1, non-emoji character ever used in a NYT puzzle. A value of 'None' in the table causes the encoder to insert its own replacement. I put in conversions where I could think of something decent, but clearly this is more art than science so please feel free to edit. :)

    opened by jkboyce 1
  • Make metadata better conform to old NYT puz format

    Make metadata better conform to old NYT puz format

    Background: Because of the way we solve puzzles, I liked the way titles were done in the old NYT .puz files because they included the date and day of week in the title.

    These changes reproduce the title, author, and copyright information in the original .puz files published by NYT.

    Also, big thanks for this code! It works well and is a lifesaver.

    opened by jkboyce 1
  • Deal with 2022-05-01 'Blank Expressions' grid

    Deal with 2022-05-01 'Blank Expressions' grid

    Solution grid includes blank characters without an 'answer' dict element, but with a multi-value 'moreAnswers' array containing:

     ["NOTHING", "EMPTY", "BLANK", "X", "?", "-"]
    

    If we see 'moreAnswers' without 'answers', look for and return the first single-character entry in the array. If none, return 'X'

    Signed-off-by: Ed Santiago [email protected]

    opened by edsantiago 0
  • New endpoint handling broke HTML clue formatting?

    New endpoint handling broke HTML clue formatting?

    In the puzzle json, clues with any formatting (italics is the one I see the most) have a "formatted" field in addition to "plain" under their "text" attribute in the "clues" list.

    E.g. 21A from December 26, 2021:

    {
      "cells":[
          36,
          37,
          38,
          39,
          40,
          41
       ],
       "direction":"Across",
       "label":"21",
       "text":[
          {
             "formatted":"<i>Malice, more formally</i>",
             "plain":"Malice, more formally"
          }
       ]
    }
    

    Only the "plain" field is ever used, even though latin1ify function seems to handle HTML tags for this purpose.

    https://github.com/Q726kbXuN/nytxw_puz/commit/ac4c7a72c94c0580302b009b97c1b415da8e9ac7#diff-489afda12299c7df1e4831871e50efb4251e75dc0b31d4c662ba56f0c806ba3eR427

    opened by tkoft 2
  • Add a proper installer

    Add a proper installer

    Right now the Windows "release" is just a zip up of the output of py2exe. Really, it should be a proper installer, complete with some mechanism to make updates as painless as is possible.

    opened by Q726kbXuN 1
  • Support for a GUI version

    Support for a GUI version

    Right now the main workflow is via a console window.

    This is OK, but for the less technically inclined, this is a surprising hurdle. I'd like to see a simple GUI that can walk the user through picking a browser for the cookies, validating the URL, creating the .puz file, and as a bonus, launching it if their PC has a handler for .puz files.

    Whatever it looks like, I'm OK with the GUI being Windows only, I don't want to drop the the two CLI modes that currently exist, nor break it working on other platforms.

    opened by Q726kbXuN 0
Releases(1.10)
Owner
A person you don't know.
Given some input, spit out the possible words for a Wordle puzzle

Wordle Helper, because why not. Given some input, spit out the possible words for a Wordle puzzle First time setup # Download the dictionary to a file

Richard Duarte 1 Jan 25, 2022
An entropy-based strategy to wordle

An entropy-based strategy to wordle

Gilles Vandewiele 24 Dec 31, 2022
Email guesser - Guessing BF email based on emailGuesser by WhiteHatInspector

email_guesser Guessing BF email based on emailGuesser by WhiteHatInspector (http

4 Dec 25, 2022
uses Entropy to find the best next guess for Wordle, given the color clues

WordleSolver uses Entropy to find the best next guess for Wordle, given the color clues use player.py and enter in the string for the suggested clue w

Steve Earth 1 Jan 26, 2022
A module for use with Pygame. Includes fully customisable buttons, textboxes, sliders and many more, as well as the ability to create and run animations on these widgets.

Pygame Widgets A helper module for common widgets that may be required in developing applications with Pygame. It supports fully customisable buttons,

37 Jan 02, 2023
A full featured game of falling pieces using python's pygame library.

A full featured game of falling shapes using python's pygame library. Key Features • How To Play • Download • Contributing • License Key Features Sing

Giovani Rodriguez 7 Dec 14, 2022
An optimal solution finder for the game Wordle, written in Python

wordle-solver: a nearly-optimal computer player for Wordle Wordle is an interesting word guessing game. This program plays it very well, taking only 3

4 Jun 13, 2022
Overview: copain, your friendly AI framework to learn and play games

Overview: copain, your friendly AI framework to learn and play games Interface fceux with python and run reinforcement learning. Compatibility Current

fcharras 1 Dec 16, 2021
Netskrafl - an Icelandic crossword game website

Netskrafl - an Icelandic crossword game website English summary This repository contains the implementation of an Icelandic crossword game in the genr

Miðeind ehf 30 May 09, 2022
This is a good project to train your logic game with python language

JO-KEN-PÔ!!! | Description | basic. I make this game only to train. This is a good project to train your logic game with python language. This game is

Elianderson Silva 1 Jan 24, 2022
Mastermind-Game - A game to test programming and logical skills

Bem vindo ao jogo Mastermind! O jogo consiste em adivinhar uma senha que será ge

Marcelo Daros 0 Jan 27, 2022
This is a python implementation of wordle, which uses the same set of available words as the hit game, Wordle

Wordle Game This is a python implementation of wordle, which uses the same set of available words as the hit game, Wordle. Play the game manually pyth

Pierre Theo Klein 11 Mar 04, 2022
Utility.py - a utility that offerres cool cli tools and games.

Utilty.py Utility.py is a utility that offerres cool cli tools and games. Currently the offerd games/items are: get the number, countdown, random name

bee-micizi 1 Dec 08, 2021
An interactive pygame implementation of quadtree spatial quantization

QuadTree-py An interactive pygame implementation of quadtree spatial quantization Contents Installation Usage API Reference TODO Installation Clone th

Ethan 1 Dec 05, 2021
Description NerdQuest is a social site for creating events and/or meet ups based on games.

NerdQuest Description NerdQuest is a social site for creating events and/or meet

David Allen 1 Jul 11, 2022
Automates cubemap generation for Source Engine games.

AutoCube Automates cubemap generation for Source Engine games during compile-time. Download: see the release page Installation Using with CompilePal A

5 Feb 18, 2022
A stat tracker for the bedwars hypixel game in python

A hypixel bedwars stat tracker. Features Get stats in your current lobby Get stats in a guild Installation & Configuration git clone https://github.co

Le_Grand_Mannitout 3 Dec 25, 2021
Dontdie-minecraft - A python program that causes your computer to bluescreen whenever you die in Minecraft

Don't Die - A Python Program A python program that causes your computer to blues

3 Apr 19, 2022
This is a simple Tic Tac Toe game built with Python.

This is a simple Tic Tac Toe game built with Python.

⚝αикιт кυмαя⚝ 6 Sep 01, 2022
AI based assitant for minecarft

Minecraft_AI_assistant AI-based assistant for Minecraft There are 4 steps to build 1-I'm using collecting_data.png as a structure to take shots with c

Murat Ali Avcu 13 Oct 16, 2022