Fallback if tag (like description) is missing #59

Closed
opened 2025-11-17 07:18:45 +00:00 by Sebastian_Berlin · 7 comments
Sebastian_Berlin commented 2025-11-17 07:18:45 +00:00 (Migrated from codeberg.org)

I tested out an feed, which doesn't contain the <description> tag for my {content_plaintext} in the bot_post_template.

After starting feed2fedi a lot of errors appear and no posts were published, even tough other tags (title, url etc.) were available.

Regardless of whether that failed feed structure makes sense at all, it shows me that there should be a fallback. Maybe a simple "skip the tag if tag x is missing" would be sufficient to avoid a crash of the script.

I tested out an feed, which doesn't contain the `<description>` tag for my `{content_plaintext}` in the `bot_post_template`. After starting `feed2fedi` a lot of errors appear and no posts were published, even tough other tags (_title_, _url_ etc.) were available. Regardless of whether that failed feed structure makes sense at all, it shows me that there should be a fallback. Maybe a simple "skip the tag if tag x is missing" would be sufficient to avoid a crash of the script.
marvin8 commented 2025-11-17 08:53:57 +00:00 (Migrated from codeberg.org)

Are you able to share the feed url?
Also please share some of the errors. That might speed up addressing this situation if applicable.

Are you able to share the feed url? Also please share some of the errors. That might speed up addressing this situation if applicable.
Sebastian_Berlin commented 2025-11-17 15:46:09 +00:00 (Migrated from codeberg.org)

Example for feed.xml (not exactly similar to the output):

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom"  xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>TITLE</title>
		<description>DESCRIPTION</description>
		<pubDate>Sun, 17 Nov 2025 14:57:13 +0000</pubDate>
		<link>https://xyz.com/news.xml</link>
		<atom:link href="https://xyz.com/news.rss" rel="self" type="application/rss+xml" />

		<item>
			<title>TITLE 1</title>
			<link>https://xyz.com/article1.html</link>
			<dc:creator>AUTHOR</dc:creator>
			<pubDate>Sun, 17 Nov 2025 14:57:13 +0000</pubDate>
			<guid isPermaLink="false">https://xyz.com/article1.html</guid>
		</item>
		<item>
			<title>TITLE 2</title>
			<link>https://xyz.com/article2.html</link>
			<dc:creator>AUTHOR</dc:creator>
			<pubDate>Sun, 17 Nov 2025 11:00:00 +0000</pubDate>
			<guid isPermaLink="false">https://xyz.com/article1.html</guid>
		</item>

	</channel>
</rss>

Error by feed2fedi → output (shortened and anonymized):

