Coder Social home page Coder Social logo

jbierfeldt / podcast-feed-parser Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 28.0 290 KB

A highly customizable package for fetching and parsing podcast feeds into simple and manageable JavaScript objects. For use with node or in the browser.

License: MIT License

JavaScript 100.00%
feed javascript node parser podcast podcast-client podcast-downloader podcast-fetcher rss

podcast-feed-parser's People

Contributors

dependabot[bot] avatar jbierfeldt avatar jcs224 avatar olikami avatar rubenvaneldik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

podcast-feed-parser's Issues

requiredError is inadequate

When you specify required attributes:

const options = {
  required: {
    episodes: ["title", "pubDate"],
  },
};
const feedData = await podcastFeedParser.getPodcastFromURL(feedUrl, options);

... and the feed is missing some of the required fields:

Error: One or more required values are missing from feed.
    at Object.<anonymous> (/Users/arnab/code/projects/orcalabs/podcast-directory-management-tools/functions/node_modules/podcast-feed-parser/index.js:6:21)

It would be nice to get some more information from the error: such as which field specifically was missing.

Buzzsprout

Love the parser! For some reason it doesn't parse buzzsprout RSS feeds though.

What about converting the JSON back into an RSS?

Title says it all.
What about converting the JSON that is parsed FROM the RSS
Back into an RSS?
So that you can make RSS feeds for podcasts easily without needing to deal with the s***hole that it is.

Thanks!

How to get data which enclosed by itunes

Your package is awesome but i can't extract data from the itunes tags like <itunes:season>1</itunes:season>
<itunes:episode>2</itunes:episode> <itunes:image href="https://d3t3ozftmdmh3i.cloudfront.net/production/podcast_uploaded_episode400/19641917/19641917-1639934020034-37911cf7f913d.jpg"/> . Help me to fix this.. Thank you

Add paginated episodes

Some podcasts have a pagination standard. Here's an example:

<atom:link href="https://changelog.com/podcast/feed" rel="self" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed" rel="first" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed?page=4" rel="last" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed?page=2" rel="next" type="application/rss+xml"/>

Page 2 looks like this:

<atom:link href="https://changelog.com/podcast/feed" rel="self" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed" rel="first" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed?page=4" rel="last" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed?page=1" rel="previous" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed?page=3" rel="next" type="application/rss+xml"/>

Last page:

<atom:link href="https://changelog.com/podcast/feed" rel="self" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed" rel="first" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed?page=4" rel="last" type="application/rss+xml"/>
<atom:link href="https://changelog.com/podcast/feed?page=3" rel="previous" type="application/rss+xml"/>

This particular podcast is actually not quite correct (rel="self" should indicate the current page, this one just lists the first page all the time) but there is enough metadata to handle pagination correctly, i.e. by checking for the presence of a rel="next" on each page.

Fails if category is missing

If Category is missing from podcast file, parsing fails

TypeError: Cannot read property 'map' of undefined
    at categories (/node_modules/podcast-feed-parser/index.js:172:53)
    at exports.getInfo (/node_modules/podcast-feed-parser/index.js:291:36)
    at options.fields.meta.forEach (/node_modules/podcast-feed-parser/index.js:314:18)
    at Array.forEach (<anonymous>)
    at createMetaObjectFromFeed (/node_modules/podcast-feed-parser/index.js:306:23)
    at Object.exports.getPodcastFromFeed (/node_modules/podcast-feed-parser/index.js:464:18)

Example of RSS that breaks : https://api.octopus.saooti.com/rss/emission/63

Since Atom:category is optional, it should work without

How to specify nested attr (e.g., enclosure.url) as required?

I want to specify enclosure.url as a required property for episodes. How can I do that? If I specify:

    const options = {
      required: {
        episodes: ["title", "pubDate", "enclosure.url"],
      },
    };

It fails with Error: One or more required values are missing from feed.

How can I specify nested attributes such as enclosure.url as required?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.