Skip to content

Repository files navigation

BITS YouTube Automation

BITS YouTube Automation Ready

Automate YouTube Studio draft processing, thumbnail upload, and scheduling for recurring video workflows


Python Playwright Docker Makefile License Internal


✨ Features

Feature Description
Draft Automation Process YouTube Studio draft videos in sequence
Reuse Previous Details Copy title, description, and settings from the previous video
Episode Renumbering Automatically update episode numbers in title and description
Thumbnail Upload Pick cover images from thumbnails/
Thumbnail Generator Generate numbered thumbnails directly from PNG templates
Scheduled Publish Set publish date based on the previous video
Playlist Card Setup Configure end screen and playlist cards
Monetization Flow Handle monetization and ad rating settings
User-friendly Logs Emoji, colors, progress, and summary report
Native + Docker Run via bash, Makefile, or Docker

πŸ› οΈ Tech Stack

Layer Technology
Language Python 3.11+
Automation Playwright
UI / CLI argparse, terminal logging
Imaging Pillow
Packaging venv, pip, Makefile, Docker Compose

πŸ“ Project Structure

BITS-YouTube-Automation/
β”œβ”€β”€ main.py                  # CLI entry point + automation flow
β”œβ”€β”€ core/                    # Core logic
β”‚   β”œβ”€β”€ config.py            # Load + validate config
β”‚   β”œβ”€β”€ helpers.py           # Date, file, and network-wait helpers
β”‚   β”œβ”€β”€ logger.py            # Logging utility
β”‚   β”œβ”€β”€ runner.py            # Draft orchestration
β”‚   β”œβ”€β”€ schedule.py          # Publish schedule step
β”‚   β”œβ”€β”€ selectors.py         # YouTube Studio UI selectors
β”‚   β”œβ”€β”€ studio.py            # Playwright interaction abstraction
β”‚   └── steps/               # Feature-specific steps
β”œβ”€β”€ templates/               # Thumbnail PNG templates
β”œβ”€β”€ thumbnails/              # Generated thumbnails
β”œβ”€β”€ profile/                 # Browser login session
β”œβ”€β”€ logs/                    # Logs and error screenshots
β”œβ”€β”€ docs/                    # Setup, usage, troubleshooting
β”œβ”€β”€ tests/                   # Unit tests
β”œβ”€β”€ setup.sh / run.sh        # Native scripts
β”œβ”€β”€ Makefile                 # Developer shortcuts
β”œβ”€β”€ Dockerfile               # Container image
└── docker-compose.yml       # Local container run

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • Google Chrome or Chromium
  • A YouTube Studio account

Install

git clone https://github.com/Banten-IT-Solutions/BITS-YouTube-Automation.git
cd BITS-YouTube-Automation
bash setup.sh

Login

bash run.sh login

Log in manually in browser, then press Enter in terminal. Session is stored in profile/.

Test 1 Draft

bash run.sh test

Run Automation

bash run.sh run 5
bash run.sh run

Generate Thumbnail

python main.py thumbnail --list
python main.py thumbnail risalatul-maymuniyah 135 137
python main.py thumbnail --tui

Docker

docker-compose build
docker-compose run --rm bits-youtube-automation python main.py login
docker-compose run --rm bits-youtube-automation python main.py run --limit 5

πŸ’» Development

Scripts

Command Description
bash setup.sh Set up venv, dependencies, and Chromium
bash run.sh login Log in to YouTube Studio
bash run.sh test Test 1 draft
bash run.sh run [N] Run N drafts
bash run.sh status Check setup status
python main.py thumbnail --list List thumbnail templates
python main.py thumbnail <template> <start> <end> Generate thumbnails
make setup Set up via Makefile
make test Test 1 draft via Makefile
make run LIMIT=5 Run 5 drafts via Makefile

Documentation

Doc Purpose
docs/setup.md Full setup, Docker, and deployment
docs/usage.md Commands, flow, and usage tips
docs/troubleshooting.md FAQ and error fixes
docs/logging.md Logging format, API, and examples

βš™οΈ Configuration

Edit config.json:

Key Description
studio_url YouTube Studio draft list URL
thumbnail_dir Thumbnail output folder
profile_dir Browser session folder
logs_dir Log and screenshot folder
playlist_keywords Playlist-to-keyword mapping
timezone Browser timezone, for example Asia/Jakarta
schedule_time Publish time, for example 20:00
schedule_offset_days Day gap from previous video
pause_between_drafts Manual pause between drafts
screenshots Save debug screenshots
headless Run browser without UI

πŸ“‘ Workflow

  1. Open YouTube Studio draft list
  2. Copy details from previous video
  3. Update title and description
  4. Upload thumbnail from thumbnails/
  5. Configure monetization and rating
  6. Set end screen and playlist card
  7. Set publish schedule

Run Modes

Mode Command Flow
Normal bash run.sh run 5 Process drafts in sequence and schedule them
Test bash run.sh test Try 1 draft first
No Schedule make run LIMIT=1 SCHEDULE=no Skip time/date input
Schedule Only make run LIMIT=2 SCHEDULE=only Jump straight to schedule step
Schedule Yes make run LIMIT=2 SCHEDULE=yes Full flow + schedule

πŸ” Notes

  • profile/ stores login session β€” do not commit it
  • config.json contains Studio URL β€” keep it private
  • Timezone must match channel timezone
  • FAIL screenshots are always captured on errors

πŸ“„ License

Distributed under the MIT License. See LICENSE.


BITS YouTube Automation Developed with ❀️ by Banten IT Solutions

About

Python automation for YouTube Studio draft processing, thumbnail upload, and scheduled publishing

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages