@danhachuel/thunderbolt 0.5.82 → 0.5.83
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 +17 -0
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -1494,6 +1494,23 @@ def _growth_channel_metrics(channel: dict[str, Any]) -> tuple[list[dict[str, Any
|
|
|
1494
1494
|
def render_growth_youtube():
|
|
1495
1495
|
st.title("Analista Growth Youtube")
|
|
1496
1496
|
st.caption("Auditoria pública baseada nos 3 pilares críticos e nas métricas secundárias do agente Growth.")
|
|
1497
|
+
growth_settings = read_json("settings.json", {})
|
|
1498
|
+
youtube_data_api_ready = bool(str(growth_settings.get("youtube_api_key") or os.getenv("YOUTUBE_API_KEY") or "").strip())
|
|
1499
|
+
growth_accounts = growth_settings.get("youtube_batch_accounts", [])
|
|
1500
|
+
analytics_accounts_ready = False
|
|
1501
|
+
if isinstance(growth_accounts, list):
|
|
1502
|
+
for growth_account in growth_accounts:
|
|
1503
|
+
if isinstance(growth_account, dict) and youtube_batch_account_status(growth_account, STORAGE).ok:
|
|
1504
|
+
analytics_accounts_ready = True
|
|
1505
|
+
break
|
|
1506
|
+
st.markdown("**Estado das APIs de Growth**")
|
|
1507
|
+
api_status_cols = st.columns(2, gap="small")
|
|
1508
|
+
with api_status_cols[0]:
|
|
1509
|
+
st.caption("YouTube Data API v3: Metadados públicos")
|
|
1510
|
+
_api_status_badge("Configured" if youtube_data_api_ready else "Missing configuration", "ready" if youtube_data_api_ready else "missing")
|
|
1511
|
+
with api_status_cols[1]:
|
|
1512
|
+
st.caption("YouTube Analytics API: Métricas internas")
|
|
1513
|
+
_api_status_badge("Configured" if analytics_accounts_ready else "Missing configuration", "ready" if analytics_accounts_ready else "missing")
|
|
1497
1514
|
channels = [item for item in read_json("channels.json", []) if isinstance(item, dict) and item.get("active", True) and is_youtube_channel_record(item)]
|
|
1498
1515
|
if not channels:
|
|
1499
1516
|
st.info("Cadastre pelo menos um canal YouTube em Canais YouTube para iniciar a análise.")
|
package/package.json
CHANGED