rbren / rss-parser

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

Library returning incorrect href #269

Open raizadattn opened 7 months ago

raizadattn commented 7 months ago

I have observed, sometimes a rss feed contains multiple href links ( atom:link ), some of them redirects to new feedUrl, but some of those are invalid ( link type as 'text/html' ) .

Since the library returns only the first href based on the code below, how can we get ( or parse and check) , the rest of the href urls?

For ex - i parsed url1, it contains two hrefs, url2 ( incorrect as it its type is 'text/html' ), and url3 ( new correct one), but the library will return url2, how can i reach url3 and update the new episodes and podcast metadata?

      if (channel['atom:link'] && channel['atom:link'][0] && channel['atom:link'][0].$) {
        feed.feedUrl = channel['atom:link'][0].$.href;
      }