npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yt-url-parser

v1.0.1

Published

Gets stream url from youtube link. An updated fork of https://github.com/dangdungcntt/youtube-stream-url

Downloads

11

Readme

yt-url-parser

Gets stream url and other video details from youtube video link.

Installation

With npm do:

npm install yt-url-parser

Usage

const Youtube = require('yt-url-parser');

Youtube.getInfo({url: 'https://www.youtube.com/watch?v=9dLKZZN5tSo'})
  .then(video => console.log(video));
  
  /* video
  { videoDetails:
   { videoId: '9dLKZZN5tSo',
     title: 'Ratan Tata Award Winning Speech with BIG Subtitles',
     lengthSeconds: '263',
     keywords:
      [ 'with big subtitles',
        'ratan tata',
        'ratan tata speech',
        'award winning speech',
        'subtitles' ],
     channelId: 'UCC4gyz11gwCkHaVeuO366tg',
     isOwnerViewing: false,
     shortDescription:
      'Ratan Tata\'s speech from Automotive Hall of Fame. 2015 Induction & Awards Gala Ceremony.\n\nHit Like if you found this video helpful.\nComment if not and please let me know how I can improve.\n\nSubscribe for more videos.\n\nWatch Mahua Moitra Parliament Speech with BIG Subtitles:\nhttps://www.youtube.com/watch?v=vzHRBfPl-6Y&',
     isCrawlable: true,
     thumbnail: { thumbnails: [Array] },
     averageRating: 4.9388342,
     allowRatings: true,
     viewCount: '11302491',
     author: 'wow! Rao',
     isPrivate: false,
     isUnpluggedCorpus: false,
     isLiveContent: false },
  formats:
   [ { itag: 18,
       url:
        'https://r1---sn-u5u5n3tpo-w5pe.googlevideo.com/videoplayback?expire=1624291230&ei=PmPQYL6ECOOnz7sPr46biAw&ip=103.22.143.86&id=o-ALjbtirD0bhem-K_FM86suDfgUAxZ3nQwf43Wj7KOvyr&itag=18&source=youtube&requiressl=yes&mh=M6&mm=31%2C29&mn=sn-u5u5n3tpo-w5pe%2Csn-cvh7knek&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1220000&vprv=1&mime=video%2Fmp4&ns=WXFASK-dqNc5hSPn0peRk44F&gir=yes&clen=11791564&ratebypass=yes&dur=262.664&lmt=1579534842937206&mt=1624269421&fvip=1&fexp=24001373%2C24007246&c=TVHTML5&txp=5531432&n=bS-tw8BRTggvXBqCS&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRAIgGz---ma3Tj1PrTWRK_4X854q_CNQmOnxP8e5Vbo4sisCIANTvP8wOA7NuJNbApt4dFFXtQ_sfK_STfmeqGq9mLzV&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAISuLs7gb247_LQuhcZ81y_ebL3TzU9ebMXGh7oFt_BHAiA2Bdh1kzJd0b-RlENb6ZmXnqaytlLg-7ijhh3xDLv4Vg%3D%3D',
       mimeType: 'video/mp4; codecs="avc1.42001E, mp4a.40.2"',
       bitrate: 359231,
       width: 640,
       height: 360,
       lastModified: '1579534842937206',
       contentLength: '11791564',
       quality: 'medium',
       fps: 30,
       qualityLabel: '360p',
       projectionType: 'RECTANGULAR',
       averageBitrate: 359137,
       audioQuality: 'AUDIO_QUALITY_LOW',
       approxDurationMs: '262664',
       audioSampleRate: '44100',
       audioChannels: 2 },
     { itag: 22,
       url:
        'https://r1---sn-u5u5n3tpo-w5pe.googlevideo.com/videoplayback?expire=1624291230&ei=PmPQYL6ECOOnz7sPr46biAw&ip=103.22.143.86&id=o-ALjbtirD0bhem-K_FM86suDfgUAxZ3nQwf43Wj7KOvyr&itag=22&source=youtube&requiressl=yes&mh=M6&mm=31%2C29&mn=sn-u5u5n3tpo-w5pe%2Csn-cvh7knek&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1220000&vprv=1&mime=video%2Fmp4&ns=WXFASK-dqNc5hSPn0peRk44F&cnr=14&ratebypass=yes&dur=262.664&lmt=1579535599211760&mt=1624269421&fvip=1&fexp=24001373%2C24007246&c=TVHTML5&txp=5535432&n=bS-tw8BRTggvXBqCS&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAKDgHTcU_JGA8k0sf1rOIIQpjrsocOYZHL3-RrhMqxXFAiA7_qc76juvOqoFU6GBJBbrsb4m1QgGqhMR3lsyRA3YXA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAISuLs7gb247_LQuhcZ81y_ebL3TzU9ebMXGh7oFt_BHAiA2Bdh1kzJd0b-RlENb6ZmXnqaytlLg-7ijhh3xDLv4Vg%3D%3D',
       mimeType: 'video/mp4; codecs="avc1.64001F, mp4a.40.2"',
       bitrate: 346914,
       width: 1280,
       height: 720,
       lastModified: '1579535599211760',
       quality: 'hd720',
       fps: 30,
       qualityLabel: '720p',
       projectionType: 'RECTANGULAR',
       audioQuality: 'AUDIO_QUALITY_MEDIUM',
       approxDurationMs: '262664',
       audioSampleRate: '44100',
       audioChannels: 2 },
  */

Credits

This project is a fork of https://github.com/dangdungcntt/youtube-stream-url/ and just tweaks some query parameters.