1.1.8 • Published 4 years ago

yutub v1.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago
const { YouTube } = require('yutub');
// or using ES6 Modules
import { YouTube } from 'yutub';

const youtube = new YouTube();

youtube.searchVideos('RADAL')
  .then(videos => {
    videos.forEach(video => console.log(video.title));
  }).catch(console.error);

🦕 Deno version (Under construction)

Table of contents

Instalation

$ npm i yutub
# or using yarn
$ yarn add yutub

Classes

YouTube

Get a YouTube video with ID or URL.

<YouTube>.getVideo(idOrURL: string): Promise<YouTubeVideo>

Example

<YouTube>.getVideo('N_8PCKLjJJ4')
  .then(video => console.log(video.likes))
  .catch(console.error);

// or usign YouTube video URL

<YouTube>.getVideo('https://www.youtube.com/watch?v=YQQ4B0nERgk')
  .then(video => console.log(video.likes))
  .catch(console.error);

Get a YouTube playlist with ID or URL.

<YouTube>.getPlaylist(idOrURL: string): Promise<YouTubePlaylist>

Example

<YouTube>.getPlaylist('PLQkoKTppclIub0WqgTq8Ereq-AlHgwdmI')
  .then(console.log)
  .catch(console.error);

// or usign YouTube playlist URL

<YouTube>.getPlaylist('https://www.youtube.com/playlist?list=PLvyTxJxuNWd5rIWuMJzotDqf-Z3dIrmHk')
  .then(console.log)
  .catch(console.error);

Search for videos on YouTube.

<YouTube>.searchVideos(value: string, searchLimit?: number): Promise<Array<YouTubeVideoSearch>>

Example

<YouTube>.searchVideos('PewDiePie')
  .then(videos => {
    videos.forEach(video => console.log(video.title));
  }).catch(console.error);

ToDo

  • Deno support - Repo.
  • <YouTube>.getChannel() function.

Issues

If you found a bug or want to make a suggestion, open an issue.

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago