1.1.5 • Published 6 years ago

youtube-parser-enhanced v1.1.5

Weekly downloads
6
License
MIT
Repository
github
Last release
6 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

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago