thp / urlwatch

Watch (parts of) webpages and get notified when something changes via e-mail, on your phone or via other means. Highly configurable.
https://thp.io/2008/urlwatch/
Other
2.82k stars 351 forks source link

urlwatch stopped working #796

Closed mortenivar closed 7 months ago

mortenivar commented 7 months ago

I am using Arch Gnu/Linux packages in the following versions:

I believe this happened after an upgrade of python:

~/ % urlwatch
Traceback (most recent call last):
  File "/bin/urlwatch", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/urlwatch/cli.py", line 105, in main
    urlwatch = Urlwatch(command_config, config_storage, cache_storage, urls_storage)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urlwatch/main.py", line 66, in __init__
    self.load_jobs()
  File "/usr/lib/python3.11/site-packages/urlwatch/main.py", line 85, in load_jobs
    jobs = self.urls_storage.load_secure()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urlwatch/storage.py", line 325, in load_secure
    jobs = self.load()
           ^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urlwatch/storage.py", line 427, in load
    return self._parse(fp)
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urlwatch/storage.py", line 394, in _parse
    jobs = [JobBase.unserialize(job) for job in yaml.load_all(fp, Loader=yaml.SafeLoader)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urlwatch/storage.py", line 394, in <listcomp>
    jobs = [JobBase.unserialize(job) for job in yaml.load_all(fp, Loader=yaml.SafeLoader)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urlwatch/jobs.py", line 140, in unserialize
    raise ValueError('Kind is not specified, and no job matches: %r' % (data,))
ValueError: Kind is not specified, and no job matches: {'filter': [{'xpath': '//section[@role="main"]'}, {'html2text': {'method': 'pyhtml2text', 'unicode_snob': True, 'body_width': 0, 'inline_links': False, 'ignore_links': True, 'ignore_images': True, 'pad_tables': False, 'single_line_break': True}}]}
Jamstah commented 7 months ago

Do you know which of those packages were upgraded and what the old versions were?

Jamstah commented 7 months ago

Also, are you willing to share your urls yaml?

thp commented 7 months ago

One job in your jobs.yaml doesn't have any URL, the error message suggests it's this job:

filter:
- xpath: //section[@role="main"]
- html2text:
    body_width: 0
    ignore_images: true
    ignore_links: true
    inline_links: false
    method: pyhtml2text
    pad_tables: false
    single_line_break: true
    unicode_snob: true

This is also what the error message says:

Kind is not specified, and no job matches

mortenivar commented 7 months ago

@thp, that is exactly right. Sorry, you may close this. Thanks for the program!