# Automated Minecraft Story Shorts

Creates publish-ready vertical YouTube Shorts from original AI stories, a narrator voice, animated word-timed subtitles, and CC0 Minecraft parkour footage.

## One-command creation

```bash
cd /root/workspace/ytshorts
source venv/bin/activate
python3 main.py
```

Outputs:

- `stories/<timestamp>.json` — title, description, hashtags, narration
- `audio/<timestamp>.mp3` — narrator audio
- `audio/<timestamp>.ass` — word-timed caption track
- `output/<timestamp>.mp4` — 1080x1920 publish-ready Short

Choose a theme or output name:

```bash
python3 main.py --theme "workplace revenge" --stem friday_story
```

## Autonomous licensed-source run

Agent Reach's installed YouTube backend can download a permitted Creative Commons source, validate its license, and render a Short. Publishing stays disabled:

```bash
cd /root/workspace/ytshorts
source venv/bin/activate
python3 autonomous_run.py
```

The default source is Orbital - No Copyright Gameplay video `LwqyaFWDey8`. The run requires an authorized cookie export at `/root/workspace/shorts_data/youtube-cookies.txt` or `YOUTUBE_COOKIES_FILE`. The script rejects sources without Creative Commons metadata and records source credit in the story JSON.

## Footage

`footage/parkour_cc0.mp4` is CC0 footage from Archive.org, created by VinciTeo00 YT:

- https://archive.org/details/il-mio-parkour-su-minecraft-vinci-teo-00-yt
- License: CC0 1.0 Universal

It is cleaned and vertically cropped into `footage/clean/parkour_cc0.mp4`. The prep step removes detected menu screens and moves the crop window away from source chat text.

To prepare a new source clip:

```bash
python3 prep_footage.py footage/new_clip.mp4
```

## YouTube publishing

1. In Google Cloud, enable **YouTube Data API v3**.
2. Create an OAuth client with application type **Desktop app**.
3. Download its JSON and put it at `credentials/client_secret.json`.
4. Upload a render:

```bash
python3 upload.py output/friday_story.mp4 stories/friday_story.json --privacy private
```

The first upload opens a Google sign-in page and saves a renewable token in `credentials/token.json`. Keep `credentials/` private; it is ignored by Git.

## Notes

- Stories are original AI-written fiction. The title, description, and hashtags are generated with each run.
- Voice: `en-US-AndrewMultilingualNeural` through edge-tts.
- Captions are all-caps, three words at a time, with the current word enlarged and yellow.
- `main.py` can be scheduled after upload credentials are installed.
