Skip to content

[BUG 🐞] Handling of missing information #4

@Bibo-Joshi

Description

@Bibo-Joshi

Hi! Nice project you have here, really like it.

Describe the bug
I tried to run it on the rss feed of a tumblr blog and noticed that currently exceptions are raised when the RSS feed doesn't provide some of the info expected by tg-rss. More precisely, for me the following lines raised exceptions:

self.feed_config.etag = raw_feed.etag
self.feed_config.modified = raw_feed.modified

Both lines raise

File "/path/to/venv/lib/python3.8/site-packages/feedparser/util.py", line 158, in __getattr__
    raise AttributeError("object has no attribute '%s'" % key)
AttributeError: object has no attribute 'etag/modified'

author=item["author"],

This raises

File "/path/to/venv/lib/python3.8/site-packages/feedparser/util.py", line 113, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'author'

When I comment the first two lines and hard-code an author, everything works fine so far.

To Reproduce
Steps to reproduce the behavior:

  1. Run tg-rss on https://popsci.tumblr.com/rss

Desktop (please complete the following information):

  • Python Version: 3.8.3
  • tg-rss Version: 0.8.1

Additional context
As a side note, it would be neat if entries with images would be send as picture/media group with a caption. currently the picture is just shown via web page preview. I see that there is some logic for handling images in the code, but it's not used in send_message

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions