1.1.5 • Published 5 years ago

youtube-parser-enhanced v1.1.5

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

youtube-parser

A tool to extract URLs and format info from YouTube page. This is almost based on the node-ytdl-core by @fent and youtube-parser npm package, it just adds the player url and sts to the info returned by the command.

##Install

$ npm install -g youtube-parser-enhanced

##CLI

Usage:
  $ youtube-parser url [options]

Examples:
  $ youtube-parser-enhanced https://www.youtube.com/watch?v=C_vqnySNhQ0 --container mp4
  $ youtube-parser-enhanced https://youtu.be/C_vqnySNhQ0 --quality medium

Options:
  -h, --help           Print help
  -v, --version        Print version
  -d, --dump           Print the whole metadata (including metadata other than URLs.)
  -q, --quality        List URLs of video with the specified quality {small | medium | large}
  -c, --container      List URLs of video with the specified container format {mp4 | webm | flv | 3gp}
  -e, --encoding       List URLs of video with the specified video encoding {VP8 | H.264 | Sorenson H.283 | MPEG-4 Visual}
  -a, --audioEncoding  List URLs of video with the specified audio encoding {mp3 | aac | vorbis}
  --videoOnly          List URLs of video that consists of only a video track
  --audioOnly          List URLs of video that consists of only an audio track

##API

getMetadata

Promise getMetadata(string url)
  • url - 'watch video' page on YouTube.
  • return value - A promise object to resolve with an object containing actual URLs and format info of the page's video.

getURL

Promise getURL(string url, object format)
  • url - 'watch video' page on YouTube.
  • format - Desired format of the video.
  • return value - A promise object to resolve with an array of URL/format info objects that matche the requested format.

###Example

var youTubeParser = require('youtube-parser-enhanced');

youTubeParser.getMetadata('https://www.youtube.com/watch?v=C_vqnySNhQ0')
.then(
  function (metadata) {
    // Access video info.
    console.log(metadata.keywords);
  }
);

youTubeParser.getURL('https://youtu.be/C_vqnySNhQ0', {quality: 'medium', container: 'mp4'})
.then(
  function (urlList) {
    // Access URLs.
    console.log(urlList[0]);
  }
);
1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago