Open
Description
FeedParser version: 2.2.9
Node version: 8.10
Problematic feed link: https://feed.pippa.io/public/shows/clublife-by-tiesto
The above link feed includes meta tag below all item tags (shortened):
<?xml-stylesheet type="text/xsl" href="//feed.pippa.io/feed/rss.xslt" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<ttl>60</ttl>
<generator>pippa.io</generator>
<title>
<![CDATA[CLUBLIFE]]>
</title>
<link>http://www.tiesto.com</link>
<atom:link href="//feed.pippa.io/public/shows/clublife-by-tiesto" rel="self" type="application/rss+xml"/>
<language>en</language>
<copyright>Tiësto</copyright>
<itunes:keywords>
<![CDATA[tiesto, clublife, dance, edm, dj]]>
</itunes:keywords>
<itunes:author>Tiësto</itunes:author>
...
<item>
...
</item>
<itunes:category text="Music"/>
</channel>
</rss>
This is how we parse the feed:
const GetFeed = async function(feedUrl) {
return new Promise((resolve, reject) => {
const feedParserInstance = new feedparser();
feedParserInstance.on('error', function(error) {
return reject(error);
});
const feed = {
meta: null,
episodes: []
};
feedParserInstance.on('readable', function() {
const context = this; // `this` is `feedparser`, which is a stream
const episode = context.read();
if (episode != null) {
feed.episodes.push(episode);
} else {
feed.meta = this.meta;
context.destroy();
return resolve(feed);
}
});
request.get(feedUrl)
.on('error', (error) => {
return reject(error);
})
.pipe(feedParserInstance);
});
};
I expected that all tags which are not the tag or are in an tag are included in meta object. This seems to work for all tags above the tags, but doesn't seem to work when a non-item tag is stored below the tags. Because of this the non-item tag (in this case <itunes:category text="Music"/>) can't be retrieved in any way I'm aware of.