thisisparker / xword-dl

⬛⬜⬛ Command line tool to scrape crosswords from online solvers and save them as .puz files ⬛⬜⬛
MIT License
139 stars 30 forks source link

Can't download 7/17/22 NYT puzzle #171

Closed clorgie closed 5 months ago

clorgie commented 5 months ago

This looks like a different issue than the one I just posted. I'm unable to download the 7/17/22 puzzle. Error:

$ xword-dl nyt -d 7/17/2022                                                                                      [17:25:13]
Traceback (most recent call last):
  File "/Users/chris/Library/CloudStorage/Dropbox/crosswords/xword-dl-env/bin/xword-dl", line 33, in <module>
    sys.exit(load_entry_point('xword-dl==2023.12.2', 'console_scripts', 'xword-dl')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Library/CloudStorage/Dropbox/crosswords/xword-dl-env/lib/python3.11/site-packages/xword_dl-2023.12.2-py3.11.egg/xword_dl/xword_dl.py", line 233, in main
    puzzle, filename = by_keyword(args.source, **options)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Library/CloudStorage/Dropbox/crosswords/xword-dl-env/lib/python3.11/site-packages/xword_dl-2023.12.2-py3.11.egg/xword_dl/xword_dl.py", line 45, in by_keyword
    puzzle = dl.download(puzzle_url)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Library/CloudStorage/Dropbox/crosswords/xword-dl-env/lib/python3.11/site-packages/xword_dl-2023.12.2-py3.11.egg/xword_dl/downloader/basedownloader.py", line 96, in download
    puzzle = self.parse_xword(xword_data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/Library/CloudStorage/Dropbox/crosswords/xword-dl-env/lib/python3.11/site-packages/xword_dl-2023.12.2-py3.11.egg/xword_dl/downloader/newyorktimesdownloader.py", line 165, in parse_xword
    puzzle.extensions[b'RTBL'] = rebus_table.encode(puz.ENCODING)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2663' in position 4: ordinal not in range(256)
(xword-dl-env) FAIL

TIA! As I am cleaning up my archive I may come across more of these...do you want me to report them if I do? And, if so, do you prefer individual reports or just a list?

thisisparker commented 5 months ago

I think exactly what you're doing in terms of reports is great. The issues should both be fixed, if you're able to install from the repo—and of course it's most useful to me if you're using that very latest version so I know if there's still an issue if you've got more to report!