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
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
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.2.2.tar.gz
(16.0 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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3f9391a0a6543e8bc0bd947e5fb4040e084d719c1d0ea097e031579325fd91a
|
|
| MD5 |
44794fa1bb2bb36bcadd88a03931dc85
|
|
| BLAKE2b-256 |
32ae32791e3a00c0bc9ba294016b396addd80de41635f4412048b2d10e0e0c14
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f8d6ef82da916923b1d766a600063dda06eb9b5c2f648608dbe0af8daea25e3
|
|
| MD5 |
c30f13724a252837607b2b4b2275a0ef
|
|
| BLAKE2b-256 |
83d81cd33188005db3f0fa35e5431773bdfea7ed79c8a0dab87188eb02dcf4f5
|