0.0.6 • Published 2 years ago

youtube-playlist-getter v0.0.6

Weekly downloads
15
License
MIT
Repository
github
Last release
2 years ago

YouTube Playlist Getter

FOSSA Status

YouTube Playlist Getter is an API wrapper dedicated to getting the videos inside a playlist and returning them in an array.

Installation

npm install youtube-playlist-getter

Usage

You will need to create a .env file in your project folder and inside will be your YouTube API Key, get this API key by creating/logging into a google account by going to: Google Developer Console, creating a project and opting into the YouTube Data API. In the developer console credentials section you should see an API key, copy that and paste it into your .env file like so: YT_API_KEY=8UW0Gnh70xHuBZbs3oHEolo7YpZZIZQNF8mc2Ka

const ytlist = require('youtube-playlist-getter');

ytlist.searchPlaylist('https://www.youtube.com/watch?v=l0U7SxXHkPY&list=PLbpi6ZahtOH7eFIp5Cc15AnhiIdkjgmdC', res => {
    console.log(res);
})

Response

[
  {
    channelName: 'YouTube',
    title: 'Future - Life Is Good (Official Music Video) ft. Drake',
    thumbnails: {
      default: [Object],
      medium: [Object],
      high: [Object],
      standard: [Object],
      maxres: [Object]
    },
    duration: 336,
    url: 'https://youtube.com/watch?v=l0U7SxXHkPY'
  },
  {
    channelName: 'YouTube',
    title: '6IX9INE- GOOBA (Official Music Video)',
    thumbnails: {
      default: [Object],
      medium: [Object],
      high: [Object],
      standard: [Object]
    },
    duration: 149,
    url: 'https://youtube.com/watch?v=pPw_izFr5PA'
  }
]
...

Note

The YouTube API doesn't return a maxres thumbnail for every video, you will need to account for this if you want to use the thumbnails as you will be told "maxres" is undefined.

License

MIT

FOSSA Status

0.0.6

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago