[Bug]: Issue Parsing RSS Feed #1585

Closed
opened 2026-04-24 23:50:50 +02:00 by adam · 6 comments
Owner

Originally created by @tomershvueli on GitHub (Dec 9, 2023).

Describe the issue

Starting maybe a week or 2 ago I've had a podcast feed of mine not be able to pull in any new shows. Logs look like this:

Dec 08 15:12:18Line: 0
Dec 08 15:12:18Column: 1
Dec 08 15:12:18Char: {
Dec 08 15:12:18at error (/app/code/node_modules/sax/lib/sax.js:651:10)
Dec 08 15:12:18at strictFail (/app/code/node_modules/sax/lib/sax.js:677:7)
Dec 08 15:12:18at beginWhiteSpace (/app/code/node_modules/sax/lib/sax.js:951:7)
Dec 08 15:12:18at SAXParser.write (/app/code/node_modules/sax/lib/sax.js:1006:11)
Dec 08 15:12:18at Parser.exports.Parser.Parser.parseString (/app/code/node_modules/xml2js/lib/parser.js:327:31)
Dec 08 15:12:18at Parser.parseString (/app/code/node_modules/xml2js/lib/parser.js:5:59)
Dec 08 15:12:18at exports.parseString (/app/code/node_modules/xml2js/lib/parser.js:373:19)
Dec 08 15:12:18at /app/code/server/utils/index.js:49:5
Dec 08 15:12:18at new Promise (<anonymous>)
Dec 08 15:12:18at xmlToJSON (/app/code/server/utils/index.js:48:10) (index.js:51)
Dec 08 15:12:18[2023-12-08 20:12:18.610] ERROR: [podcastUtils] Invalid XML or RSS feed (podcastUtils.js:200)

Here's a shortened, redacted version of the feed:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atomic="http://atomicpublishing.com/rss/1.0/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:spotify="http://www.spotify.com/ns/rss">
  <channel>
    <title>Dithering</title>
    <link>https://dithering.fm</link>
    <description>A new podcast from Ben Thompson and John Gruber. Two episodes per week, 15 minutes per episode. Not a minute less, not a minute more.</description>
    <language>en-us</language>
    <copyright><![CDATA[Dithering, LLC]]></copyright>
    <managingEditor>admin@dithering.fm (Ben Thompson and John Gruber)</managingEditor>
    <webMaster>admin@dithering.fm (Ben Thompson and John Gruber)</webMaster>
    <pubDate>Fri, 08 Dec 2023 10:00:34 +0000</pubDate>
    <lastBuildDate>Fri, 08 Dec 2023 20:12:34 +0000</lastBuildDate>
    <category>Technology</category>
    <ttl>60</ttl>
    <image>
      <url>https://dithering.fm/wp-content/uploads/2023/12/DitheringCoverart.jpg</url>
      <title>Dithering</title>
      <link>https://dithering.fm</link>
    </image>
    <item>
      <title>Gemini</title>
      <link>https://dithering.fm/?access_token=</link>
      <description>Google released Gemini with demos that weren&#39;t entirely honest. Plus, Apple&#39;s new AI framework.</description>
      <content:encoded><![CDATA[<p><a target="_blank" href="https://wavelength.app/invite/3tXVGtqnFOk#jEhmAZ9H._ra17OCpDYMqQ--">Join the Dithering group chat on Wavelength</a>.</p>
<hr/>
<meta charset="UTF-8"/>
<hr/>

<p><a href="https://dithering.passport.online/oauth/session?access_token=">Subscribe to Stratechery Plus</a> to get full episodes of <a href="https://sharptech.fm">Sharp Tech</a>, plus <a href="https://stratechery.com/stratechery-plus/">Stratechery Updates and Interviews</a>, <a href="https://sharpchina.fm">Sharp China</a> and <a href="https://goat.passport.online/">Greatest of All Talk</a>.</p>


<hr/>
<ul>
    <li><a target="_blank" href="" class="button">Add Stratechery to your podcast player</a></li>
    <li><a target="_blank" href="" class="button">Add Sharp Tech to your podcast player</a></li>
    <li><a target="_blank" href="" class="button">Add Sharp China to your podcast player</a></li>
    <li><a target="_blank" href="" class="button">Add Greatest Of All Talk to your podcast player</a></li>
    <li><a target="_blank" href="https://daringfireball.net/thetalkshow/">Add The Talk Show to your podcast player</a>.</li>

</ul>
<hr/>
<p>Subscription Information</p>
<p>
    Member: Tomer S<br/>
    Email: tomer@shvueli.com<br/>
    
</p>
<p><a href="https://dithering.passport.online/oauth/session?access_token=">Manage your account</a></p>
]]></content:encoded>
      <author>dithering</author>
      <enclosure url="https://assets.dithering.passport.online/assets/2023-12-08-dithering-0405.mp3?access_token=" length="14887335" type="audio/mpeg"></enclosure>
      <guid isPermaLink="true">https://dithering.fm/?p=1269</guid>
      <pubDate>Fri, 08 Dec 2023 10:00:34 +0000</pubDate>
      <atomic:distribution id="8XD4XeaJDW34rmyMqZhkRb" article="7Mndyhu2SRusBXMx1TewGg" template="3fWXGshjw7dsqertEG39tY" audience="WthnL9Dwj9BCmiAfajrCd" asset="MKe83bowBJf9NWt4aKxfWK">
        <atomic:distroDate>Fri, 08 Dec 2023 10:00:29 +0000</atomic:distroDate>
        <atomic:categories>
          <atomic:category id="AovjVXmPSbXw9TrahHELPV" name="dithering"></atomic:category>
        </atomic:categories>
      </atomic:distribution>
      <itunes:author>dithering</itunes:author>
      <itunes:image href="https://dithering.fm/wp-content/uploads/2023/12/DitheringCoverart-630x630.jpg"></itunes:image>
      <itunes:duration>00:15:00</itunes:duration>
      <itunes:summary>Google released Gemini with demos that weren&#39;t entirely honest. Plus, Apple&#39;s new AI framework.</itunes:summary>
    </item>
    <itunes:image href="https://dithering.fm/wp-content/uploads/2023/12/DitheringCoverart.jpg"></itunes:image>
    <atom:link href="" rel="self" type="application/rss+xml"></atom:link>
    <itunes:owner>
      <itunes:name>Ben Thompson and John Gruber</itunes:name>
      <itunes:email>admin@dithering.fm</itunes:email>
    </itunes:owner>
    <itunes:author>Ben Thompson and John Gruber</itunes:author>
    <atomic:instance id="4XZpMcPBGowTRADmCrRVN4" build="bdfa7f29" version="v0.5.21"></atomic:instance>
    <sy:updatePeriod></sy:updatePeriod>
    <sy:updateFrequency>0</sy:updateFrequency>
    <itunes:block>yes</itunes:block>
    <itunes:explicit>no</itunes:explicit>
    <itunes:category text="Technology"></itunes:category>
  </channel>
</rss>

Not sure what's wrong here but would appreciate any help in looking into this!

Steps to reproduce the issue

  1. See code snippets above for parsing issue.

Audiobookshelf version

2.6.0

How are you running audiobookshelf?

Other

Originally created by @tomershvueli on GitHub (Dec 9, 2023). ### Describe the issue Starting maybe a week or 2 ago I've had a podcast feed of mine not be able to pull in any new shows. Logs look like this: ```Dec 08 15:12:18[2023-12-08 20:12:18.608] ERROR: [xmlToJSON] Error Error: Non-whitespace before first tag. Dec 08 15:12:18Line: 0 Dec 08 15:12:18Column: 1 Dec 08 15:12:18Char: { Dec 08 15:12:18at error (/app/code/node_modules/sax/lib/sax.js:651:10) Dec 08 15:12:18at strictFail (/app/code/node_modules/sax/lib/sax.js:677:7) Dec 08 15:12:18at beginWhiteSpace (/app/code/node_modules/sax/lib/sax.js:951:7) Dec 08 15:12:18at SAXParser.write (/app/code/node_modules/sax/lib/sax.js:1006:11) Dec 08 15:12:18at Parser.exports.Parser.Parser.parseString (/app/code/node_modules/xml2js/lib/parser.js:327:31) Dec 08 15:12:18at Parser.parseString (/app/code/node_modules/xml2js/lib/parser.js:5:59) Dec 08 15:12:18at exports.parseString (/app/code/node_modules/xml2js/lib/parser.js:373:19) Dec 08 15:12:18at /app/code/server/utils/index.js:49:5 Dec 08 15:12:18at new Promise (<anonymous>) Dec 08 15:12:18at xmlToJSON (/app/code/server/utils/index.js:48:10) (index.js:51) Dec 08 15:12:18[2023-12-08 20:12:18.610] ERROR: [podcastUtils] Invalid XML or RSS feed (podcastUtils.js:200) ``` Here's a shortened, redacted version of the feed: ``` <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atomic="http://atomicpublishing.com/rss/1.0/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:spotify="http://www.spotify.com/ns/rss"> <channel> <title>Dithering</title> <link>https://dithering.fm</link> <description>A new podcast from Ben Thompson and John Gruber. Two episodes per week, 15 minutes per episode. Not a minute less, not a minute more.</description> <language>en-us</language> <copyright><![CDATA[Dithering, LLC]]></copyright> <managingEditor>admin@dithering.fm (Ben Thompson and John Gruber)</managingEditor> <webMaster>admin@dithering.fm (Ben Thompson and John Gruber)</webMaster> <pubDate>Fri, 08 Dec 2023 10:00:34 +0000</pubDate> <lastBuildDate>Fri, 08 Dec 2023 20:12:34 +0000</lastBuildDate> <category>Technology</category> <ttl>60</ttl> <image> <url>https://dithering.fm/wp-content/uploads/2023/12/DitheringCoverart.jpg</url> <title>Dithering</title> <link>https://dithering.fm</link> </image> <item> <title>Gemini</title> <link>https://dithering.fm/?access_token=</link> <description>Google released Gemini with demos that weren&#39;t entirely honest. Plus, Apple&#39;s new AI framework.</description> <content:encoded><![CDATA[<p><a target="_blank" href="https://wavelength.app/invite/3tXVGtqnFOk#jEhmAZ9H._ra17OCpDYMqQ--">Join the Dithering group chat on Wavelength</a>.</p> <hr/> <meta charset="UTF-8"/> <hr/> <p><a href="https://dithering.passport.online/oauth/session?access_token=">Subscribe to Stratechery Plus</a> to get full episodes of <a href="https://sharptech.fm">Sharp Tech</a>, plus <a href="https://stratechery.com/stratechery-plus/">Stratechery Updates and Interviews</a>, <a href="https://sharpchina.fm">Sharp China</a> and <a href="https://goat.passport.online/">Greatest of All Talk</a>.</p> <hr/> <ul> <li><a target="_blank" href="" class="button">Add Stratechery to your podcast player</a></li> <li><a target="_blank" href="" class="button">Add Sharp Tech to your podcast player</a></li> <li><a target="_blank" href="" class="button">Add Sharp China to your podcast player</a></li> <li><a target="_blank" href="" class="button">Add Greatest Of All Talk to your podcast player</a></li> <li><a target="_blank" href="https://daringfireball.net/thetalkshow/">Add The Talk Show to your podcast player</a>.</li> </ul> <hr/> <p>Subscription Information</p> <p> Member: Tomer S<br/> Email: tomer@shvueli.com<br/> </p> <p><a href="https://dithering.passport.online/oauth/session?access_token=">Manage your account</a></p> ]]></content:encoded> <author>dithering</author> <enclosure url="https://assets.dithering.passport.online/assets/2023-12-08-dithering-0405.mp3?access_token=" length="14887335" type="audio/mpeg"></enclosure> <guid isPermaLink="true">https://dithering.fm/?p=1269</guid> <pubDate>Fri, 08 Dec 2023 10:00:34 +0000</pubDate> <atomic:distribution id="8XD4XeaJDW34rmyMqZhkRb" article="7Mndyhu2SRusBXMx1TewGg" template="3fWXGshjw7dsqertEG39tY" audience="WthnL9Dwj9BCmiAfajrCd" asset="MKe83bowBJf9NWt4aKxfWK"> <atomic:distroDate>Fri, 08 Dec 2023 10:00:29 +0000</atomic:distroDate> <atomic:categories> <atomic:category id="AovjVXmPSbXw9TrahHELPV" name="dithering"></atomic:category> </atomic:categories> </atomic:distribution> <itunes:author>dithering</itunes:author> <itunes:image href="https://dithering.fm/wp-content/uploads/2023/12/DitheringCoverart-630x630.jpg"></itunes:image> <itunes:duration>00:15:00</itunes:duration> <itunes:summary>Google released Gemini with demos that weren&#39;t entirely honest. Plus, Apple&#39;s new AI framework.</itunes:summary> </item> <itunes:image href="https://dithering.fm/wp-content/uploads/2023/12/DitheringCoverart.jpg"></itunes:image> <atom:link href="" rel="self" type="application/rss+xml"></atom:link> <itunes:owner> <itunes:name>Ben Thompson and John Gruber</itunes:name> <itunes:email>admin@dithering.fm</itunes:email> </itunes:owner> <itunes:author>Ben Thompson and John Gruber</itunes:author> <atomic:instance id="4XZpMcPBGowTRADmCrRVN4" build="bdfa7f29" version="v0.5.21"></atomic:instance> <sy:updatePeriod></sy:updatePeriod> <sy:updateFrequency>0</sy:updateFrequency> <itunes:block>yes</itunes:block> <itunes:explicit>no</itunes:explicit> <itunes:category text="Technology"></itunes:category> </channel> </rss> ``` Not sure what's wrong here but would appreciate any help in looking into this! ### Steps to reproduce the issue 1. See code snippets above for parsing issue. ### Audiobookshelf version 2.6.0 ### How are you running audiobookshelf? Other
adam added the bug label 2026-04-24 23:50:50 +02:00
adam closed this issue 2026-04-24 23:50:51 +02:00
Author
Owner

@nichwall commented on GitHub (Dec 9, 2023):

Is this during an automatic download or when you're manually searching for episodes to download? Does it work for either or are both broken?

@nichwall commented on GitHub (Dec 9, 2023): Is this during an automatic download or when you're manually searching for episodes to download? Does it work for either or are both broken?
Author
Owner

@tomershvueli commented on GitHub (Dec 9, 2023):

@nichwall both. I first noticed that after a few days I wasn't seeing the pods I was expecting to in my feed. Then when I try to manually fetch new pods, I get an error:
Screenshot 2023-12-09 at 9 54 00 AM

@tomershvueli commented on GitHub (Dec 9, 2023): @nichwall both. I first noticed that after a few days I wasn't seeing the pods I was expecting to in my feed. Then when I try to manually fetch new pods, I get an error: ![Screenshot 2023-12-09 at 9 54 00 AM](https://github.com/advplyr/audiobookshelf/assets/1024355/fc1798a7-f714-408d-9d9d-819f2594bd10)
Author
Owner

@advplyr commented on GitHub (Dec 9, 2023):

This is unusual in that the RSS feed is returning a JSON response when no request headers were set. I wasn't actually able to reproduce this in Postman but when I logged the response we were getting from axios it was JSON.
I added Accept: application/rss+xml request header and it is working now

@advplyr commented on GitHub (Dec 9, 2023): This is unusual in that the RSS feed is returning a JSON response when no request headers were set. I wasn't actually able to reproduce this in Postman but when I logged the response we were getting from axios it was JSON. I added `Accept: application/rss+xml` request header and it is working now
Author
Owner

@tomershvueli commented on GitHub (Dec 9, 2023):

Thanks for your prompt responses and action on this issue! I'm looking forward to the next release!

@tomershvueli commented on GitHub (Dec 9, 2023): Thanks for your prompt responses and action on this issue! I'm looking forward to the next release!
Author
Owner

@advplyr commented on GitHub (Dec 24, 2023):

Fixed in v2.7.0

@advplyr commented on GitHub (Dec 24, 2023): Fixed in [v2.7.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.7.0)
Author
Owner

@tomershvueli commented on GitHub (Dec 24, 2023):

Confirmed fixed!

@tomershvueli commented on GitHub (Dec 24, 2023): Confirmed fixed!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1585