Narrow YouTube OAuth scopes to upload+readonly.
Drop youtubepartner/analytics scopes that commonly break unverified Google consent with a 500 page. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1f5aef2065
commit
74e2b91228
@ -19,16 +19,11 @@ from . import db
|
|||||||
|
|
||||||
YOUTUBE_SCOPES = " ".join(
|
YOUTUBE_SCOPES = " ".join(
|
||||||
[
|
[
|
||||||
# Full channel management (playlists, captions-ish surface, live bindings, etc.)
|
# Minimal set for Shorts upload + channel identity.
|
||||||
"https://www.googleapis.com/auth/youtube",
|
# Avoid youtubepartner / yt-analytics here — they often break
|
||||||
"https://www.googleapis.com/auth/youtube.force-ssl",
|
# unverified OAuth consent (Google 500 / access_denied).
|
||||||
# Explicit upload + readonly (kept for clarity / older clients)
|
|
||||||
"https://www.googleapis.com/auth/youtube.upload",
|
"https://www.googleapis.com/auth/youtube.upload",
|
||||||
"https://www.googleapis.com/auth/youtube.readonly",
|
"https://www.googleapis.com/auth/youtube.readonly",
|
||||||
# Partner / brand-account surfaces when available
|
|
||||||
"https://www.googleapis.com/auth/youtubepartner",
|
|
||||||
# Channel analytics (non-monetary)
|
|
||||||
"https://www.googleapis.com/auth/yt-analytics.readonly",
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -132,21 +132,18 @@ export function GoogleOauthSetupWizard({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol className="list-decimal space-y-1 pl-5 text-xs text-slate-400">
|
<ol className="list-decimal space-y-1 pl-5 text-xs text-slate-400">
|
||||||
<li>弹出页里启用 YouTube Data API v3(建议同时启用 YouTube Analytics API)</li>
|
<li>弹出页里启用 YouTube Data API v3</li>
|
||||||
<li>
|
<li>
|
||||||
同意屏幕选 External,加你自己为 Test user;Scopes 尽量加全:
|
同意屏幕选 External;Scopes 只需:
|
||||||
<code className="ml-1 text-[10px] text-slate-300">youtube</code>、
|
<code className="ml-1 text-[10px] text-slate-300">youtube.upload</code>、
|
||||||
<code className="text-[10px] text-slate-300">youtube.force-ssl</code>、
|
<code className="text-[10px] text-slate-300">youtube.readonly</code>
|
||||||
<code className="text-[10px] text-slate-300">youtube.upload</code>、
|
(不要加 youtubepartner / yt-analytics,未验证应用容易在同意页 500)
|
||||||
<code className="text-[10px] text-slate-300">youtube.readonly</code>、
|
|
||||||
<code className="text-[10px] text-slate-300">youtubepartner</code>、
|
|
||||||
<code className="text-[10px] text-slate-300">yt-analytics.readonly</code>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
创建 <b className="text-slate-200">Web application</b>,重定向 URI 填下面这行(先复制)
|
创建 <b className="text-slate-200">Web application</b>,重定向 URI 填下面这行(先复制)
|
||||||
</li>
|
</li>
|
||||||
<li>把 Client ID / Secret 粘贴到下方 → 保存</li>
|
<li>把 Client ID / Secret 粘贴到设置里对应的 A/B/C/D 配置档 → 保存</li>
|
||||||
<li>权限变更后,到 Shorts 页对每个频道点「重新授权」才会拿到新 scope</li>
|
<li>Shorts 频道选择配置档后点「授权」;权限变更后需重新授权</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center gap-2">
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user