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.
Trio Assembly Snakemake Workflow

Trio Assembly Snakemake Workflow Input HiFi reads for child in bam format Either

Juniper A. Lake 1 Jan 28, 2022
BitBot - A simple shooter game

BitBot BitBot - A simple shooter game This project can be discontinued anytime I want, as it is not a "MAJOR" project for me. Which Game Engine does i

whmsft 1 Jan 04, 2022
Software Design | Spring 2020 | Classic Arcade Game

Breakout Software Design Final Project, Spring 2020 Team members: Izumi, Lilo For our Interactive Visualization, we implemented the classic arcade gam

Lilo Heinrich 1 Jul 26, 2022
Rock Paper Scissors Game with PyQt5

Rock-Paper-Scissors-Game rock paper scissors is a old game that all of us played it but this time let's play with computer Description This is Rock Pa

MohammadAli.HBA 4 Nov 11, 2021
WordleHelper suggests words to help players better enjoy the hit game Wordle

WordleHelper Introduction WordleHelper suggests words to help players better enjoy the hit game Wordle. Both the general mode and the hard mode are su

Shao-Yu, Chu 5 Jun 02, 2022
Automatic game data translator for RPGMaker-MV

RPGMaker-MV Translator 🕹️ 🎮 Use AI to translate all the dialogs and texts of your RPGMaker automatically. 👊 You worked hard to make your game, now

Davide Liu 11 Dec 26, 2022
A car learns to drive in a small 2D environment using the NEAT-Algorithm with Pygame

Self-driving-car-with-Pygame A car learns to drive in a small 2D environment using the NEAT-Algorithm with Pygame Description A car has 5 sensors ("ey

Henri 3 Feb 01, 2022
Tic Tac Toe Python Game GUI

Tic Tac Toe is one of the most played games and is the best time killer game that you can play anywhere with just a pen and paper.

Astitva Veer Garg 1 Jan 11, 2022
Generates and prints proxies for the card game Magic: the Gathering

MTG-Proxy-Generator This program generates proxies for the card game Magic: the Gathering. These proxies can then be printed off and used. These copie

Carl L. 1 Jan 31, 2022
Python Knots and Crosses game, with customizable markers and more!

Knot-and-Crosses Python Knots and Crosses game, with customizable markers and more! Features: Ability to change your marker Ability to change how many

4 Nov 07, 2021
A top-down arcade space shooter made in pygame.

About: Journey Through Space is a top-down arcade shooter made in pygame. You play as a pilot who was left behind after a battle and the goal is to go

Crimson Sane 0 Jan 01, 2022
Are you obsessed with playing the increasingly-popular word game Wordle?

WORDLE-VISION Up your Wordle game! Are you obsessed with playing the increasingly-popular word game Wordle? Ever wondered what the optimal first word

Ravi Gupta 5 May 10, 2022
Creates a landscape with more accurate river generation in Minecraft version 1.12 using python.

MinecraftLandRiverGen View the following youtube video to set up a world that can interact with the python programs

23 Dec 25, 2022
Text-Adventure-Game [Open Source] A group project by the Python TASK Force

Text-Adventure-Game [Open Source] A group project by the Python TASK Force

Mircea Dumitrescu 2 Sep 17, 2021
Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI.

Ultimaze Ultimaze est un jeu en 2.5D, réalisé dans le cadre d'un projet de NSI. La consigne était d'utiliser la librairie pygame pour créer un jeu en

parlabarbedeMerlin 3 Sep 17, 2022
Launch any Heroic-Games-Launcher game using bash scripts without having to open Heroic.

HeroicBashLauncher Ever wanted to launch your EGS games installed through Heroic Games Launcher directly from the terminal, Lutris or any other fronte

288 Dec 27, 2022
Arcade-like space shooter game written entirely in python

E.T.-Attack Arcade-like space shooter game written entirely in python Project description A space shooter game - inspired by the legendary game Space

Sven Eschlbeck 2 Dec 17, 2022
A Tetris Game for programming education

Tetris Game プログラミング学習を目的とした、ブロックを操作してスコアを競うゲームです。 FAQはこちら。 tutorialはこちら。 実行環境準備 Mac環境 Finder→Application→Utility→Terminalから、ターミナルを起動して以下コマンドを実行する。 # i

11 Dec 01, 2022
An environment to run atari-like games in VGDL.

vgdl An environment to run atari-like games in VGDL. Requirements python = 3.6 Installation pip install -r requirements.txt Usage # Create an enviro

Sergio Arnaud Gomez 1 Dec 24, 2021
a simple keyboard game

Maxwell-Demon-Game Powered by Taichi. a simple keyboard game This is hw2 of Taichi course, as a basic exercise of class. Rigid 2d bodies and resolve c

8 Feb 01, 2022