@danhachuel/thunderbolt 0.5.68 → 0.5.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app/main.py CHANGED
@@ -6799,26 +6799,10 @@ def render_google_accounts(*, include_innertube: bool = True):
6799
6799
  st.rerun()
6800
6800
 
6801
6801
  st.divider()
6802
- st.subheader("Configuração global do YouTube")
6803
- st.caption("Estas credenciais pertencem à aplicação Google/YouTube e ficam separadas das restantes APIs do Thunderbolt.")
6802
+ st.subheader("Configuração Global: YouTube Data API v3 (API Key)")
6803
+ st.caption("1. YouTube Data API v3: Metadados públicos (títulos, views, likes) Via MCP integrado.\n\n2. YouTube Analytics API: Métricas internas (CTR, retenção, RPM, tráfego, demografia) Via OAuth 2.0 (Directamente via OAuth das Contas Google/YouTube cadastradas)")
6804
6804
  with st.form("google_global_api_settings_form"):
6805
- google_api_cols = st.columns(2)
6806
- with google_api_cols[0]:
6807
- youtube_client_id = st.text_input(
6808
- "YouTube OAuth Client ID",
6809
- value=str(settings.get("youtube_client_id", "") or ""),
6810
- key="google_page_youtube_client_id",
6811
- help="Client ID OAuth 2.0 criado no Google Cloud para autorizar a conta YouTube.",
6812
- )
6813
- with google_api_cols[1]:
6814
- youtube_client_secret = st.text_input(
6815
- "YouTube OAuth Client Secret",
6816
- value=str(settings.get("youtube_client_secret", "") or ""),
6817
- type="password",
6818
- key="google_page_youtube_client_secret",
6819
- help="Client Secret do mesmo cliente OAuth 2.0. Não é uma API Key.",
6820
- )
6821
- st.caption(f"OAuth local: use um cliente do tipo Desktop app. Se o Google Cloud pedir uma URI autorizada, registe exactamente `{loopback_redirect_uri()}`.")
6805
+ st.caption("A autorização OAuth 2.0 é gerida por cada Conta Google/YouTube cadastrada e associada ao canal.")
6822
6806
  youtube_api_key = st.text_input(
6823
6807
  "YouTube Data API Key (opcional)",
6824
6808
  value=str(settings.get("youtube_api_key", "") or ""),
@@ -6829,10 +6813,10 @@ def render_google_accounts(*, include_innertube: bool = True):
6829
6813
  save_google_global = st.form_submit_button("Guardar configuração global do YouTube", type="primary", use_container_width=True)
6830
6814
  if save_google_global:
6831
6815
  settings.update({
6832
- "youtube_client_id": youtube_client_id.strip(),
6833
- "youtube_client_secret": youtube_client_secret.strip(),
6834
6816
  "youtube_api_key": youtube_api_key.strip(),
6835
6817
  })
6818
+ settings.pop("youtube_client_id", None)
6819
+ settings.pop("youtube_client_secret", None)
6836
6820
  write_json("settings.json", settings)
6837
6821
  st.success("Configuração global do YouTube guardada em Contas Google.")
6838
6822
  st.rerun()
@@ -10,7 +10,10 @@ from typing import Any
10
10
 
11
11
  from integrations.platforms import IntegrationResult
12
12
 
13
- BATCH_SCOPES = ["https://www.googleapis.com/auth/youtube.readonly"]
13
+ BATCH_SCOPES = [
14
+ "https://www.googleapis.com/auth/youtube.readonly",
15
+ "https://www.googleapis.com/auth/yt-analytics.readonly",
16
+ ]
14
17
  DEFAULT_LOOPBACK_HOST = "127.0.0.1"
15
18
  DEFAULT_LOOPBACK_PORT = 8765
16
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.5.68",
3
+ "version": "0.5.70",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",