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"

    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",
            "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.2.2.tar.gz (16.0 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.2.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ytb_gears-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b3f9391a0a6543e8bc0bd947e5fb4040e084d719c1d0ea097e031579325fd91a
MD5 44794fa1bb2bb36bcadd88a03931dc85
BLAKE2b-256 32ae32791e3a00c0bc9ba294016b396addd80de41635f4412048b2d10e0e0c14

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ytb_gears-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f8d6ef82da916923b1d766a600063dda06eb9b5c2f648608dbe0af8daea25e3
MD5 c30f13724a252837607b2b4b2275a0ef
BLAKE2b-256 83d81cd33188005db3f0fa35e5431773bdfea7ed79c8a0dab87188eb02dcf4f5

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