A Python package to interact with YouTube Data API v3.
Project description
YouTube Gears
A Python package for uploading videos to YouTube.
Service Setup
- https://console.cloud.google.com/apis/library
- YouTube Data API v3
- https://console.cloud.google.com/apis/credentials
- OAuth 2.0 Client ID
- Application type: Desktop App
- Download the client secret file (JSON)
- OAuth 2.0 Client ID
Example
import logging
import tqdm
from ytb_gears import uploader
def main():
logging.basicConfig(level=logging.WARNING)
logging.getLogger("ytb_gears").setLevel(logging.INFO)
credentials_file = "credentials.json"
video_path = "test.mp4"
thumbnail_path = "thumbnail.jpg"
if uploader.today_already_uploaded(credentials_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)
uploader.upload(
video_path,
credentials_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
Release history Release notifications | RSS feed
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.5.1.tar.gz
(23.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytb_gears-0.5.1.tar.gz.
File metadata
- Download URL: ytb_gears-0.5.1.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c7cbc2c13e86db743779f69454e0e66413eb4b2f0ed50d4bfb65bdc9f5619ce
|
|
| MD5 |
8b7789a2c5813f4268b4e1273f90cbb3
|
|
| BLAKE2b-256 |
315555f054ed7450263a09349726910a4f4a10dc02c4c4a5a0beb413feb72cc3
|
File details
Details for the file ytb_gears-0.5.1-py3-none-any.whl.
File metadata
- Download URL: ytb_gears-0.5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8aeb10b470863e58f30cb55459fbed8ed37cfaf937d652ac106cf8c2c1f93b2
|
|
| MD5 |
9eadcd4a679653060aa87513daf0416c
|
|
| BLAKE2b-256 |
e21c2e879105cb58da7a9b9215472fa443002dc7a783f9623de68da541c428bd
|