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.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.0.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.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ytb_gears-0.4.0.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.0.tar.gz
Algorithm Hash digest
SHA256 56c2eea5c78b04e0db588c4a217eab3f03d748e9973da44c9d14925b2f7b9baf
MD5 a67585236f325b24f745c4329ea9836f
BLAKE2b-256 73c393243425c528e293a106fb95277a28f8c7479c809e46f5d7d1b3e3531ba9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ytb_gears-0.4.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b94b315e6dda9afc85bdf18a220c75b32a0672e5774f75b3aea24b4345bcb2c6
MD5 a46a9df5ade4a4bf152a0a03d54f432c
BLAKE2b-256 c2388bdfd74dc61c98a8a9114b09dcbbd2d1607f264820d412ff4a667030ed70

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