[Enhancement]: Sanitize podcast feeds with unescaped '&' in the XML #3073

Open
opened 2026-04-25 00:13:31 +02:00 by adam · 0 comments
Owner

Originally created by @jasonlearst on GitHub (Nov 6, 2025).

Type of Enhancement

Server Backend

Describe the Feature/Enhancement

The ABS server should try to identify when the & character is not properly written as & within the XML of the podcast feed.

Why would this be helpful?

I specifically identified this issue with the Dada Life: Crash & Smile In Dada Land podcast. The feed contains <title>Crash & Smile In Dada Land</title> which causes ABS to return the error "Failed to get podcast feed" on the Frontend. Here is the log from the console.

audiobookshelf-1  | [2025-11-05 22:20:21.218] ERROR: [xmlToJSON] Error Error: Invalid character in entity name
audiobookshelf-1  | Line: 14
audiobookshelf-1  | Column: 19
audiobookshelf-1  | Char:
audiobookshelf-1  |     at error (/app/node_modules/sax/lib/sax.js:651:10)
audiobookshelf-1  |     at strictFail (/app/node_modules/sax/lib/sax.js:677:7)
audiobookshelf-1  |     at SAXParser.write (/app/node_modules/sax/lib/sax.js:1491:13)
audiobookshelf-1  |     at exports.Parser.Parser.parseString (/app/node_modules/xml2js/lib/parser.js:327:31)
audiobookshelf-1  |     at Parser.parseString (/app/node_modules/xml2js/lib/parser.js:5:59)
audiobookshelf-1  |     at exports.parseString (/app/node_modules/xml2js/lib/parser.js:373:19)
audiobookshelf-1  |     at /app/server/utils/index.js:59:5
audiobookshelf-1  |     at new Promise (<anonymous>)
audiobookshelf-1  |     at xmlToJSON (/app/server/utils/index.js:58:10)
audiobookshelf-1  |     at module.exports.parsePodcastRssFeedXml (/app/server/utils/podcastUtils.js:323:22)
audiobookshelf-1  | [2025-11-05 22:20:21.219] ERROR: [podcastUtils] Invalid XML or RSS feed

Future Implementation (Screenshot)

Using RegEx to parse the XML for the unescaped & characters.

I have created a prototype (which fixes my issues) with the support of Claude Code. I'd be happy to submit it as an MR if the project is open to AI assisted MRs.

jasonlearst: sanitize_ampersand

Audiobookshelf Server Version

v2.30.0

Current Implementation (Screenshot)

No response

Originally created by @jasonlearst on GitHub (Nov 6, 2025). ### Type of Enhancement Server Backend ### Describe the Feature/Enhancement The ABS server should try to identify when the `&` character is not properly written as `&amp;` within the XML of the podcast feed. ### Why would this be helpful? I specifically identified this issue with the `Dada Life: Crash & Smile In Dada Land` podcast. The [feed](https://dadalife.libsyn.com/rss) contains `<title>Crash & Smile In Dada Land</title>` which causes ABS to return the error "Failed to get podcast feed" on the Frontend. Here is the log from the console. ```bash audiobookshelf-1 | [2025-11-05 22:20:21.218] ERROR: [xmlToJSON] Error Error: Invalid character in entity name audiobookshelf-1 | Line: 14 audiobookshelf-1 | Column: 19 audiobookshelf-1 | Char: audiobookshelf-1 | at error (/app/node_modules/sax/lib/sax.js:651:10) audiobookshelf-1 | at strictFail (/app/node_modules/sax/lib/sax.js:677:7) audiobookshelf-1 | at SAXParser.write (/app/node_modules/sax/lib/sax.js:1491:13) audiobookshelf-1 | at exports.Parser.Parser.parseString (/app/node_modules/xml2js/lib/parser.js:327:31) audiobookshelf-1 | at Parser.parseString (/app/node_modules/xml2js/lib/parser.js:5:59) audiobookshelf-1 | at exports.parseString (/app/node_modules/xml2js/lib/parser.js:373:19) audiobookshelf-1 | at /app/server/utils/index.js:59:5 audiobookshelf-1 | at new Promise (<anonymous>) audiobookshelf-1 | at xmlToJSON (/app/server/utils/index.js:58:10) audiobookshelf-1 | at module.exports.parsePodcastRssFeedXml (/app/server/utils/podcastUtils.js:323:22) audiobookshelf-1 | [2025-11-05 22:20:21.219] ERROR: [podcastUtils] Invalid XML or RSS feed ``` ### Future Implementation (Screenshot) Using RegEx to parse the XML for the unescaped `&` characters. I have created a prototype (which fixes my issues) with the support of Claude Code. I'd be happy to submit it as an MR if the project is open to AI assisted MRs. [jasonlearst: sanitize_ampersand](https://github.com/jasonlearst/audiobookshelf/tree/sanitize_ampersand) ### Audiobookshelf Server Version v2.30.0 ### Current Implementation (Screenshot) _No response_
adam added the enhancement label 2026-04-25 00:13:31 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3073