Skip to main content

A Python package to interact with YouTube Data API v3.

Project description

YouTube Gears

A Python package for uploading videos to YouTube.

Service Setup

Example

import logging

import tqdm

import ytb_gears


def main():
    logging.basicConfig(level=logging.WARNING)
    logging.getLogger("ytb_gears").setLevel(logging.INFO)

    client_secret_file = "client_secret.json"
    video_path = "test.mp4"
    thumbnail_path = "thumbnail.jpg"

    if ytb_gears.today_already_uploaded(client_secret_file):
        return

    print(f"即将上传视频: {video_path}")

    with tqdm.tqdm(total=100) as pbar:

        def update_progress(progress: float):
            pbar.update(int(progress * 100) - pbar.n)

        ytb_gears.upload(
            video_path,
            client_secret_file,
            "YouTube Gears Test Video",
            thumbnail_path,
            "Uploaded by YouTube Gears",
            ["ytb-gears", "test"],
            "22",
            "unlisted",
            progress_callback=update_progress,
        )


main()

Proxy

import os

os.environ["HTTP_PROXY"] = "http://127.0.0.1:7890"
os.environ["HTTPS_PROXY"] = "http://127.0.0.1:7890"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytb_gears-0.4.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytb_gears-0.4.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file ytb_gears-0.4.1.tar.gz.

File metadata

  • Download URL: ytb_gears-0.4.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.18

File hashes

Hashes for ytb_gears-0.4.1.tar.gz
Algorithm Hash digest
SHA256 fae7a7ddf7f38c1be1fc35602ba9e13eb7d4c3d9af4589a6c860a3a4a7f01864
MD5 32808e0d656a964b4c23bb3038371c98
BLAKE2b-256 2a3fe11deed26576cfb12aedcdae8842028ff9c27fc4265ee8d7fa4353c0ab41

See more details on using hashes here.

File details

Details for the file ytb_gears-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: ytb_gears-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.18

File hashes

Hashes for ytb_gears-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e923707ba3cff81de1d14355f8f5c0ab0fb33a76cb5b9b34ce99c8690ea9befa
MD5 b9182f9d4fe55ffe34d10d186d3dffe5
BLAKE2b-256 d72b8424722d7444a88e7697a2cd7ab1de8cc9259598cdf8b7f9f5fa5e540d85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page