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

Unable to download The Guardian Daily Quick crossword #190

Closed yang-musa closed 3 weeks ago

yang-musa commented 1 month ago

System: Fedora 40 Gnome, up to date as of today (May 31, 2024). Crosswords 0.3.13.2 installed via Flatpak.

Error: For the past week, clicking to download The Guardian Daily Quick crossword gives the error "Problem downloading puzzle. Unable to download a puzzle from "The Guardian Daily Quick Crossword"

Expected behavior: Crossword should download like it used to.

I ran flatpak run org.gnome.Crosswords in the terminal and got the following:

Traceback (most recent call last):
  File "/app/extensions/xword-dl/bin/xword-dl.orig", line 33, in <module>
    sys.exit(load_entry_point('xword-dl==2023.12.2', 'console_scripts', 'xword-dl')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/extensions/xword-dl/lib/python3.11/site-packages/xword_dl-2023.12.2-py3.11.egg/xword_dl/xword_dl.py", line 257, in main
    puzzle, filename = by_keyword(args.source, **options)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/extensions/xword-dl/lib/python3.11/site-packages/xword_dl-2023.12.2-py3.11.egg/xword_dl/xword_dl.py", line 37, in by_keyword
    puzzle_url = dl.find_latest()
                 ^^^^^^^^^^^^^^^^
  File "/app/extensions/xword-dl/lib/python3.11/site-packages/xword_dl-2023.12.2-py3.11.egg/xword_dl/downloader/guardiandownloader.py", line 25, in find_latest
    url = soup.find('a', attrs={'data-link-name': 'article'}).get('href')
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Hope that's helpful in tracing the error. Let me know if any additional information is needed.

(I originally filed this with the Crosswords app, but they believe the error lies in the xwords component).

mixographer commented 1 month ago

Today I also see that all the Guardian puzzles fail in a similar fashion.

mixographer commented 1 month ago

It seems to be in the finding of the latest link. That has changed, but the download by URL still works.

thisisparker commented 1 month ago

Oh good, that should be more easily fixable. I've got a backlog of xword-dl work right now but I'm hoping to find a few hours this week to fix this and a few other outstanding issues and cut a new release!

Thanks for reporting, @yang-musa!

mixographer commented 1 month ago

I tried to fix it, but I need to figure out Beautiful Soup again....