Skip to content

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

License

Notifications You must be signed in to change notification settings

Qwerty1Verified/Youtube-Playlist-Getter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published