Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'published_parsed' #2

Open
casens5 opened this issue Jan 24, 2021 · 1 comment
Open

KeyError: 'published_parsed' #2

casens5 opened this issue Jan 24, 2021 · 1 comment

Comments

@casens5
Copy link

casens5 commented Jan 24, 2021

	Adding posts... Traceback (most recent call last):
		File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
			return _run_code(code, main_globals, None,
		File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
			exec(code, run_globals)
		File "/home/mapa/code/pocketrss/__main__.py", line 4, in <module>
			main()
		File "/home/mapa/code/pocketrss/main.py", line 22, in main
			for item in get_new_items():
		File "/home/mapa/code/pocketrss/feeds.py", line 24, in get_new_items
			post_time = int(mktime(post['published_parsed']))
		File "/usr/lib/python3/dist-packages/feedparser.py", line 364, in __getitem__
			return dict.__getitem__(self, key)
	KeyError: 'published_parsed'`

running Lubuntu 20.04
python 3.8.5

i've thought maybe one of the feeds was malformatted, but i checked all my feeds with liferea, and they're all working.

@jarhill0
Copy link
Owner

Hi,

I am not actively developing this project (nor am I actively using it, as I personally stopped using Pocket over two years ago). It's possible that at some point I will pick it up again (especially if I start using Pocket again), but at the moment it isn't a priority of mine.

The upshot of that is that I don't intend to spend the time to fix this issue. If you are able to fix it and you submit a pull request, I am more than happy to review and merge.

The traceback points to this line:

post_time = int(mktime(post['published_parsed']))

It looks like I'm assuming that all feeds will have this published_parsed attribute (or perhaps that's a parsed version of a published attribute from the RSS feed). You could modify the logic to handle not having a published time at all, though I'm not sure exactly what that would look like, as the program uses that timestamp to determine which items it's already fetched.

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

No branches or pull requests

2 participants