BaroTube Module is a Node.js module used to interact with the BaroTube API.
shell
npm install barotube-module
`
Usage
`javascript
const BaroTube = require('barotube-module');
const myBaroTube = new BaroTube('my-api-key');
// Example of YouTube Video search
myBaroTube.searchVideos('YouTube URL', (err, videos) => {
if (err) {
console.error(err);
} else {
console.log(videos);
}
});
// Example of getting a YouTube Playlist
myBaroTube.getPlaylist('YouTube URL', (err, playlist) => {
if (err) {
console.error(err);
} else {
console.log(playlist);
}
});
`
Example searchVideo DATA
`js
[
{
title: '',
videoId: '',
url: '',
duration: '',
durationMs: 0,
views: 0,
author: {
name: '',
url: ''
},
thumbnail: ''
},
{
title: '',
videoId: '',
url: '',
duration: '',
durationMs: 0,
views: 0,
author: {
name: '',
url: ''
},
thumbnail: ''
},
and 8 more...
]
`
Example getPlaylist DATA
`js
[
{
id: '',
url: '',
title: '',
videos_size: '',
views: 0,
last_updated: '',
author: {
id: '',
name: '',
avatar: '',
url: ''
}
},
videos: [
{
title: '',
videoId: '',
url: '',
duration: '',
durationMs: 0,
views: 0,
author: {
name: '',
url: ''
},
thumbnail: ''
},
and more...
]
]
`
API Key
When creating an instance of the BaroTube` class, you need to provide an API key. This key is used to authenticate with the BaroTube API.