https://github.com/richienb/youtube-rss
Fetch YouTube RSS feeds
https://github.com/richienb/youtube-rss
Last synced: 9 months ago
JSON representation
Fetch YouTube RSS feeds
- Host: GitHub
- URL: https://github.com/richienb/youtube-rss
- Owner: Richienb
- License: mit
- Created: 2022-11-11T08:11:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-11T08:18:03.000Z (about 3 years ago)
- Last Synced: 2025-04-23T01:55:30.120Z (9 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# youtube-rss
> Fetch YouTube RSS feeds
## Install
```sh
npm install youtube-rss
```
## Usage
```js
import {getChannelFeed, getPlaylistFeed} from 'youtube-rss';
// https://www.youtube.com/channel/UCj5i58mCkAREDqFWlhaQbOw
const channel = await getChannelFeed('UCj5i58mCkAREDqFWlhaQbOw');
//=> {title: 'stampylonghead', created: 2011-07-29T21:55:17.000Z, videos: [{…}]}
// https://www.youtube.com/playlist?list=PLZRRxQcaEjA4qyEuYfAMCazlL0vQDkIj2
const playlist = await getPlaylistFeed('PLZRRxQcaEjA4qyEuYfAMCazlL0vQDkIj2');
//=> {title: 'Mind Field : Season 1', creator: {title: 'Vsauce', channelId: 'UC6nSFpj9HTCZ5t-N3Rm3-HA'}, created: 2017-01-06T19:35:33.000Z, videos: [{…}]}
```
## API
### getChannelFeed(channelId, options?)
Returns `Promise`.
### getPlaylistFeed(playlistId, options?)
Returns `Promise`
#### options
Options for [`ky`](https://github.com/sindresorhus/ky/tree/v0.32.2#options).
### ChannelFeed
#### title
Type: `string`
#### created
Type: `Date`
#### videos
Type: `Array`
### PlaylistFeed
#### title
Type: `string`
#### creator
Type: `ChannelInfo`
#### created
Type: `Date`
#### videos
Type: `PlaylistVideo[]`
### ChannelVideo
#### id
Type: `string`
#### title
Type: `string`
#### published
Type: `Date`
#### updated
Type: `Date`
#### thumbnail
Type: `ThumbnailInfo`
#### description
Type: `string`
#### likes
Type: `BigInt`
#### views
Type: `BigInt`
### PlaylistVideo extends ChannelVideo
#### creator
Type: `ChannelInfo`
### ThumbnailInfo
#### url
Type: `string`
#### width
Type: `BigInt`
#### height
Type: `BigInt`