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-unlimited

v1.0.1

Published

<p align="center"> <img src="https://janusmarcin.pl/icon.svg"/> </p>

Downloads

3

Readme

Youtube Unlimited

JavaScript tool which allows you to upload videos bypassing youtube API limit of 6 uploads per 24h.

Getting Started

This script uses headless browser to run tasks, so you need few things to make it work first.

Requirements

  1. Install FireFox on your machine.
  2. Download Geckodriver and add it your system PATH

Installation

You can use it as a regular package:

npm install yt-unlimited

Or you can clone this repo to run it from CLI

First Run

If you are running this script for the first time it will ask you to login on YouTube.

FireFox window should open:

  1. Please navigate to youtube.com if not redirected already.
  2. Login to your account.
  3. Do not close the browser.
  4. When successfully logged in go back tour terminal and press Enter.
  5. File youtube_cookies.json should be created. Read important note below.

If you have problems with youtube login like for ex. "This browser is not secure" try navigate to other site with google auth (https://stackoverflow.com/ will do) login via google and navigate back to youtube. You should be logged in. You can now press enter in your terminal.

IMPORTANT

Do not share youtube_cookies.json file with anybody or do not add it to any git repo. This is your youtube account credentials for authentication.

Usage

YTUnlimited function returns promise with video id.

NPM Package

import YTUnlimited from 'yt-unlimited';

YTUnlimited('video.mp4', {
  VIDEO_TITLE: 'Video Title',
  VIDEO_DESCRIPTION: 'Video Description',
  VIDEO_VISIBILITY: 'PRIVATE',
  VIDEO_MADE_FOR_KIDS: false,
  VIDEO_CATEGORY: 'CREATOR_VIDEO_CATEGORY_PETS',
  VIDEO_TAGS: ['cats', 'pets'],
});

CLI

node dist/index.js video.mp4

For video details edit /dist/video_metadata.json file.

Options

type ConfigType = {
  VIDEO_TITLE: string;
  VIDEO_DESCRIPTION: string;
  VIDEO_VISIBILITY: 'PUBLIC' | 'UNLISTED' | 'PRIVATE';
  VIDEO_MADE_FOR_KIDS: boolean;
  VIDEO_CATEGORY: VideoCategoriesType;
  VIDEO_TAGS: string[];
}

enum VideoCategoriesType {
  Film = 'CREATOR_VIDEO_CATEGORY_FILM',
  Autos = 'CREATOR_VIDEO_CATEGORY_AUTOS',
  Music = 'CREATOR_VIDEO_CATEGORY_MUSIC',
  Pets = 'CREATOR_VIDEO_CATEGORY_PETS',
  Sports = 'CREATOR_VIDEO_CATEGORY_SPORTS',
  Travel = 'CREATOR_VIDEO_CATEGORY_TRAVEL',
  Gadgets = 'CREATOR_VIDEO_CATEGORY_GADGETS',
  People = 'CREATOR_VIDEO_CATEGORY_PEOPLE',
  Comedy = 'CREATOR_VIDEO_CATEGORY_COMEDY',
  Entertainment = 'CREATOR_VIDEO_CATEGORY_ENTERTAINMENT',
  News = 'CREATOR_VIDEO_CATEGORY_NEWS',
  HowTo = 'CREATOR_VIDEO_CATEGORY_HOWTO',
  Education = 'CREATOR_VIDEO_CATEGORY_EDUCATION',
  Science = 'CREATOR_VIDEO_CATEGORY_SCIENCE',
  Goverment = 'CREATOR_VIDEO_CATEGORY_GOVERNMENT',
}

StepByStep Installation on Ubuntu 18.04

Install FireFox

sudo apt install firefox

Install Geckodriver

  1. Go to Geckodriver repo check latest release number in my case it is 0.28.0 and download it with command for example:
  2. wget https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-linux64.tar.gz
  3. Extract: tar -xvzf geckodriver*
  4. Make it executable: chmod +x geckodriver
  5. Move it to your PATH folder: sudo mv geckodriver /usr/local/bin/

Clone this repo and run npm install

git clone https://github.com/schriker/yt-unlimited.git
npm install

Run

Before uploading video you have to be authenticated youtube user. Please check First Run section for more details. If you are running this script on remote server via SSH it will throw an error trying to open browser. Solution is to run this script first on your local machine (where browser can be opened and you can log in) to obtain youtube_cookies.json file and then copy that file to your remote server.

node dist/index.js video.mp4

Docker

You can mount your cookies and video file in docker-compose.yaml:

    volumes: 
      - ./video.mp4:/home/app/video.mp4
      - ./youtube_cookies.json:/home/app/youtube_cookies.json

And run to start conatiner and upload video:

docker-compose up