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

apilessyt

v0.3.18

Published

A library that lets you upload youtube videos without the use of the official youtube api

Downloads

34

Readme

APILESSYT

With this module you can interact with youtube, without the use of the official Youtube API.

But why would you do that?

Google APIs are unnecessarily complex and often come with limitations, such as no public Videos until Google reviewed your app, or a limitation in the number of comments.

How does it work?

Instead of using the api, we simply use puppeteer, a headless browser, to upload it via the youtube webpage.

Important notice

By using this package you are violating the YouTube TOS and you may get banned, I do not take responisibilty for any bans that occur by using this package. However the risk of a ban is slim to none and so far no banned accounts have been reported, even when acting suspiciously during testing.

Also there may appear some bugs if your internet is to slow, those will get fixed in future updates.

Usage

Requireing and methods

Simply require the module with

const yt = require('apilessyt')

before using any methods you must login to your youtube account.

await yt.login({
    name: GOOGLE_EMAIL_OR_PHONE,
    password: GOOGLE_PASSWORD,
    twofa: false //set this to true if you are using 2FA to login to Google
})

after you are logged in you can use any methods curently available. Your caches should get saved so you only have to login once.

to upload a video just call the upload function with the given specs.

await yt.upload(specs)

You can also clear your cache by executing

await yt.reset();

To toggle the pupeteer visibility use

yt.setHead(boolean);

To increase (or decrease) the delay between button presses

setDefaultDelayMultiplier(number)

Additional features like, writing comments, etc. may follow in the future

Specs

The specs are simply an Object with the desired options.

Upload Specs

These are the specs with all current available functions. They get parsed and check beforehand, this method is not thoroughly yet though. If the bot crashes because of bad specs, you are left with a draft on your youtube account.

{
    channelId: string;                      // Your Channel ID
    video: string;                          // Filepath to the video
    pageOne: {
        title: string;
        description?: string;
        thumb?: string;                      // Filepath to the Thumbnail
        playlists?: string[];                // Write the name of the (existing)playlists you want to add your video to as a string array
        madeForKids?: boolean;
        restrictForAdultsOnly?: boolean;
        paidPromotion?: boolean;
        allowAutomaticChapters?: boolean;
        tags?: string[];                    // Write any tags as an array of strings
    };
    pageTwo?: {
        endcard?: {
            enabled: boolean;
            import: boolean;                // If the endcard should be imported from another video
            importId?: string;              // Defines the videoId of the video where the endcard will be imported from (you can also use the video name)
            type?: endcard;                 // Type of the endcard, see types, only needs to be set if you dont import
        };
        cards?: {
            enabled: boolean;
            type: card;                     // See types
            name: string;                   // name or (reccomended)id of the video/playlist/channel,
            message?: string;
            teaser?: string;
            anyVideo?: boolean;             // Only search your own Videos, or search for any Video on YouTube
        };
    };
    pageThree?: {};
    pageFour: {
        visibility: visibility;             // See types
        instantPremiere?: boolean;
    };
    creatorComment?: {                      // You can also add an creator comment to your uploaded video
        text: string;
        pin?: boolean;
    };
}

Types

You can import the enums for visibility, cards, etc. with this line.

const types = yt.types;
enum endcard {
    T1 = 1,
    T2 = 2,
    T3 = 3,
    T4 = 4,
    T5 = 5,
    T6 = 6,
}

enum card {
    VIDEO = 2,
    PLAYLIST = 3,
    CHANNEL = 4,
    LINK = 5,
}

enum visibility {
    PRIVATE = "PRIVATE",
    UNLISTED = "UNLISTED",
    PUBLIC = "PUBLIC",
}

Additional Information

This is an very early version, some features may be buggy, especially with slow internet.

Future Features

  • Any setting that is available when uploading to youtube
  • Additional features like returning the upload link/other data
  • Wrting comments on different videos

(Please excuse the messy code, i will clean up in the future 👉👈)