Skip to content

feat: YouTube upload integration#112

Merged
NagariaHussain merged 8 commits into
developfrom
feat/youtube-upload
Mar 2, 2026
Merged

feat: YouTube upload integration#112
NagariaHussain merged 8 commits into
developfrom
feat/youtube-upload

Conversation

@NagariaHussain
Copy link
Copy Markdown
Contributor

@NagariaHussain NagariaHussain commented Mar 2, 2026

Summary

  • OAuth connection: Settings → YouTube tab lets admins connect a YouTube account via Google OAuth. Uses Frappe's Connected App + Token Cache for encrypted token storage with auto-refresh.
  • Upload from review page: YouTube button in ReviewHeader opens a dialog to set title, description, and privacy status. Upload runs as a background job (R2 download → YouTube resumable upload in 10MB chunks).
  • Status tracking: Polling every 5s while Queued/Uploading. Realtime progress via frappe.publish_realtime. Complete state shows clickable YouTube badge. Error state offers retry. Re-upload resets status.

Files

Action File What
Create vms/youtube.py OAuth connect/disconnect, upload API, background job
Create frontend/.../YouTubeSection.tsx YouTube settings tab
Create frontend/.../YouTubeUploadDialog.tsx Upload dialog
Modify vms/.../vms_settings.json +6 YouTube fields
Modify vms/.../vms_asset.json +3 YouTube fields
Modify SettingsDialog.tsx YouTube tab
Modify ReviewHeader.tsx YouTube button with status states
Modify ReviewPage.tsx Dialog + polling wiring
Modify review_api.py YouTube fields in review data

Test plan

  • Open Settings → YouTube → enter Google OAuth credentials → click Connect → complete Google consent → verify channel name shown
  • Open a video in review → click YouTube → fill title/description → submit → verify spinner while uploading → verify YouTube badge on completion
  • Click YouTube badge → opens video on YouTube
  • Test re-upload flow (small re-upload button next to badge)
  • Test error state → retry button
  • Test disconnect in Settings → verify badge clears

🤖 Generated with Claude Code

NagariaHussain and others added 8 commits March 2, 2026 06:49
…sing

Connect a YouTube account via OAuth in Settings, then upload videos directly
from the review page. Uses Frappe's Connected App for token management with
auto-refresh. Uploads run as background jobs (R2 download → YouTube resumable
upload) with status polling and realtime progress.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ect URI

Google OAuth rejects redirect URIs with spaces. The Connected App name
becomes part of the Frappe callback URL, so it must be URL-safe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Frappe auto-generates Connected App names (hash IDs), so we can't
hardcode a name. Now stores the generated name in VMS Settings
(youtube_connected_app field). Also shows the redirect URI to the
user before redirecting to Google, so they can register it first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use set_name="vms-youtube" to force a predictable name so the redirect
URI is known before the user creates their OAuth client. The settings
UI now shows the redirect URI as step 1, then asks for credentials as
step 2 — no more chicken-and-egg problem.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Show inline progress bar with percentage in upload dialog instead of
  closing immediately after starting upload
- Dialog now has 4 states: form, in-progress, complete, error
- Use realtime events (useFrappeEventListener) for instant progress
  updates with fallback 5s polling for reliability
- Remove doctype/docname scoping from publish_realtime calls so events
  reach the site room that useFrappeEventListener listens on
- Switch YouTube job queue from "long" to "default" (no long worker in
  Procfile)
- Remove duplicate import requests in youtube.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ClassVar annotation to mutable class attrs in search.py (RUF012)
- Exclude vms/public/frontend/ from prettier and eslint pre-commit hooks
- Auto-format Python files via ruff

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These files change on every frontend build and create noisy diffs.
Static assets (icons, fonts, logo) remain tracked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@NagariaHussain NagariaHussain merged commit 5328d04 into develop Mar 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant