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 python snake game based on pygame.

PySnake A python snake game based on pygame. Requirements Package version pygame = 2.1.2 opencv-python = 4.5.1.48 Run Windows python main.py Linux &

2 Jan 31, 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
Flappy bird using Pygames

flappy-bird Esse é um jogo que eu fiz utilizando a biblioteca de jogos do Python

Leandro Henrique 2 Jan 05, 2022
Repository with console python implementation of Simple Artificial Life (simplified MAS) and Conway's game of life

artificial-life-game Repository with console python implementation of Simple Artificial Life (simplified MAS) and Conway's game of life Installation c

Vladislav 6 Nov 14, 2022
FlappyBird game with python and pygame

FlappyBird game with python and pygame

Mohammad Dori 4 Jul 15, 2022
Turn NY Times crosswords into Across Lite files

NYT Crossword to Puz A windows program to convert NY Times crosswords from the web to Across Lite compatible files. To run this, first download and de

31 Oct 11, 2022
Quiz Game: answering questions naturally with a friendly UI to enjoy the game

About Quiz Game : The Game is about answering questions naturally with a friendl

4 Jan 19, 2022
Fully functional BlackJack game with a graphical user interface.

BlackJack Welcome to BlackJack! This game is fully functional, with a casino sound package integrated using Pygame, dynamic game logic developed using

Shwetang Desai 2 Jan 10, 2022
AWBW Replay Parser - a Python package to open and step through AWBW game replays.

AWBW Replay Parser This repository is home to the AWBW Replay Parser, a Python package to open and step through AWBW game replays. This project is una

Tarkan Al-Kazily 2 Feb 09, 2022
🐥Flappy Birds🐤 Video game. With your help I can go through🚀 the pipes. All UI is made with 🐍Pygame🐍

🐠 Flappy Fish 🐢 I am Flappy Fish 🐟 . With your help I can jump through the pipes and experience an interesting and exciting flight deep into the fi

MohammadReza 2 Jan 14, 2022
Automatically prepare your Minecraft maps for release

map-prepare Automatically prepare Mineraft map for release. Current state: kinda works Make sure you have backups for your world before running this p

11 Oct 11, 2022
CTF (Capture The Flag) started from DEFCON CTF, a competitive game among computer security enthusiasts

CTF Wiki 中文 English Welcome to CTF Wiki! CTF (Capture The Flag) started from DEFCON CTF, a competitive game among computer security enthusiasts, origi

CTF Wiki 6.4k Jan 03, 2023
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
Frets on Fire X: a fork of Frets on Fire with many added features and capabilities

Frets on Fire X - FoFiX This is Frets on Fire X, a highly customizable rhythm game supporting many modes of guitar, bass, drum, and vocal gameplay for

FoFiX 377 Jan 02, 2023
PYGA: Python Google Analytics (ga.js) - Data Collection API

PYGA: Python Google Analytics - Data Collection API pyga is an implementation of Google Analytics (ga.js) in Python; so that it can be used at server

Arun Karunagath 136 Sep 19, 2022
Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5

♟️ Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5. 💿 Dependencies This program uses Py

6 May 26, 2022
Editor for Bioware's Original Neverwinter Nights Game

neveredit This is an import of an old sourceforge project. Neveredit is an editor for Bioware's Neverwinter Nights game. It also includes all the low

Peter Gorniak 2 Apr 12, 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
PyCraft - A Minecraft launcher made in python

A Minecraft launcher made in python. The main objective of this launcher is to enable players to enjoy minecraft (especially those without a mojang/microsoft account). This launcher is not illegal as

38 Dec 12, 2022
Hagia is a 2D game engine and toolset for Python.

HAGIA What is Hagia? Hagia is a 2D game engine and toolset for Python. Hagia has

star 3 Jun 01, 2022