Skip to content

alincode/youtube-playlist-summary

Repository files navigation

Youtube Playlist Summary

Travis codecov GitHub package version Dependency Status Greenkeeper badge npm downloads

it could help you easy to get all playlists informations.

Requirements

  • node 8.x

Install

$ npm install --save youtube-playlist-summary

Usage

const PlaylistSummary = require('youtube-playlist-summary')
const config = {
  GOOGLE_API_KEY: 'YOUR_GOOGLE_API_KEY', // require
  PLAYLIST_ITEM_KEY: ['publishedAt', 'title', 'description', 'videoId', 'videoUrl'], // option
}

const ps = new PlaylistSummary(config)
const CHANNEL_ID = 'UCQCaS3atWyNHEy5PkDXdpNg'
const PLAY_LIST_ID = 'PL9f8_QifuTL4CS8-OyA-4WADhkddOnRS4'

ps.getPlaylistItems(PLAY_LIST_ID)
  .then((result) => {
    console.log(result)
  })
  .catch((error) => {
    console.error(error)
  })

ps.getPlaylists(CHANNEL_ID)
  .then((result) => {
    console.log(result)
  })
  .catch((error) => {
    console.error(error)
  })

ps.getSummary(CHANNEL_ID)
  .then((result) => {
    console.log(result)
  })
  .catch((error) => {
    console.error(error)
  })

License

MIT © alincode

About

it could help you easy to get all playlists informations.

Resources

License

Stars

Watchers

Forks

Packages

No packages published