Skip to content

Add downloader for Financial Times puzzles#180

Open
afontenot wants to merge 2 commits intothisisparker:mainfrom
afontenot:financial-times
Open

Add downloader for Financial Times puzzles#180
afontenot wants to merge 2 commits intothisisparker:mainfrom
afontenot:financial-times

Conversation

@afontenot
Copy link
Copy Markdown
Contributor

This adds a downloader for the three Financial Times puzzles - the daily Cryptic, the weekly Polymath, and weekly Weekend puzzle.

This adds a new dependency on pycryptodome for AES decryption. I approached this in such a way that the dependency could easily be swapped out with a different one if preferable.

@afontenot
Copy link
Copy Markdown
Contributor Author

afontenot commented Feb 3, 2024

I just want to say it's understandable if you don't want to add this one, either because of the added dependency or the deobfuscation involved. It was no great amount of work on my part, I just set it as my Sunday project (last Sunday), and I've been testing it every day since then to make sure it worked reliably.

Hopefully FT does not syndicate their crosswords from some other, more easily scraped source. I attempted to figure out if this was the case, but didn't see any evidence of it.

@mixographer
Copy link
Copy Markdown

I tried to test this change, but I just get an error stating that the keyword is unrecognized.

Keyword ftc not recognized.

@afontenot
Copy link
Copy Markdown
Contributor Author

I tried to test this change, but I just get an error stating that the keyword is unrecognized.

Keyword ftc not recognized.

Could you provide reproduction steps? The following works for me:

git clone https://github.com/thisisparker/xword-dl
cd xword-dl
git fetch origin pull/180/head:ft
git checkout ft
python -m xword_dl ftc

@mixographer
Copy link
Copy Markdown

@afontenot you are correct, this does work for me, I was doing it wrong.

@mixographer
Copy link
Copy Markdown

This was working for me, but today it seems to fail:

File "/opt/homebrew/lib/python3.11/site-packages/xword_dl-2024.7.20-py3.11.egg/xword_dl/downloader/financialtimesdownloader.py", line 95, in <lambda> for _, clue in sorted(xword[direction].items(), key=lambda x: int(x[0])): ^^^^^^^^^ ValueError: invalid literal for int() with base 10: '21D'

@afontenot
Copy link
Copy Markdown
Contributor Author

This was working for me, but today it seems to fail:

Can confirm, I'll look at it.

@afontenot
Copy link
Copy Markdown
Contributor Author

afontenot commented Oct 18, 2024

So the issue is that there's a bogus clue, it's even in the web interface:

Screenshot_20241018_024629

The issue is that there are two 21 Down clues, and one of them is at the end with a 21D label instead of the usual clue number.

Maybe this is some hack they've put in the puzzle format to allow one clue to reference another? Edit: it's not, there are other clues with references like 11 Down. I could make the code skip invalid clues but I'm not sure if that is really reasonable here. I'm not inclined to make a change like that if this is a genuine mistake in their puzzle.

@mixographer
Copy link
Copy Markdown

Ahh. Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants