From 4dd3ca9d91e8b29be92b2ba704b5c245d86e8e11 Mon Sep 17 00:00:00 2001 From: Gramps Date: Tue, 5 Aug 2025 22:08:09 -0700 Subject: [PATCH] Updated YouTube Upload Logic (markdown) --- YouTube Upload Logic.md | 0 YouTube-Upload-Logic.md | 78 +++++++++++++++++++++++++++-------------- 2 files changed, 51 insertions(+), 27 deletions(-) delete mode 100644 YouTube Upload Logic.md diff --git a/YouTube Upload Logic.md b/YouTube Upload Logic.md deleted file mode 100644 index e69de29..0000000 diff --git a/YouTube-Upload-Logic.md b/YouTube-Upload-Logic.md index 0630281..469c58e 100644 --- a/YouTube-Upload-Logic.md +++ b/YouTube-Upload-Logic.md @@ -1,30 +1,54 @@ -# YouTube Upload Logic +## โฌ†๏ธ YouTube Upload Logic -This page describes how videos are uploaded to YouTube and how metadata, playlists, thumbnails, and recording dates are handled. - -## Upload Function - -Uploads are handled by: -```python -upload_video(file_path, is_vertical, stream_date, description=None, private=False) -``` - -## Workflow - -1. Authenticate via OAuth -2. Generate title and description: - - Uses stream date and `notes.txt` (if present) -3. Upload video with privacy setting -4. **If widescreen**, generate and upload thumbnail -5. Add video to playlist: - - Shorts โ†’ `YT_PLAYLIST_ID_SHORTS` - - Clips โ†’ `YT_PLAYLIST_ID_CLIPS` -6. Set recording date using parsed `YYYY.MM.DD` - -## Thumbnail Handling - -- Thumbnail upload occurs **after** the video is successfully uploaded -- Thumbnail is skipped for vertical videos (Shorts) -- Notes file is used to guide prompt generation (for future AI images) +This page outlines how videos are uploaded to YouTube using the LCS Pipeline, including playlist targeting, category assignment, and format-specific handling. --- + +### ๐Ÿš€ Upload Method + +Uploads are handled via the YouTube Data API v3 using OAuth credentials provided in your `.env` file. + +Main upload logic lives in: +``` +modules/yt_poster.py +``` + +--- + +### ๐Ÿ“ Playlist Rules + +| Video Type | Playlist | +|------------------|------------------| +| Vertical Shorts | `LCS Shorts` | +| Widescreen Clips | `LCS Clips` | + +Shorts are identified by filename suffixes like `-vert` or `-vertical`. + +--- + +### ๐Ÿ“‹ Category & Metadata + +- `categoryId`: Always set to `20` (Gaming) +- `tags`: Pulled from `notes.json` +- `description`: Generated dynamically using OpenAI + branding prompt +- `title`: Auto-generated from `notes.json` or montage info + +--- + +### โœ… Success Criteria + +- Upload response returns `videoId` +- Resulting link is stored in the metadata archive: + - `youtube_url` is appended to history JSON +- Folder is optionally removed if `DEBUG=False` + +--- + +### ๐Ÿงช Stub Testing + +- Set `UPLOAD_ENABLED=False` in `.env` to bypass real uploads +- Simulated responses are returned for dry-run mode + +--- + +Next: [`PeerTube Upload Logic`](./PeerTube-Upload-Logic) *(planned)*