feat: DeepSeek API + transcript fixes; add OAuth captions scope

This commit is contained in:
Gan, Jimmy
2026-06-24 00:50:36 +08:00
parent 963e9dbdf1
commit 7b485abfbb
2 changed files with 21 additions and 18 deletions
+7 -1
View File
@@ -6,7 +6,10 @@ from google_auth_oauthlib.flow import InstalledAppFlow
log = logging.getLogger(__name__)
SCOPES = ["https://www.googleapis.com/auth/youtube.readonly"]
SCOPES = [
"https://www.googleapis.com/auth/youtube.readonly",
"https://www.googleapis.com/auth/youtube.force-ssl"
]
CONFIG_DIR = os.environ.get("CONFIG_DIR", "/app/config")
_local_dir = os.path.dirname(os.path.abspath(__file__))
_local_config = os.path.join(os.path.dirname(_local_dir), "config")
@@ -34,6 +37,9 @@ def get_credentials():
"Download from Google Cloud Console."
)
flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRET, SCOPES)
# Print URL for manual opening
auth_url, _ = flow.authorization_url(prompt='consent', access_type='offline')
print(f"\nOpen this URL in your browser:\n{auth_url}\n")
creds = flow.run_local_server(port=0)
os.makedirs(os.path.dirname(TOKEN_FILE), exist_ok=True)