Giter Club home page Giter Club logo

python-youtube-uploader's Introduction

YouTube Video Uploader

This Python script allows you to upload videos to YouTube using the YouTube Data API.

Open In Colab

Requirements

This script requires the following Python packages:

  • httplib2
  • google-api-python-client
  • google-auth
  • google-auth-httplib2
  • google-auth-oauthlib

You can install these packages using pip:

pip install -r requirements.txt

How it works

The script uses the Google API client library to interact with the YouTube Data API. It authenticates with Google's OAuth 2.0 service using a client_secrets.json file, which contains the client ID and client secret for your application.

The script first checks if a token file (token.pickle) exists. If it does, it loads the credentials from it. If the token file does not exist or the credentials are invalid, it prompts the user to log in and then saves the credentials for the next run.

The script uses these credentials to build a service object for the YouTube Data API. It then initializes the upload process for each video file in the videos directory. The title, description, category, keywords, and privacy status of the videos can be specified with command line arguments.

The script uses a resumable upload process, which allows it to resume the upload if it is interrupted. It implements an exponential backoff strategy to handle HTTP errors and other exceptions that can be retried.

Usage

To use this script, you need to provide it with a client_secrets.json file from the Google API Console. This file should contain the OAuth 2.0 information for your application, including its client_id and client_secret.

Once you have your client_secrets.json file, you can run the script with the following command:

python upload.py

By default, the script will upload all video files in the videos directory. You can specify the title, description, category, keywords, and privacy status of the videos with command line arguments. For more information on these arguments, run:

python upload.py --help

License

This project is licensed under the terms of the MIT license.

python-youtube-uploader's People

Contributors

bishaldahal avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

enterprisium

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.