[Enhancement]: Handle Podcast RSS feed that isn't using CDATA for description fields #2454

Closed
opened 2026-04-25 00:07:20 +02:00 by adam · 6 comments
Owner

Originally created by @kucksdorfs on GitHub (Jan 2, 2025).

What happened?

I attempted to add an RSS feed (https://gorkyr.github.io/We-Want-MoR-Playlist/we-want-mor.rss) to my podcasts library, but ran into an error (log is pasted below)

What did you expect to happen?

Successfully add a podcast

Steps to reproduce the issue

  1. Log in with user who can create/add podcasts
  2. Add the feed "https://gorkyr.github.io/We-Want-MoR-Playlist/we-want-mor.rss"
  3. Error adding, navigated to Logs section under Settings and found a stack trace saying rawDescription.trim is not a function, rawDescription is probably null at this place.

Audiobookshelf version

v2.17.7 and v2.17.6

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Firefox

Logs

2025-01-02 17:42:48.904

ERROR

[podcastUtils] getPodcastFeed Error TypeError: rawDescription.trim is not a function at extractEpisodeData (/server/utils/podcastUtils.js:107:74) at /server/utils/podcastUtils.js:168:23 at Array.forEach (<anonymous>) at extractPodcastEpisodes (/server/utils/podcastUtils.js:167:9) at cleanPodcastJson (/server/utils/podcastUtils.js:190:24) at module.exports.parsePodcastRssFeedXml (/server/utils/podcastUtils.js:205:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /server/utils/podcastUtils.js:265:23

Additional Notes

No response

Originally created by @kucksdorfs on GitHub (Jan 2, 2025). ### What happened? I attempted to add an RSS feed (https://gorkyr.github.io/We-Want-MoR-Playlist/we-want-mor.rss) to my podcasts library, but ran into an error (log is pasted below) ### What did you expect to happen? Successfully add a podcast ### Steps to reproduce the issue 1. Log in with user who can create/add podcasts 2. Add the feed "https://gorkyr.github.io/We-Want-MoR-Playlist/we-want-mor.rss" 3. Error adding, navigated to Logs section under Settings and found a stack trace saying rawDescription.trim is not a function, rawDescription is probably null at this place. ### Audiobookshelf version v2.17.7 and v2.17.6 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? Firefox ### Logs ```shell 2025-01-02 17:42:48.904 ERROR [podcastUtils] getPodcastFeed Error TypeError: rawDescription.trim is not a function at extractEpisodeData (/server/utils/podcastUtils.js:107:74) at /server/utils/podcastUtils.js:168:23 at Array.forEach (<anonymous>) at extractPodcastEpisodes (/server/utils/podcastUtils.js:167:9) at cleanPodcastJson (/server/utils/podcastUtils.js:190:24) at module.exports.parsePodcastRssFeedXml (/server/utils/podcastUtils.js:205:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /server/utils/podcastUtils.js:265:23 ``` ### Additional Notes _No response_
adam added the enhancement label 2026-04-25 00:07:20 +02:00
adam closed this issue 2026-04-25 00:07:20 +02:00
Author
Owner

@nichwall commented on GitHub (Jan 7, 2025):

Looks like it specifically due to one of the episode descriptions being parsed as an object instead of a string. From that RSS feed:
<description><em>&#8230;blood spills out in litres, and someone screams a word.</em></description>
is parsed as an object
Description has type object: {"em":["…blood spills out in litres, and someone screams a word."]}

@nichwall commented on GitHub (Jan 7, 2025): Looks like it specifically due to one of the episode descriptions being parsed as an object instead of a string. From that RSS feed: `<description><em>&#8230;blood spills out in litres, and someone screams a word.</em></description>` is parsed as an object `Description has type object: {"em":["…blood spills out in litres, and someone screams a word."]}`
Author
Owner

@advplyr commented on GitHub (Jan 7, 2025):

Yeah I think it is invalid XML but I'm not an XML expert.

When using HTML tags it should be wrapped in CDATA

image

@advplyr commented on GitHub (Jan 7, 2025): Yeah I think it is invalid XML but I'm not an XML expert. When using HTML tags it should be wrapped in [CDATA](https://www.w3resource.com/xml/CDATA-sections.php) ![image](https://github.com/user-attachments/assets/1400f4b5-e3c2-4653-ad23-7d9a264cf72b)
Author
Owner

@kucksdorfs commented on GitHub (Jan 8, 2025):

For what it's worth, it looks like valid xml to me (I am a .net dev in my dat job that deals with too much xml). I am not super familiar with the js/node/vue environment, but is there any schema that backs deserializing an rss feed? If there was some kind of xsd that this can run against, then this whole thing shouldn't be an issue.

That said if this was a perfect world I would agree that this is on the publisher to fix.

@kucksdorfs commented on GitHub (Jan 8, 2025): For what it's worth, it looks like valid xml to me (I am a .net dev in my dat job that deals with too much xml). I am not super familiar with the js/node/vue environment, but is there any schema that backs deserializing an rss feed? If there was some kind of xsd that this can run against, then this whole thing shouldn't be an issue. That said if this was a perfect world I would agree that this is on the publisher to fix.
Author
Owner

@nichwall commented on GitHub (Jan 8, 2025):

Could probably just do something silly and say "if an object, strinigify" for descriptions and titles. It would render weird, but then it could at least be imported. We would probably then get bug reports about that, though...

@nichwall commented on GitHub (Jan 8, 2025): Could probably just do something silly and say "if an object, strinigify" for descriptions and titles. It would render weird, but then it could at least be imported. We would probably then get bug reports about that, though...
Author
Owner

@kucksdorfs commented on GitHub (Jan 8, 2025):

Could probably just do something silly and say "if an object, strinigify" for descriptions and titles. It would render weird, but then it could at least be imported. We would probably then get bug reports about that, though...

That gets my vote. Can probably even pit some kind of warning on the podcast page that says there may be iasues with the title/description if you do need to call stringify.

@kucksdorfs commented on GitHub (Jan 8, 2025): > Could probably just do something silly and say "if an object, strinigify" for descriptions and titles. It would render weird, but then it could at least be imported. We would probably then get bug reports about that, though... That gets my vote. Can probably even pit some kind of warning on the podcast page that says there may be iasues with the title/description if you do need to call stringify.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 20, 2025):

Fixed in v2.18.0.

@github-actions[bot] commented on GitHub (Jan 20, 2025): Fixed in [v2.18.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.18.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2454