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

adanjz-youtube

v1.0.1

Published

This project allows users to upload videos to YouTube using the YouTube Data API v3. It consists of two main parts:

Downloads

2

Readme

YouTube Video Uploader

This project allows users to upload videos to YouTube using the YouTube Data API v3. It consists of two main parts:

  1. Index.js: The core script responsible for uploading videos to YouTube once it has the necessary credentials.
  2. Server.js: A simple Express server used to obtain the OAuth 2.0 refresh token which can then be used by index.js for uploading videos without requiring re-authentication.

Prerequisites

  1. Node.js installed on your machine.
  2. A YouTube account.
  3. A project set up on the Google Developers Console with the YouTube Data API v3 enabled and OAuth 2.0 credentials generated for a web application.

Setup & Installation

  1. Clone this repository:

    git clone https://github.com/adanzweig/nodejs-youtube.git
  2. Navigate to the project directory and install the required npm packages:

    cd nodejs-youtube
    npm install
  3. Create a .env file in the root directory and populate it with your OAuth 2.0 credentials:

    CLIENT_ID=YOUR_CLIENT_ID
    SECRET_ID=YOUR_CLIENT_SECRET
    REDIRECT_URL=YOUR_REDIRECT_URL
    # REFRESH_TOKEN will be populated later
  4. Run the server.js file to start the Express server and obtain the refresh token:

    node server.js
  5. Navigate to http://localhost:3000/auth in your browser to start the authentication process. Once authenticated, the refresh token will be displayed in the console. Copy and paste this token into the .env file as the value for REFRESH_TOKEN.

  6. Now that you have the refresh token, you can use index.js to upload videos to YouTube:

    node index.js

Usage

server.js

This file's main purpose is to facilitate obtaining the refresh token. Once you have the refresh token, you don't need to run this file often unless you need a new token.

index.js

Modify the parameters in the uploadVideo function call at the bottom of the file to fit your video's details. Then, run the script to upload the video to YouTube.

Security

Always ensure that your .env file is included in your .gitignore to prevent unintentional sharing of sensitive credentials.