# YouTube private upload thumbnail remediation

Use when a TrueTraceShorts private upload succeeds but the process fails while setting the thumbnail.

## Key lessons

- `videos.insert` can succeed before `thumbnails.set` fails. If the error output contains a YouTube video ID, do **not** rerun the full execute/upload command blindly or you may create a duplicate upload.
- YouTube API `thumbnails.set` does not accept WebP thumbnails. Use JPEG or PNG for custom thumbnails in upload packages.
- Even with a supported image format, `thumbnails.set` may return `403` if the authenticated channel/user is not allowed to upload custom thumbnails. Treat this as a channel/account permission issue, not a render failure.
- If the video already exists and thumbnail setting is blocked, write an audit that clearly says: private upload succeeded, thumbnail not set, manual Studio review required.

## Recovery pattern

1. Re-open the upload output and capture the returned `videoId`.
2. Verify the upload package and last approval command still match the reviewed hashes.
3. Do **not** call `videos.insert` again.
4. Convert WebP thumbnail to JPEG/PNG if needed:
   ```bash
   ffmpeg -y -hide_banner -loglevel error \
     -i thumbnail.webp -q:v 2 thumbnail.jpg
   ```
5. Attempt only `thumbnails.set` for the existing `videoId` if channel permissions allow it.
6. If `thumbnails.set` returns permission error, leave thumbnail unset and record the blocker in the audit.
7. Report Studio link, Shorts link, privacy status, API endpoints called, thumbnail status, and audit commit.

## Report wording

Say plainly:

- `Video upload succeeded as private.`
- `Custom thumbnail was not set because YouTube rejected/blocked thumbnails.set.`
- `No duplicate upload was attempted.`

Do not imply the upload failed if `videos.insert` already produced a valid video ID.