rbren / rss-parser

A lightweight RSS parser, for Node and the browser
MIT License
1.38k stars 209 forks source link

Multiple enclosure tags get overwritten #254

Open black-hawk85 opened 1 year ago

black-hawk85 commented 1 year ago

I need to parse an RSS to JSON which has multiple enclosure tags within an item

<item>
<title>...</title>
<enclosure url="..." type="..." />
<enclosure url="..." type="..." />
<enclosure url="..." type="..." />
</item>

My resulted JSON Object only has a single enclosure object instead of an array. I tried using keepArray option already but it still happens.

It seems it gets overwritten in parser.js https://github.com/rbren/rss-parser/blob/2ea1d8f901bc804b064798d1a45ca82d984ebbee/lib/parser.js#L214

It's hard coded taking only the first enclosure item

stweiz commented 1 week ago

Did you find another solution @black-hawk85? I want to parse and display images, which are referenced with RSS enclosure.

black-hawk85 commented 1 week ago

Unfortunately I had to use another lib for that.

It works with rss-to-json-v2