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.
A menu for pygame. Simple, and easy to use

pygame-menu Source repo on GitHub, and run it on Repl.it Introduction Pygame-menu is a python-pygame library for creating menus and GUIs. It supports

Pablo Pizarro R. 411 Dec 27, 2022
SpiderArcadeGame - A game where the player controls a little spider who is trying to protect herself from other invasive bugs

SpiderArcadeGame - A game where the player controls a little spider who is trying to protect herself from other invasive bugs

Matheus Farias de Oliveira Matsumoto 1 Mar 17, 2022
Scalable computer implemented in the game of life.

scalable-gol-computer This is a computer built in Conway’s game of life. It supports variable sizes of 8, 16 and 32 bit. Maximum program size: 256 lin

Nicolas Loizeau 19 Nov 19, 2022
Simple Game created using Python & PyGame, as my Beginner Python Project!

Space Invaders This is a simple SPACE INVADER game create using PYGAME whihc have sound and lot's of keyboard functions. Prerequisites More Experience

Gaurav Pandey 2 Jan 08, 2022
AI Games and its programming solution with Python.

Problem: Save the princess: Problem defination on Hackerrank: https://www.hackerrank.com/challenges/saveprincess About problem: Princess Peach is trap

Hasit Parmar 1 Feb 19, 2022
TetrisAI - Tetris AI Bot using computer vision to play game automatically

Tetris AI Tetris AI Bot using computer vision to play game automatically bot.py

11 Aug 29, 2022
BUBBLE SHOOT - Pygame (python)

BUBBLE-SHOOT---Pygame BUBBLE SHOOT - Pygame (python) Bubbleshooter This is a Bubble shooter Game made with pygame. The arrow is controlled by the arro

ROBIN JONEY 1 Nov 12, 2021
This is a python interactive story game that I made to show off what I've learnt in python coding for a month

Purpose The files in this repository are for that of a story game created with python version 3.8.5 The purpose of this project was to get familiar wi

0 Dec 30, 2021
A small, Pygame-based library project intended for personal use.

EzyGame Version 0.0.1 A simple library project intended for personal use with Pygame. Warning: I am a very amateur programmer, so the code will probab

Dorbell 1 Jan 08, 2022
Aftermath is an anti token grabber written in Python3.

🎈 Aftermath 🎈 Aftermath is an anti token grabber written in Python3. This tool with a GUI setup is checking the Downloads folder to search for token

Billy 39 Dec 16, 2022
The main objective of the game is to destroy multiple waves of asteroids with the help of a blaster mounted on the spaceship.

Astronomia: let the exploration begin The main objective of the game is to destroy multiple waves of asteroids with the help of a blaster mounted on t

Aryan Nath 8 Nov 18, 2022
The repository that hosts the code that teaches a reinforcement learning - based bot to play 2048

The repository that hosts the code that teaches a reinforcement learning - based bot (based on policy gradients method) to play 2048

Maxim Rud 1 Dec 16, 2021
A small fun project to simulate Conway's Game of Life, created in Python.

A small fun project to simulate Conway's Game of Life, created in Python. Conway's Game of Life simulates a grid of cells, where the state of each cell consists of whether the cell is alive or dead.

Harrison Verrios 1 Jun 19, 2022
🥕Try and keep da carrot alive or else . . .

Carrot 🥕 Warning 💥 : I am not a botanist. I do not study carrots or plant life. I am a noob programmer :P. So don't belive anything you see in this

1 Jan 03, 2022
Jiminy, fast and portable Python/C++ simulator of poly-articulated systems with OpenAI Gym interface for reinforcement learning.

Jiminy is a fast and portable cross-platform open-source simulator for poly-articulated systems. It was built with two ideas in mind: provide a fast y

Alexis DUBURCQ 122 Dec 29, 2022
A python project to help you solve the Wordle game.

A python project to help you solve the Wordle game.

Jia Ping Chu 2 Feb 06, 2022
A solution program of 24. game.

A solution program of 24. game.

1 Dec 12, 2022
A first-person shooting game developed by using OpenGL

OpenGL-MazeSurvivor-FirstPerson Shooting Game This application named ‘MAZE SURVIVOR’ is a first-person shooting game that finished within a month. It

JunHong 2 Jan 04, 2023
A Simple Scissor Paper Rock Game On Python Using Pygame.

Scissor Paper Stone Game Using Pygame This is a simple GUI based game made on pygame python. Installation Run code on your machine: git clone https:

Dipin Adhikari 0 Mar 21, 2022
The Bowling Club (Facebook Game) get all strikes.

TheBowlingClubBot The Bowling Club (Facebook Game) get all strikes. FAQ Q: What is this? A: TheBowlingClubBot is a automation bot with 99.99% guarante

#~Rith 1 Jan 19, 2022