╭──────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:128 in start_main_shim                                                                                                                                    │
│                                                                                                                                                                                                                                           │
│   125 │   ] = None,                                                                            ╭──────────────────────── locals ─────────────────────────╮                                                                                │
│   126 ) -> None:                                                                               │ config_file = PosixPath('/root/.local/bin/config.json') │                                                                                │
│   127 │   """Start Feed2Fedi."""                                                               │  post_limit = None                                      │                                                                                │
│ ❱ 128 │   result = asyncio.run(main(config_file=config_file, post_limit=post_limit))           ╰─────────────────────────────────────────────────────────╯                                                                                │
│   129 │                                                                                                                                                                                                                                   │
│   130 │   if not result:                                                                                                                                                                                                                  │
│   131 │   │   typer.Abort()                                                                                                                                                                                                               │
│                                                                                                                                                                                                                                           │
│ /usr/lib/python3.12/asyncio/runners.py:194 in run                                                                                                                                                                                         │
│                                                                                                                                                                                                                                           │
│   191 │   │   │   "asyncio.run() cannot be called from a running event loop")                  ╭───────────────────────────── locals ─────────────────────────────╮                                                                       │
│   192 │                                                                                        │        debug = None                                              │                                                                       │
│   193 │   with Runner(debug=debug, loop_factory=loop_factory) as runner:                       │ loop_factory = None                                              │                                                                       │
│ ❱ 194 │   │   return runner.run(main)                                                          │         main = <coroutine object main at 0x7a1aa3540720>         │                                                                       │
│   195                                                                                          │       runner = <asyncio.runners.Runner object at 0x7a1aa1d632c0> │                                                                       │
│   196                                                                                          ╰──────────────────────────────────────────────────────────────────╯                                                                       │
│   197 def _cancel_all_tasks(loop):                                                                                                                                                                                                        │
│                                                                                                                                                                                                                                           │
│ /usr/lib/python3.12/asyncio/runners.py:118 in run                                                                                                                                                                                         │
│                                                                                                                                                                                                                                           │
│   115 │   │                                                                                                                                                                                                                               │
│   116 │   │   self._interrupt_count = 0                                                                                                                                                                                                   │
│   117 │   │   try:                                                                                                                                                                                                                        │
│ ❱ 118 │   │   │   return self._loop.run_until_complete(task)                                                                                                                                                                              │
│   119 │   │   except exceptions.CancelledError:                                                                                                                                                                                           │
│   120 │   │   │   if self._interrupt_count > 0:                                                                                                                                                                                           │
│   121 │   │   │   │   uncancel = getattr(task, "uncancel", None)                                                                                                                                                                          │
│                                                                                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │        context = <_contextvars.Context object at 0x7a1aa1121280>                                                                                                                                                                      │ │
│ │           coro = <coroutine object main at 0x7a1aa3540720>                                                                                                                                                                            │ │
│ │           self = <asyncio.runners.Runner object at 0x7a1aa1d632c0>                                                                                                                                                                    │ │
│ │ sigint_handler = functools.partial(<bound method Runner._on_sigint of <asyncio.runners.Runner object at 0x7a1aa1d632c0>>, main_task=<Task finished name='Task-1' coro=<main() done, defined at                                        │ │
│ │                  /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:21> exception=KeyError('content_plaintext')>)                                                                                        │ │
│ │           task = <Task finished name='Task-1' coro=<main() done, defined at /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:21> exception=KeyError('content_plaintext')>                              │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                                                                                           │
│ /usr/lib/python3.12/asyncio/base_events.py:687 in run_until_complete                                                                                                                                                                      │
│                                                                                                                                                                                                                                           │
│    684 │   │   if not future.done():                                                                                                                                                                                                      │
│    685 │   │   │   raise RuntimeError('Event loop stopped before Future completed.')                                                                                                                                                      │
│    686 │   │                                                                                                                                                                                                                              │
│ ❱  687 │   │   return future.result()                                                                                                                                                                                                     │
│    688 │                                                                                                                                                                                                                                  │
│    689 │   def stop(self):                                                                                                                                                                                                                │
│    690 │   │   """Stop running the event loop.                                                                                                                                                                                            │
│                                                                                                                                                                                                                                           │
│ ╭────────────────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────────────╮                                    │
│ │   future = <Task finished name='Task-1' coro=<main() done, defined at /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:21> exception=KeyError('content_plaintext')> │                                    │
│ │ new_task = False                                                                                                                                                                                   │                                    │
│ │     self = <_UnixSelectorEventLoop running=False closed=True debug=False>                                                                                                                          │                                    │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                    │
│                                                                                                                                                                                                                                           │
│ /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:59 in main                                                                                                                                                │

│    56 │   │   │   items = FeedReader(feed=feed.url).items                                                                                                                                                                                 │
│    57 │   │   │                                                                                                                                                                                                                           │
│    58 │   │   │   try:                                                                                                                                                                                                                    │
│ ❱  59 │   │   │   │   statuses_posted += await fediverse.publish(                                                                                                                                                                         │
│    60 │   │   │   │   │   items=items,                                                                                                                                                                                                    │
│    61 │   │   │   │   │   feed=feed,                                                                                                                                                                                                      │
│    62 │   │   │   │   │   post_limit=post_limit,                                                                                                                                                                                          │
│                                                                                                                                                                                                                                           │
│ ╭──────────────────────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────────────────────╮                                       │
│ │            client = <httpx.AsyncClient object at 0x7a1aa180ae40>                                                                                                                                │                                       │
│ │            config = Configuration(                                                                                                                                                              │                       

[XYZ]

│ │                     )                                                                                                                                                                           │                                       │
│ │       config_file = PosixPath('/root/.local/bin/config.json')                                                                                                                                   │                                       │
│ │             delay = None                                                                                                                                                                        │                                       │
│ │ error_encountered = False                                                                                                                                                                       │                                       │
│ │         fediverse = <feed2fedi.publish.Fediverse object at 0x7a1aa1187cb0>                                                                                                                      │                                       │
│ │              feed = FeedInfo(url='https://xyz.com/feed.rss', prefix=None, max_attachments='max', filters=[], post_videos=True)                                    │                                       │
│ │             items = [                                                                                                                                                                           │                                       │
│ │                     │   {                                                                                                                                                                       │                                       │
│ │                     │   │   'title': 'TITLE 1',                                                                                                                              │                                       │
│ │                     │   │   'title_detail': {'type': 'text/plain', 'language': None, 'base': '', 'value': 'TITLE 1'},                                                        │                                       │
│ │                     │   │   'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://xyz.com/article1.html'}],                    │                                       │
│ │                     │   │   'link': 'https://xyz.com/article1.html',                                                                          │                                       │
│ │                     │   │   'authors': [{'name': 'AUTHOR'}],                                                                                                                                │                                       │
│ │                     │   │   'author': 'AUTHOR',                                                                                                                                             │                                       │
│ │                     │   │   'author_detail': {'name': 'AUTHOR'},                                                                                                                            │                                       │
│ │                     │   │   'published': 'Sat, 15 Nov 2025 12:57:12 +0000',                                                                                                                     │                                       │
│ │                     │   │   'published_parsed': time.struct_time(tm_year=2025, tm_mon=11, tm_mday=15, tm_hour=12, tm_min=57, tm_sec=12, tm_wday=5, tm_yday=319, tm_isdst=0),                    │                                       │
│ │                     │   │   'id': 'https://xyz.com/article1.html',                                                                            │                                       │
│ │                     │   │   ... +1                                                                                                                                                              │                                       │
│ │                     │   },
(...│                                       │
│ │                     ]                                                                                                                                                                           │                                       │
│ │        post_limit = None                                                                                                                                                                        │                                       │
│ │     post_recorder = <feed2fedi.control.PostRecorder object at 0x7a1aa14c4fe0>                                                                                                                   │                                       │
│ │   statuses_posted = 0                                                                                                                                                                           │                                       │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                       │
│                                                                                                                                                                                                                                           │
│ /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/publish.py:88 in publish

│    85 │   │   │   status = ""                                                                                                                                                                                                             │
│    86 │   │   │   if feed.prefix:                                                                                                                                                                                                         │
│    87 │   │   │   │   status += f"{feed.prefix} - "                                                                                                                                                                                       │
│ ❱  88 │   │   │   status += self.config.bot_post_template.format(**item.params).replace("\\n",                                                                                                                                            │
│    89 │   │   │                                                                                                                                                                                                                           │
│    90 │   │   │   try:                                                                                                                                                                                                                    │
│    91 │   │   │   │   media_ids = await self._post_media(fediverse, feed, item, max_media)                                                                                                                                                │
│                                                                                                                                                                                                                                           │
│ ╭───────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────╮                                                     │
│ │            attempt = <Attempt num=1, next_wait=0.2>                                                                                                                               │                                                     │
│ │             client = <httpx.AsyncClient object at 0x7a1aa180ae40>                                                                                                                 │                                                     │
│ │              delay = None                                                                                                                                                         │                                                     │
│ │          fediverse = <minimal_activitypub.client_2_server.ActivityPub object at 0x7a1aa058ea50>                                                                                   │                                                     │
│ │               feed = FeedInfo(url='https://xyz.com/feed.rss, prefix=None, max_attachments='max', filters=[], post_videos=True)                     │                                                     │
│ │ filter_action_drop = False                                                                                                                                                        │                                                     │
│ │               item = {                                                                                                                                                            │                                                     │
│ │                      │   'title': 'TITLE 1',                                                                                                                   │                                                     │
│ │                      │   'title_detail': {'type': 'text/plain', 'language': None, 'base': '', 'value': 'TITLE 1'},                                             │                                                     │
│ │                      │   'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://xyz.com/article1.html'}],         │                                                     │
│ │                      │   'link': 'https://xyz.com/article1.html',                                                               │                                                     │
│ │                      │   'authors': [{'name': 'AUTHOR'}],                                                                                                                     │                                                     │
│ │                      │   'author': 'AUTHOR',                                                                                                                                  │                                                     │
│ │                      │   'author_detail': {'name': 'AUTHOR'},                                                                                                                 │                                                     │
│ │                      │   'published': 'Sat, 15 Nov 2025 12:57:12 +0000',                                                                                                          │                                                     │
│ │                      │   'published_parsed': time.struct_time(tm_year=2025, tm_mon=11, tm_mday=15, tm_hour=12, tm_min=57, tm_sec=12, tm_wday=5, tm_yday=319, tm_isdst=0),         │                                                     │
│ │                      │   'id': 'https://xyz.com/article1.html',                                                                 │                                                     │
│ │                      │   ... +1                                                                                                                                                   │                                                     │
│ │                      }                                                                                                                                                            │                                                     │
│ │              items = [                                                                                                                                                            │                                                     │
│ │                      │   {                                                                                                                                                        │                                                     │
│ │                      │   │   'title': 'TITLE 1',                                                                                                               │                                                     │
│ │                      │   │   'title_detail': {'type': 'text/plain', 'language': None, 'base': '', 'value': 'TITLE 1'},                                         │                                                     │
│ │                      │   │   'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://xyz.com/article1.html'}],     │                                                     │
│ │                      │   │   'link': 'https://xyz.com/article1.html',                                                           │                                                     │
│ │                      │   │   'authors': [{'name': 'AUTHOR'}],                                                                                                                 │                                                     │
│ │                      │   │   'author': 'AUTHOR',                                                                                                                              │                                                     │
│ │                      │   │   'author_detail': {'name': 'AUTHOR'},                                                                                                             │                                                     │
│ │                      │   │   'published': 'Sat, 15 Nov 2025 12:57:12 +0000',                                                                                                      │                                                     │
│ │                      │   │   'published_parsed': time.struct_time(tm_year=2025, tm_mon=11, tm_mday=15, tm_hour=12, tm_min=57, tm_sec=12, tm_wday=5, tm_yday=319, tm_isdst=0),     │                                                     │
│ │                      │   │   'id': 'https://xyz.com/article1.html',                                                             │                                                     │
│ │                      │   │   ... +1                                                                                                                                               │                                                     │
│ │                      │   }│                                                     │
│ │                      ]                                                                                                                                                            │                                                     │
│ │          max_media = 4                                                                                                                                                            │                                                     │
│ │         post_limit = None                                                                                                                                                         │                                                     │
│ │               self = <feed2fedi.publish.Fediverse object at 0x7a1aa1187cb0>                                                                                                       │                                                     │
│ │          sensitive = False                                                                                                                                                        │                                                     │
│ │       spoiler_text = None                                                                                                                                                         │                                                     │
│ │             status = ''                                                                                                                                                           │                                                     │
│ │    statuses_posted = 0                                                                                                                                                            │                                                     │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'content_plaintext'
Example for _feed.xml_ (not exactly similar to the output): ``` <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title>TITLE</title> <description>DESCRIPTION</description> <pubDate>Sun, 17 Nov 2025 14:57:13 +0000</pubDate> <link>https://xyz.com/news.xml</link> <atom:link href="https://xyz.com/news.rss" rel="self" type="application/rss+xml" /> <item> <title>TITLE 1</title> <link>https://xyz.com/article1.html</link> <dc:creator>AUTHOR</dc:creator> <pubDate>Sun, 17 Nov 2025 14:57:13 +0000</pubDate> <guid isPermaLink="false">https://xyz.com/article1.html</guid> </item> <item> <title>TITLE 2</title> <link>https://xyz.com/article2.html</link> <dc:creator>AUTHOR</dc:creator> <pubDate>Sun, 17 Nov 2025 11:00:00 +0000</pubDate> <guid isPermaLink="false">https://xyz.com/article1.html</guid> </item> </channel> </rss> ``` Error by _feed2fedi_ → output (shortened and anonymized): ``` ╭──────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:128 in start_main_shim │ │ │ │ 125 │ ] = None, ╭──────────────────────── locals ─────────────────────────╮ │ │ 126 ) -> None: │ config_file = PosixPath('/root/.local/bin/config.json') │ │ │ 127 │ """Start Feed2Fedi.""" │ post_limit = None │ │ │ ❱ 128 │ result = asyncio.run(main(config_file=config_file, post_limit=post_limit)) ╰─────────────────────────────────────────────────────────╯ │ │ 129 │ │ │ 130 │ if not result: │ │ 131 │ │ typer.Abort() │ │ │ │ /usr/lib/python3.12/asyncio/runners.py:194 in run │ │ │ │ 191 │ │ │ "asyncio.run() cannot be called from a running event loop") ╭───────────────────────────── locals ─────────────────────────────╮ │ │ 192 │ │ debug = None │ │ │ 193 │ with Runner(debug=debug, loop_factory=loop_factory) as runner: │ loop_factory = None │ │ │ ❱ 194 │ │ return runner.run(main) │ main = <coroutine object main at 0x7a1aa3540720> │ │ │ 195 │ runner = <asyncio.runners.Runner object at 0x7a1aa1d632c0> │ │ │ 196 ╰──────────────────────────────────────────────────────────────────╯ │ │ 197 def _cancel_all_tasks(loop): │ │ │ │ /usr/lib/python3.12/asyncio/runners.py:118 in run │ │ │ │ 115 │ │ │ │ 116 │ │ self._interrupt_count = 0 │ │ 117 │ │ try: │ │ ❱ 118 │ │ │ return self._loop.run_until_complete(task) │ │ 119 │ │ except exceptions.CancelledError: │ │ 120 │ │ │ if self._interrupt_count > 0: │ │ 121 │ │ │ │ uncancel = getattr(task, "uncancel", None) │ │ │ │ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ context = <_contextvars.Context object at 0x7a1aa1121280> │ │ │ │ coro = <coroutine object main at 0x7a1aa3540720> │ │ │ │ self = <asyncio.runners.Runner object at 0x7a1aa1d632c0> │ │ │ │ sigint_handler = functools.partial(<bound method Runner._on_sigint of <asyncio.runners.Runner object at 0x7a1aa1d632c0>>, main_task=<Task finished name='Task-1' coro=<main() done, defined at │ │ │ │ /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:21> exception=KeyError('content_plaintext')>) │ │ │ │ task = <Task finished name='Task-1' coro=<main() done, defined at /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:21> exception=KeyError('content_plaintext')> │ │ │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3.12/asyncio/base_events.py:687 in run_until_complete │ │ │ │ 684 │ │ if not future.done(): │ │ 685 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │ │ 686 │ │ │ │ ❱ 687 │ │ return future.result() │ │ 688 │ │ │ 689 │ def stop(self): │ │ 690 │ │ """Stop running the event loop. │ │ │ │ ╭────────────────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ future = <Task finished name='Task-1' coro=<main() done, defined at /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:21> exception=KeyError('content_plaintext')> │ │ │ │ new_task = False │ │ │ │ self = <_UnixSelectorEventLoop running=False closed=True debug=False> │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/app.py:59 in main │ │ 56 │ │ │ items = FeedReader(feed=feed.url).items │ │ 57 │ │ │ │ │ 58 │ │ │ try: │ │ ❱ 59 │ │ │ │ statuses_posted += await fediverse.publish( │ │ 60 │ │ │ │ │ items=items, │ │ 61 │ │ │ │ │ feed=feed, │ │ 62 │ │ │ │ │ post_limit=post_limit, │ │ │ │ ╭──────────────────────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ client = <httpx.AsyncClient object at 0x7a1aa180ae40> │ │ │ │ config = Configuration( │ [XYZ] │ │ ) │ │ │ │ config_file = PosixPath('/root/.local/bin/config.json') │ │ │ │ delay = None │ │ │ │ error_encountered = False │ │ │ │ fediverse = <feed2fedi.publish.Fediverse object at 0x7a1aa1187cb0> │ │ │ │ feed = FeedInfo(url='https://xyz.com/feed.rss', prefix=None, max_attachments='max', filters=[], post_videos=True) │ │ │ │ items = [ │ │ │ │ │ { │ │ │ │ │ │ 'title': 'TITLE 1', │ │ │ │ │ │ 'title_detail': {'type': 'text/plain', 'language': None, 'base': '', 'value': 'TITLE 1'}, │ │ │ │ │ │ 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://xyz.com/article1.html'}], │ │ │ │ │ │ 'link': 'https://xyz.com/article1.html', │ │ │ │ │ │ 'authors': [{'name': 'AUTHOR'}], │ │ │ │ │ │ 'author': 'AUTHOR', │ │ │ │ │ │ 'author_detail': {'name': 'AUTHOR'}, │ │ │ │ │ │ 'published': 'Sat, 15 Nov 2025 12:57:12 +0000', │ │ │ │ │ │ 'published_parsed': time.struct_time(tm_year=2025, tm_mon=11, tm_mday=15, tm_hour=12, tm_min=57, tm_sec=12, tm_wday=5, tm_yday=319, tm_isdst=0), │ │ │ │ │ │ 'id': 'https://xyz.com/article1.html', │ │ │ │ │ │ ... +1 │ │ │ │ │ }, (...│ │ │ │ ] │ │ │ │ post_limit = None │ │ │ │ post_recorder = <feed2fedi.control.PostRecorder object at 0x7a1aa14c4fe0> │ │ │ │ statuses_posted = 0 │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /root/.local/pipx/venvs/feed2fedi/lib/python3.12/site-packages/feed2fedi/publish.py:88 in publish │ 85 │ │ │ status = "" │ │ 86 │ │ │ if feed.prefix: │ │ 87 │ │ │ │ status += f"{feed.prefix} - " │ │ ❱ 88 │ │ │ status += self.config.bot_post_template.format(**item.params).replace("\\n", │ │ 89 │ │ │ │ │ 90 │ │ │ try: │ │ 91 │ │ │ │ media_ids = await self._post_media(fediverse, feed, item, max_media) │ │ │ │ ╭───────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ attempt = <Attempt num=1, next_wait=0.2> │ │ │ │ client = <httpx.AsyncClient object at 0x7a1aa180ae40> │ │ │ │ delay = None │ │ │ │ fediverse = <minimal_activitypub.client_2_server.ActivityPub object at 0x7a1aa058ea50> │ │ │ │ feed = FeedInfo(url='https://xyz.com/feed.rss, prefix=None, max_attachments='max', filters=[], post_videos=True) │ │ │ │ filter_action_drop = False │ │ │ │ item = { │ │ │ │ │ 'title': 'TITLE 1', │ │ │ │ │ 'title_detail': {'type': 'text/plain', 'language': None, 'base': '', 'value': 'TITLE 1'}, │ │ │ │ │ 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://xyz.com/article1.html'}], │ │ │ │ │ 'link': 'https://xyz.com/article1.html', │ │ │ │ │ 'authors': [{'name': 'AUTHOR'}], │ │ │ │ │ 'author': 'AUTHOR', │ │ │ │ │ 'author_detail': {'name': 'AUTHOR'}, │ │ │ │ │ 'published': 'Sat, 15 Nov 2025 12:57:12 +0000', │ │ │ │ │ 'published_parsed': time.struct_time(tm_year=2025, tm_mon=11, tm_mday=15, tm_hour=12, tm_min=57, tm_sec=12, tm_wday=5, tm_yday=319, tm_isdst=0), │ │ │ │ │ 'id': 'https://xyz.com/article1.html', │ │ │ │ │ ... +1 │ │ │ │ } │ │ │ │ items = [ │ │ │ │ │ { │ │ │ │ │ │ 'title': 'TITLE 1', │ │ │ │ │ │ 'title_detail': {'type': 'text/plain', 'language': None, 'base': '', 'value': 'TITLE 1'}, │ │ │ │ │ │ 'links': [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://xyz.com/article1.html'}], │ │ │ │ │ │ 'link': 'https://xyz.com/article1.html', │ │ │ │ │ │ 'authors': [{'name': 'AUTHOR'}], │ │ │ │ │ │ 'author': 'AUTHOR', │ │ │ │ │ │ 'author_detail': {'name': 'AUTHOR'}, │ │ │ │ │ │ 'published': 'Sat, 15 Nov 2025 12:57:12 +0000', │ │ │ │ │ │ 'published_parsed': time.struct_time(tm_year=2025, tm_mon=11, tm_mday=15, tm_hour=12, tm_min=57, tm_sec=12, tm_wday=5, tm_yday=319, tm_isdst=0), │ │ │ │ │ │ 'id': 'https://xyz.com/article1.html', │ │ │ │ │ │ ... +1 │ │ │ │ │ }│ │ │ │ ] │ │ │ │ max_media = 4 │ │ │ │ post_limit = None │ │ │ │ self = <feed2fedi.publish.Fediverse object at 0x7a1aa1187cb0> │ │ │ │ sensitive = False │ │ │ │ spoiler_text = None │ │ │ │ status = '' │ │ │ │ statuses_posted = 0 │ │ │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ KeyError: 'content_plaintext' ```
marvin8 commented 2025-11-18 04:30:55 +00:00 (Migrated from codeberg.org)

Thanks for that. I'll add checks to skip feed items that don't have any of the fields required.

Thanks for that. I'll add checks to skip feed items that don't have any of the fields required.
Sebastian_Berlin commented 2025-11-18 15:44:27 +00:00 (Migrated from codeberg.org)

Thank you very much! 💫

Thank you very much! 💫
marvin8 commented 2025-11-28 00:06:56 +00:00 (Migrated from codeberg.org)

Included in latest release 3.4.0

Included in latest release 3.4.0
Sebastian_Berlin commented 2025-11-29 07:52:55 +00:00 (Migrated from codeberg.org)
EDITED see https://codeberg.org/marvinsmastodontools/feed2fedi/issues/66
marvin8 commented 2025-11-29 09:25:39 +00:00 (Migrated from codeberg.org)

Please open a new issue for this. I agree it is related but still a different issue.

Please open a new issue for this. I agree it is related but still a different issue.
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/feed2fedi#59
No description provided.