Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@alufi/ytsr

alufibot28MIT1.0.1TypeScript support: included

A ytsr fork. Made for Alufi Bot Utility

youtube, search

readme

node-ytsr

A light-weight ytsr for Alufi Bot.

Forked from ytsr.

Feature

  • Search for videos on YouTube

Usage

const ytsr = require('@alufi/ytsr');

ytsr('videoName', { safeSearch: true, limit: 1 }).then(result => {
    let song = result.items[0];
    console.log('ID: ' + song.id);
    console.log('Name: ' + song.name);
    console.log('URL: ' + song.url);
    console.log('Views: ' + song.views);
    console.log('Duration: ' + song.duration);
    console.log('Live: ' + song.isLive);
})

/*
ID: videoId
Name: videoName
URL: videoURL
Views: videoViews
Duration: videoDurationMs
Live: videoIfLive (Boolean: false/true)
*/