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.
null
python script to convert .OBJ files into Minecraft, rendering them in game with a core shader.

samples: random notes about the tool general output format: (animation not supported yet but planned) vertex id Minecraft's gl_VertexID isn't per mode

null 199 Jan 2, 2023
A fully automated system that transforms Twitch clips into gaming compilations

A fully automated system that transforms Twitch clips into gaming compilations Authors: Christian C., Moritz M., Luca S. Related Projects: Neural Netw

null 215 Dec 27, 2022
Inject custom C++ code into GameMaker Studio 2 YYC builds

YYC Boost Inject custom C++ code into GameMaker Studio 2 YYC builds! WARNING: This tool is currently in an early stage of development and it is not gu

Patrik Kraif 7 Dec 30, 2022
HTTP API for FGO game data. Transform the raw game data into something a bit more manageable.

FGO game data API HTTP API for FGO game data. Transform the raw game data into something a bit more manageable. View the API documentation here: https

Atlas Academy 51 Dec 26, 2022
Minecraft-Bedrock-Modpack-Maker - Simple tool to combine multiple addons into one. Not finished

Minecraft-Bedrock-Modpack-Maker Simple tool to combine multiple addons into one. Not finished! Any contributing is welcome. How to use: Move all .mcpa

MivianCoin 1 Jan 6, 2022
A converter for the .BMR / .RLE bitmap files used in some Neversoft PS1 games.

Requirements python3 pyqt5 - can be installed with pip install PyQt5 pypng - Included Usage Instructions This program can be running py main.py in the

null 4 Jul 30, 2022
A program to read, edit, and write save files for the game Railroads! Online

RROSE - v0.3.6 This program is intended to be used as an external tool to Railroads Online server hosts. It will read save files, allow to modify entr

null 17 Dec 9, 2022
Editing tool (read/write) .sc files (*_tes.sc , *.sc, *_dl.sc ) from Supercell games (Brawl Stars, Clash Royale, Clash of Clans and others).

SupercellSWF Version 0.1.0.2 About Editing tool (read/write) .sc files (*_tes.sc , *.sc, *_dl.sc ) from Supercell games (Brawl Stars, Clash Royale, Cl

Fred31 11 Jun 23, 2022
To be easier to create backup files for the game StoneShard

StoneShard_save_backup_tool A tool to create backups and load them. Setup Configure the program by opening the "config.json" file. In this file you wi

Lucas V. Moog Brentano 6 Sep 15, 2022
Python library for serializing any arbitrary object graph into JSON. It can take almost any Python object and turn the object into JSON. Additionally, it can reconstitute the object back into Python.

jsonpickle jsonpickle is a library for the two-way conversion of complex Python objects and JSON. jsonpickle builds upon the existing JSON encoders, s

null 1.1k Jan 2, 2023
KSAI Lite is a deep learning inference framework of kingsoft, based on tensorflow lite

KSAI Lite is a deep learning inference framework of kingsoft, based on tensorflow lite

null 80 Dec 27, 2022
Lite - Lite cracker tool for python

Wellcome to tools Results Install Tools

Jeeck X Nano 23 Dec 17, 2022
Here I plotted data for the average test scores across schools and class sizes across school districts.

HW_02 Here I plotted data for the average test scores across schools and class sizes across school districts. Average Test Score by Race This graph re

null 7 Oct 27, 2021
Turn your Python and Javascript code into DOT flowcharts

Notes from 2017 This is an older project which I am no longer working on. It was built before ES6 existed and before Python 3 had much usage. While it

Scott Rogowski 3k Jan 9, 2023
Turn (almost) any Python command line program into a full GUI application with one line

Gooey Turn (almost) any Python 2 or 3 Console Program into a GUI application with one line Support this project Table of Contents Gooey Table of conte

Chris 17k Jan 9, 2023
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.

Prism is a set of packages for API mocking and contract testing with OpenAPI v2 (formerly known as Swagger) and OpenAPI v3.x. Mock Servers: Life-like

Stoplight 3.3k Jan 5, 2023
python app to turn a photograph into a cartoon

Draw This. Draw This is a polaroid camera that draws cartoons. You point, and shoot - and out pops a cartoon; the camera's best interpretation of what

Dan Macnish 2k Dec 19, 2022
Turn a STAC catalog into a dask-based xarray

StackSTAC Turn a list of STAC items into a 4D xarray DataArray (dims: time, band, y, x), including reprojection to a common grid. The array is a lazy

Gabe Joseph 148 Dec 19, 2022
Turn images of tables into CSV data. Detect tables from images and run OCR on the cells.

Table of Contents Overview Requirements Demo Modules Overview This python package contains modules to help with finding and extracting tabular data fr

Eric Ihli 311 Dec 24, 2022
The Doodle Master seeks to turn your UI mockups into real code.

Doodle Master The Doodle Master seeks to turn your UI mockups into real code. Currently this repository just serves to demonstrate a Proof Of Concept

Karanbir Chahal 2.4k Dec 9, 2022