[Bug]: extractEpisodeData trim is not a function #3040

Closed
opened 2026-04-25 00:13:12 +02:00 by adam · 2 comments
Owner

Originally created by @voruti on GitHub (Oct 19, 2025).

What happened?

Adding a specific podcast doesn't work. After manually adding the podcast, clicking the button "Find Episodes" also doesn't work.
I get the following error message: "Failed to get podcast feed".

What did you expect to happen?

Fetch the podcast and its episodes successfully.

Steps to reproduce the issue

  1. try to add the podcast with RSS Feed URL: https://daswarschonkaputt.tech/feed/dwsk.xml

Audiobookshelf version

v2.30.0

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?

None

Logs

audiobookshelf-1  | [2025-10-19 16:52:28.760] DEBUG: [podcastUtils] getPodcastFeed for "https://daswarschonkaputt.tech/feed/dwsk.xml"
audiobookshelf-1  | [2025-10-19 16:52:29.025] DEBUG: [podcastUtils] getPodcastFeed for "https://daswarschonkaputt.tech/feed/dwsk.xml" success - parsing xml
audiobookshelf-1  | [2025-10-19 16:52:29.034] ERROR: [podcastUtils] getPodcastFeed Error TypeError: (extractFirstArrayItem(...) || "").trim is not a function
audiobookshelf-1  |     at extractEpisodeData (/app/server/utils/podcastUtils.js:174:83)
audiobookshelf-1  |     at /app/server/utils/podcastUtils.js:292:23
audiobookshelf-1  |     at Array.forEach (<anonymous>)
audiobookshelf-1  |     at extractPodcastEpisodes (/app/server/utils/podcastUtils.js:291:9)
audiobookshelf-1  |     at cleanPodcastJson (/app/server/utils/podcastUtils.js:314:24)
audiobookshelf-1  |     at module.exports.parsePodcastRssFeedXml (/app/server/utils/podcastUtils.js:329:19)
audiobookshelf-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
audiobookshelf-1  |     at async /app/server/utils/podcastUtils.js:390:23

Additional Notes

The method extractEpisodeData tries to extract data from the podcast feed:
https://github.com/advplyr/audiobookshelf/blob/29752798f3d1eed348746830a879f0699ff48993/server/utils/podcastUtils.js#L172-L176

The value of content:encoded of the failing podcast looks like the following:

<content:encoded>Die <a href="https://daswarschonkaputt.tech/post/40/">SHOWNODES </a> findet ihr auf unserer Website https://daswarschonkaputt.tech</content:encoded>
Originally created by @voruti on GitHub (Oct 19, 2025). ### What happened? Adding a specific podcast doesn't work. After manually adding the podcast, clicking the button "Find Episodes" also doesn't work. I get the following error message: "Failed to get podcast feed". ### What did you expect to happen? Fetch the podcast and its episodes successfully. ### Steps to reproduce the issue 1. try to add the podcast with RSS Feed URL: `https://daswarschonkaputt.tech/feed/dwsk.xml` ### Audiobookshelf version v2.30.0 ### 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? None ### Logs ```shell audiobookshelf-1 | [2025-10-19 16:52:28.760] DEBUG: [podcastUtils] getPodcastFeed for "https://daswarschonkaputt.tech/feed/dwsk.xml" audiobookshelf-1 | [2025-10-19 16:52:29.025] DEBUG: [podcastUtils] getPodcastFeed for "https://daswarschonkaputt.tech/feed/dwsk.xml" success - parsing xml audiobookshelf-1 | [2025-10-19 16:52:29.034] ERROR: [podcastUtils] getPodcastFeed Error TypeError: (extractFirstArrayItem(...) || "").trim is not a function audiobookshelf-1 | at extractEpisodeData (/app/server/utils/podcastUtils.js:174:83) audiobookshelf-1 | at /app/server/utils/podcastUtils.js:292:23 audiobookshelf-1 | at Array.forEach (<anonymous>) audiobookshelf-1 | at extractPodcastEpisodes (/app/server/utils/podcastUtils.js:291:9) audiobookshelf-1 | at cleanPodcastJson (/app/server/utils/podcastUtils.js:314:24) audiobookshelf-1 | at module.exports.parsePodcastRssFeedXml (/app/server/utils/podcastUtils.js:329:19) audiobookshelf-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) audiobookshelf-1 | at async /app/server/utils/podcastUtils.js:390:23 ``` ### Additional Notes The method `extractEpisodeData` tries to extract data from the podcast feed: https://github.com/advplyr/audiobookshelf/blob/29752798f3d1eed348746830a879f0699ff48993/server/utils/podcastUtils.js#L172-L176 The value of `content:encoded` of the failing podcast looks like the following: ```xml <content:encoded>Die <a href="https://daswarschonkaputt.tech/post/40/">SHOWNODES </a> findet ihr auf unserer Website https://daswarschonkaputt.tech</content:encoded> ```
adam added the bug label 2026-04-25 00:13:13 +02:00
adam closed this issue 2026-04-25 00:13:13 +02:00
Author
Owner

@advplyr commented on GitHub (Oct 20, 2025):

I think this RSS feed is improperly formatted but we can still work with it.

This is what the content:encoded looks like:

<content:encoded>Die 
                <a href="https://daswarschonkaputt.tech/post/27/">SHOWNODES </a> findet ihr auf unserer Website https://daswarschonkaputt.tech
</content:encoded>

But html should be wrapped in CDATA like this:

<content:encoded>
                <![CDATA[<p>One of the last uncontacted people in the world live in the Bay of Bengal and they have made it clear they don&rsquo;t want you to visit.</p><p>See <a href="https://omnystudio.com/listener">omnystudio.com/listener</a> for privacy information.</p>]]>
</content:encoded>
@advplyr commented on GitHub (Oct 20, 2025): I think this RSS feed is improperly formatted but we can still work with it. This is what the content:encoded looks like: ```xml <content:encoded>Die <a href="https://daswarschonkaputt.tech/post/27/">SHOWNODES </a> findet ihr auf unserer Website https://daswarschonkaputt.tech </content:encoded> ``` But html should be wrapped in `CDATA` like this: ```xml <content:encoded> <![CDATA[<p>One of the last uncontacted people in the world live in the Bay of Bengal and they have made it clear they don&rsquo;t want you to visit.</p><p>See <a href="https://omnystudio.com/listener">omnystudio.com/listener</a> for privacy information.</p>]]> </content:encoded> ```
Author
Owner

@github-actions[bot] commented on GitHub (Dec 2, 2025):

Fixed in v2.31.0.

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

No dependencies set.

Reference: starred/audiobookshelf#3040