Updated YouTube Upload Logic (markdown)
@ -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.
|
This page outlines how videos are uploaded to YouTube using the LCS Pipeline, including playlist targeting, category assignment, and format-specific handling.
|
||||||
|
|
||||||
## 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)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### 🚀 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)*
|
||||||
|
|||||||
Reference in New Issue
Block a user