@elara-services/youtube-videos
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Getting Started

const { YouTubeVideos } = require("@elara-services/youtube-videos"),
        youtube = new YouTubeVideos();

Add Creators

// Adding a single creator     
youtube.creators.add("UCzEnk4KWFlSj_PjXLz0"); // Adds the channelID to the 'data' set


// Bulk adding creators
youtube.creators.bulk([
    "UCzEnk4KWFlSj_PjXLz0",
    "UC....",
    "UC.....", 
]);
// Adds all of the channelIDs to the 'data' set.

Remove Creator

youtube.creators.remove("UCzEnk4KWFlSj_PjXLz0"); // Remove the channelID from the 'data' set

List Creators

youtube.creators.list(); // Returns an array of channelIDs

Set Interval/Search Minutes

youtube.setSearch(1); // The interval will be 1 minute
// DEFAULT: 2 minutes

Listen to video announcements

youtube.listen("video", async (channelID, videos) => {
    // Code to do whatever when a new video is found. 
    // channelID: the creator's channelID
    // videos: The array of videos found for the user.
});

Listen to searching creators for videos

youtube.listen("searching", async (channels) => {
    // Code to do whatever when this event gets triggered. 
    // Channels: the array of creator channelIDs
});

Start the process

youtube.run();

Get More Information for videos

const { util: { fetchVideos } } = require("@elara-services/youtube-videos");

// `[ ... ]` provide the video IDs in an array!
const videos = await fetchVideos([ ... ], "YOUTUBE_API_KEY");
// Array of videos found

Package Sidebar

Install

npm i @elara-services/youtube-videos

Weekly Downloads

2

Version

1.1.1

License

ISC

Unpacked Size

11 kB

Total Files

5

Last publish

Collaborators

  • elara-services