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

v0.3.2

Published

Get lastest videos of your YouTube subscriptions.

Downloads

97

Readme

yt

Get lastest videos of user subscriptions in a faster way. (using cookie)

Why not use YouTube's APIv3? The APIv3 does not provide a direct method to do this. You have to get recent uploads of each subscription and sort them by date manually. It is very inefficient.

Command

If you installed yt globally, you can open your YouTube subscription videos from terminal. Requires livestreamer and VLC player. Currently works on Mac OS X, Linux, Windows.

pip install livestreamer
npm -g i yt
yt

By default, yt will store your cookie and cache file in ~/.config/yt/.

Run yt -h for available command-line options.

Usage

  • :leftwards_arrow_with_hook: (Enter) Play / Stop video
  • :arrow_forward: (Right / Tab / Space) Show details
  • :arrow_backward: (Left / Backspace / Esc) Back to list
  • :arrow_up_small::arrow_down_small: Scroll up / down
  • :arrow_double_up::arrow_double_down: (Shift) Page up / down
  • :arrow_double_up::arrow_double_down: Show details of prev / next video
  • :arrow_up_down: (Shift) Home / End

API

var yt = require('yt');

// How to get cookie:
// 1. Open Google Chrome and right click the page and select Inspect Element.
// 2. Go to https://www.youtube.com/, log in if you don't have.
// 3. In Networks tab, click Documents and right click the first item in the
//    list and click Copy as cURL.
// 4. Copy the values of SID, HSID, SSID, LOGIN_INFO.
var cookie = {
  "SID": "",
  "HSID": "",
  "SSID": "",
  "LOGIN_INFO": ""
};

// Or you can directly assign the copied string to the cookie variable:
// var cookie = "curl 'https://www.youtube.com/' ... ";

// yt.subscription.get(pages <number/array>, cookie <object/string>)
// returns a Q promise;

yt.subscription.get(1, cookie).then(function(videos) {});

// or page 1 to 5:
yt.subscription.get([1,2,3,4,5], cookie).then(function(videos) {
  console.log(videos);
});

Example output:

[ { duration: '3:33',
    live: false,
    verified: true,
    description: 'This is the way salad is supposed to evolve...',
    userurl: 'https://www.youtube.com/user/EpicMealTime',
    username: 'Epic Meal Time',
    id: 'wfIAjuxbfr4',
    url: 'https://www.youtube.com/watch?v=wfIAjuxbfr4',
    thumbnails: {
      default: 'https://i.ytimg.com/vi/wfIAjuxbfr4/default.jpg',
      hqdefault: 'https://i.ytimg.com/vi/wfIAjuxbfr4/hqdefault.jpg',
      mqdefault: 'https://i.ytimg.com/vi/wfIAjuxbfr4/mqdefault.jpg',
      sddefault: 'https://i.ytimg.com/vi/wfIAjuxbfr4/sddefault.jpg',
      maxresdefault: 'https://i.ytimg.com/vi/wfIAjuxbfr4/maxresdefault.jpg'
    },
    title: 'Poultry Salad - Epic Meal Time',
    time: '3 hours ago',
    views: '15,804 views' },
...
]