yt-get-info
v0.0.2-development
Published
Get youtube video information
Downloads
6
Readme
yt-get-info
Get youtube video information
Uses the 'ytInitialPlayerResponse' client side variable.
Install
npm install yt-get-info
Usage
import { getVideoInfo } from "yt-get-info";
getVideoInfo("nSnLpFYLgDU").then(data => {
// see VideoDetails object
const { title, author, channelId, viewCount, keywords, shortDescription } = data.videoDetails;
// See CaptionTracks object
const captionsTrackList = data.captions.playerCaptionsTracklistRenderer;
const { captionTracks, audioTracks } = captionsTrackList;
// See PlayerMicroformatRenderer object
const additionnalDetails = data.microformat.playerMicroformatRenderer;
const { category, description, lengthSeconds, publishDate, ownerChannelName, thumbnail, isFamilySafe } = additionnalDetails;
}
);