@danhachuel/thunderbolt 0.3.29 → 0.3.31

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
@@ -42,6 +42,8 @@ from hermes_ui.music import list_music_files, materialize_suno_audio, request_su
42
42
  from hermes_ui.media_downloader import AUDIO_FORMATS, VIDEO_CONTAINERS, VIDEO_QUALITY_OPTIONS, MediaDownloadError, build_download_options, clear_media_download_history, dependency_status, download_media, list_media_downloads, media_download_file
43
43
  from hermes_ui.notifications import clear_notifications, list_notifications, mark_all_notifications_read, mark_notification_read, notification_event_catalog, notification_preferences, record_notification, reconcile_persisted_notifications, save_notification_preferences, unread_notification_count
44
44
  from hermes_ui.languages import LANGUAGE_CODES, LANGUAGE_FLAG_DATA_URIS, language_code, language_label, ui_language_menu_label, ui_text, video_language_label, video_language_options
45
+ from hermes_ui.api_key_tests import test_apify_credentials, test_kaggle_credentials, test_material_source_credentials, test_nano_banana_credentials, test_postiz_credentials, test_tiktok_credentials, test_upload_post_credentials, test_voice_provider
46
+ from hermes_ui.tutorials import tutorial_body, tutorial_caption, tutorial_title
45
47
 
46
48
  from hermes_ui.script_documents import list_script_documents, read_script_document, save_script_document, script_storage_path
47
49
  from hermes_ui.script_generation import generate_script_document
@@ -4380,6 +4382,13 @@ def _render_material_source_card(settings: dict[str, Any], cards: list[dict[str,
4380
4382
  value=active_card_id == card_id,
4381
4383
  key=f"material_card_{card_id}_selected",
4382
4384
  )
4385
+ if not is_local:
4386
+ _render_api_test_control(
4387
+ settings,
4388
+ f"material:{card_id}",
4389
+ lambda: test_material_source_credentials(provider, api_key),
4390
+ widget_key=f"api_test_material_{card_id}",
4391
+ )
4383
4392
  save_card = st.form_submit_button("Salvar", type="primary", use_container_width=True, key=f"material_card_{card_id}_save")
4384
4393
  if save_card:
4385
4394
  cards[index] = {**card, "api_key": str(api_key or "").strip(), "enabled": bool(enabled)}
@@ -4438,6 +4447,61 @@ def _render_credential_status(value: Any, *, local: bool = False, required: bool
4438
4447
  _api_status_badge(label, kind)
4439
4448
 
4440
4449
 
4450
+ def _persist_api_test_result(settings: dict[str, Any], test_key: str, result: dict[str, Any]) -> dict[str, Any]:
4451
+ """Persist only the safe diagnosis fields; never store credentials or endpoint details."""
4452
+ safe_result = {
4453
+ "status": str(result.get("status") or "error"),
4454
+ "message": str(result.get("message") or "A chamada de diagnóstico falhou.")[:240],
4455
+ "status_code": result.get("status_code"),
4456
+ "checked_at": str(result.get("checked_at") or ""),
4457
+ }
4458
+ stored = settings.get("api_test_results")
4459
+ if not isinstance(stored, dict):
4460
+ stored = {}
4461
+ stored[str(test_key)] = safe_result
4462
+ settings["api_test_results"] = stored
4463
+ write_json("settings.json", settings)
4464
+ return safe_result
4465
+
4466
+
4467
+ def _render_api_test_feedback(settings: dict[str, Any], test_key: str, result: dict[str, Any] | None = None) -> None:
4468
+ """Render the same compact green/red feedback for every non-LLM API card."""
4469
+ current = result
4470
+ if current is None:
4471
+ stored = settings.get("api_test_results")
4472
+ current = stored.get(test_key) if isinstance(stored, dict) else None
4473
+ if not isinstance(current, dict):
4474
+ return
4475
+ status = str(current.get("status") or "error")
4476
+ language = current_ui_language()
4477
+ if status == "success":
4478
+ st.success(ui_text("Último teste: API Key OK", language))
4479
+ return
4480
+ if status == "missing":
4481
+ st.error(ui_text("Último teste: falta configuração", language))
4482
+ return
4483
+ if status == "unsupported":
4484
+ st.warning(ui_text("Último teste: requer autorização ou endpoint seguro", language))
4485
+ return
4486
+ code = current.get("status_code")
4487
+ suffix = f" (HTTP {int(code)})" if isinstance(code, int) and code > 0 else ""
4488
+ st.error(ui_text("Último teste: chamada falhou", language) + suffix)
4489
+
4490
+
4491
+ def _render_api_test_control(settings: dict[str, Any], test_key: str, callback: Any, *, widget_key: str) -> None:
4492
+ """Render a form-safe diagnostic button and persist its redacted result."""
4493
+ if st.form_submit_button("Testar chamada API", use_container_width=True, key=widget_key):
4494
+ with st.spinner(ui_text("A testar chamada API…", current_ui_language())):
4495
+ try:
4496
+ result = callback()
4497
+ except Exception:
4498
+ result = {"status": "error", "message": "A chamada de diagnóstico falhou."}
4499
+ _persist_api_test_result(settings, test_key, result)
4500
+ _render_api_test_feedback(settings, test_key, result)
4501
+ else:
4502
+ _render_api_test_feedback(settings, test_key)
4503
+
4504
+
4441
4505
  def _llm_card_config_status(card: dict[str, Any]) -> tuple[str, str]:
4442
4506
  definition = provider_definition(card.get("provider"))
4443
4507
  if definition.local:
@@ -4649,6 +4713,12 @@ def render_settings():
4649
4713
  with kaggle_cols[2]:
4650
4714
  kaggle_kernel_slug = text_setting("Slug da kernel", "kaggle_kernel_slug", help_text="Identificador da kernel remota, por exemplo thunderbolt-niche-finder.")
4651
4715
  _render_credential_status(kaggle_api_key)
4716
+ _render_api_test_control(
4717
+ settings,
4718
+ "kaggle",
4719
+ lambda: test_kaggle_credentials(kaggle_username, kaggle_api_key),
4720
+ widget_key="api_test_kaggle",
4721
+ )
4652
4722
 
4653
4723
  with st.expander("Niche Finder — Apify", expanded=False):
4654
4724
  st.caption("O token fica guardado apenas no storage local. A aba Niche Finder Apify só usa este serviço depois de clicar no botão de pesquisa.")
@@ -4662,6 +4732,12 @@ def render_settings():
4662
4732
  with apify_cols[3]:
4663
4733
  apify_run_timeout = st.number_input("Limite da execução (s)", min_value=30, max_value=7200, value=int(settings.get("apify_run_timeout_seconds", 900)), step=30)
4664
4734
  _render_credential_status(apify_api_token)
4735
+ _render_api_test_control(
4736
+ settings,
4737
+ "apify",
4738
+ lambda: test_apify_credentials(apify_api_token),
4739
+ widget_key="api_test_apify",
4740
+ )
4665
4741
 
4666
4742
  render_llm_provider_cards(settings, embedded=True)
4667
4743
 
@@ -4675,6 +4751,12 @@ def render_settings():
4675
4751
  gemini_image_aspect_ratio = st.selectbox("Proporção da thumbnail", ["16:9", "9:16", "1:1", "4:5"], index=["16:9", "9:16", "1:1", "4:5"].index(str(settings.get("gemini_image_aspect_ratio") or "16:9")) if str(settings.get("gemini_image_aspect_ratio") or "16:9") in {"16:9", "9:16", "1:1", "4:5"} else 0)
4676
4752
  gemini_image_size = st.selectbox("Tamanho da imagem", ["1K", "2K", "4K"], index=["1K", "2K", "4K"].index(str(settings.get("gemini_image_size") or "1K")) if str(settings.get("gemini_image_size") or "1K") in {"1K", "2K", "4K"} else 0)
4677
4753
  _render_credential_status(gemini_image_api_key)
4754
+ _render_api_test_control(
4755
+ settings,
4756
+ "nano_banana",
4757
+ lambda: test_nano_banana_credentials(gemini_image_api_key, gemini_image_model),
4758
+ widget_key="api_test_nano_banana",
4759
+ )
4678
4760
 
4679
4761
 
4680
4762
  with st.expander("Voz, TTS e música — Azure Speech, restantes serviços e Suno", expanded=False):
@@ -4707,11 +4789,65 @@ def render_settings():
4707
4789
  suno_api_base_url = text_setting("Suno API Base URL", "suno_api_base_url", help_text="Use o endpoint compatível fornecido pelo seu acesso Suno; não é inventado pelo Thunderbolt.")
4708
4790
  suno_api_endpoint = text_setting("Suno API endpoint", "suno_api_endpoint", help_text="Ex.: /api/generate")
4709
4791
 
4792
+ st.markdown(f"**{ui_text('Testar credenciais TTS e música', current_ui_language())}**")
4793
+ voice_test_cols = st.columns(3)
4794
+ with voice_test_cols[0]:
4795
+ _render_api_test_control(
4796
+ settings,
4797
+ "voice:azure_speech",
4798
+ lambda: test_voice_provider("azure_speech", {"azure_speech_key": azure_speech_key, "azure_speech_region": azure_speech_region}),
4799
+ widget_key="api_test_voice_azure",
4800
+ )
4801
+ _render_api_test_control(
4802
+ settings,
4803
+ "voice:siliconflow",
4804
+ lambda: test_voice_provider("siliconflow", {"siliconflow_tts_api_key": siliconflow_tts_api_key}),
4805
+ widget_key="api_test_voice_siliconflow",
4806
+ )
4807
+ _render_api_test_control(
4808
+ settings,
4809
+ "voice:minimax",
4810
+ lambda: test_voice_provider("minimax", {"minimax_tts_api_key": minimax_tts_api_key, "minimax_tts_base_url": minimax_tts_base_url}),
4811
+ widget_key="api_test_voice_minimax",
4812
+ )
4813
+ with voice_test_cols[1]:
4814
+ _render_api_test_control(
4815
+ settings,
4816
+ "voice:elevenlabs",
4817
+ lambda: test_voice_provider("elevenlabs", {"elevenlabs_api_key": elevenlabs_api_key}),
4818
+ widget_key="api_test_voice_elevenlabs",
4819
+ )
4820
+ _render_api_test_control(
4821
+ settings,
4822
+ "voice:chatterbox",
4823
+ lambda: test_voice_provider("chatterbox", {"chatterbox_api_key": chatterbox_api_key, "chatterbox_base_url": chatterbox_base_url}),
4824
+ widget_key="api_test_voice_chatterbox",
4825
+ )
4826
+ with voice_test_cols[2]:
4827
+ _render_api_test_control(
4828
+ settings,
4829
+ "voice:sonilo",
4830
+ lambda: test_voice_provider("sonilo", {"sonilo_api_key": sonilo_api_key, "sonilo_base_url": sonilo_base_url}),
4831
+ widget_key="api_test_voice_sonilo",
4832
+ )
4833
+ _render_api_test_control(
4834
+ settings,
4835
+ "voice:suno",
4836
+ lambda: test_voice_provider("suno", {"suno_api_key": suno_api_key, "suno_api_base_url": suno_api_base_url, "suno_api_endpoint": suno_api_endpoint}),
4837
+ widget_key="api_test_voice_suno",
4838
+ )
4839
+
4710
4840
  with st.expander("TikTok for Developers — Client ID e Client Secret", expanded=False):
4711
4841
  st.caption("Apenas as credenciais da aplicação ficam nesta UI. Redirect URI, scopes, autorização e tokens são geridos no TikTok for Developers Playground.")
4712
4842
  tiktok_client_key = text_setting("TikTok Client ID", "tiktok_client_key", secret=True)
4713
4843
  _render_credential_status(tiktok_client_key)
4714
4844
  tiktok_client_secret = text_setting("TikTok Client Secret", "tiktok_client_secret", secret=True)
4845
+ _render_api_test_control(
4846
+ settings,
4847
+ "tiktok",
4848
+ lambda: test_tiktok_credentials(tiktok_client_key, tiktok_client_secret, settings.get("tiktok_access_token", "")),
4849
+ widget_key="api_test_tiktok",
4850
+ )
4715
4851
 
4716
4852
  with st.expander("Publicação através do Upload-Post", expanded=False):
4717
4853
  upload_post_enabled = st.checkbox("Activar Upload-Post", bool(settings.get("upload_post_enabled", False)))
@@ -4720,6 +4856,12 @@ def render_settings():
4720
4856
  upload_post_username = text_setting("Upload-Post username", "upload_post_username")
4721
4857
  upload_post_platforms = text_setting("Plataformas Upload-Post", "upload_post_platforms")
4722
4858
  upload_post_auto_upload = st.checkbox("Publicar automaticamente após gerar", bool(settings.get("upload_post_auto_upload", False)))
4859
+ _render_api_test_control(
4860
+ settings,
4861
+ "upload_post",
4862
+ lambda: test_upload_post_credentials(upload_post_api_key, settings.get("upload_post_base_url", "https://api.upload-post.com/api")),
4863
+ widget_key="api_test_upload_post",
4864
+ )
4723
4865
 
4724
4866
  with st.expander("Postiz — API key, integração e MCP", expanded=False):
4725
4867
  st.caption("O Thunderbolt é o cliente. A API key é enviada exclusivamente ao servidor Postiz configurado; não é colocada em URLs, logs ou repositório.")
@@ -4735,6 +4877,12 @@ def render_settings():
4735
4877
  postiz_mcp_url = text_setting("Postiz MCP URL", "postiz_mcp_url", help_text="Cloud: https://api.postiz.com/mcp · o cliente acrescenta a API key conforme o modo escolhido.")
4736
4878
  postiz_auto_publish = st.checkbox("Permitir publicação imediata no Postiz", bool(settings.get("postiz_auto_publish", False)))
4737
4879
  st.caption("No Upload, a aba Postiz permite carregar as integrações e enviar vídeos manualmente. No fluxo recomendado, Postiz só é tentado depois da API Oficial e do Upload directo.")
4880
+ _render_api_test_control(
4881
+ settings,
4882
+ "postiz",
4883
+ lambda: test_postiz_credentials(postiz_api_key, postiz_base_url),
4884
+ widget_key="api_test_postiz",
4885
+ )
4738
4886
 
4739
4887
  save_all_settings = st.form_submit_button("Guardar configurações do Thunderbolt", type="primary")
4740
4888
  if save_all_settings:
@@ -4910,6 +5058,13 @@ def render_models_ai_tutorial():
4910
5058
  return
4911
5059
  st.markdown(tutorial_content, unsafe_allow_html=True)
4912
5060
 
5061
+ def render_niche_tutorial(tutorial_kind: str):
5062
+ ui_language = current_ui_language()
5063
+ st.title(tutorial_title(tutorial_kind, ui_language))
5064
+ st.caption(tutorial_caption(tutorial_kind, ui_language))
5065
+ st.markdown(tutorial_body(tutorial_kind, ui_language), unsafe_allow_html=False)
5066
+
5067
+
4913
5068
  def render_supabase_tutorial():
4914
5069
  tutorial_url = "https://github.com/gyoridavid/ai_agents_az/blob/main/episode_8/guide-supabase.md"
4915
5070
  tutorial_path = ROOT / "seed" / "references" / "guide-supabase.md"
@@ -5343,9 +5498,9 @@ def main():
5343
5498
  "Facebook Pages": lambda: render_edit_placeholder("Facebook Pages", ""),
5344
5499
  "Automação Youtube": render_automation,
5345
5500
  "Niche Finder Kaggle": render_niche_finder,
5346
- "Tutorial Kaggle": lambda: render_edit_placeholder("Tutorial Kaggle", ""),
5501
+ "Tutorial Kaggle": lambda: render_niche_tutorial("kaggle"),
5347
5502
  "Niche Finder Apify": render_niche_finder_apify,
5348
- "Tutorial Apify": lambda: render_edit_placeholder("Tutorial Apify", ""),
5503
+ "Tutorial Apify": lambda: render_niche_tutorial("apify"),
5349
5504
  "Edição": lambda: render_edit_placeholder("Edição", "Seleccione uma das abas de edição no menu expansível."),
5350
5505
  "Limpador de Metadados": render_metadata_cleaner,
5351
5506
  "Cortes": render_cuts,
@@ -0,0 +1,978 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+
5
+ SUPPORTED_TUTORIAL_LANGUAGES = ("pt", "en", "zh", "de", "vi", "tr", "ru", "es", "id", "it")
6
+
7
+
8
+ _TUTORIALS: dict[str, dict[str, dict[str, str]]] = {
9
+ "kaggle": {
10
+ "pt": {
11
+ "title": "Tutorial Kaggle",
12
+ "caption": "Configure as credenciais Kaggle para o Niche Finder, com base no projecto Niche-Finder.",
13
+ "body": """## O que este tutorial configura
14
+
15
+ O Niche Finder do Thunderbolt foi inspirado no projecto [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder). A referência usa o dataset público [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) para estudar vídeos, nichos, tendências e tags. No Thunderbolt, a análise Kaggle prepara e coloca em cache esse dataset antes de executar a análise.
16
+
17
+ > **Importante:** no fluxo actual do Thunderbolt, a análise é iniciada manualmente em **Niche Finder > Niche Finder Kaggle**. Não é necessário criar uma kernel Kaggle para esta operação.
18
+
19
+ ## 1. Criar ou confirmar a conta Kaggle
20
+
21
+ Aceda a [kaggle.com](https://www.kaggle.com/) e entre na sua conta. Confirme o e-mail e, se o Kaggle solicitar, conclua as verificações da conta. O **username** é o identificador exibido no seu perfil; não inclua `@`, espaços ou a URL completa do perfil.
22
+
23
+ ## 2. Obter a API Key
24
+
25
+ 1. Abra [Kaggle Account API Tokens](https://www.kaggle.com/settings/api).
26
+ 2. Na secção **API**, clique em **Generate New Token**. O Kaggle CLI actual também aceita este token através de `KAGGLE_API_TOKEN`.
27
+ 3. Se precisar do formato legado usado por ferramentas antigas, abra **Legacy API Credentials** e clique em **Create Legacy API Key**. O download será um ficheiro `kaggle.json` com `username` e `key`.
28
+ 4. Guarde o ficheiro ou o valor da chave fora do GitHub, de notebooks públicos e de mensagens. Se uma chave for exposta, revogue-a e gere outra imediatamente.
29
+
30
+ A documentação oficial confirma as duas vias: OAuth/CLI e criação de uma API key nas definições de tokens da conta [1] [2].
31
+
32
+ ## 3. Preencher o cartão do Thunderbolt
33
+
34
+ Abra **Configuração API > API Keys > Niche Finder — Kaggle** e preencha **Kaggle Username** com o username sem `@` e **Kaggle API Key** com a chave. O campo **Slug da kernel** pode permanecer com o valor predefinido; ele é mantido para compatibilidade com configurações legadas e não é necessário para o download actual do dataset. Clique em **Testar chamada API**, confirme o resultado verde e depois clique em **Salvar**.
35
+
36
+ O teste faz apenas uma consulta autenticada de leitura ao perfil Kaggle. Ele não cria kernels, não executa notebooks e não publica nada.
37
+
38
+ ## 4. Executar a análise de nichos
39
+
40
+ Entre em **Niche Finder > Niche Finder Kaggle**, escolha o intervalo de datas, país e filtros disponíveis e clique em **Analisar Nichos**. Na primeira execução, o Thunderbolt prepara o dataset e guarda uma cópia local validada. As execuções seguintes podem reutilizar o cache; se os dados estiverem incompletos ou forem removidos, repita a operação depois de confirmar as credenciais.
41
+
42
+ ## Diagnóstico rápido
43
+
44
+ | Sintoma | Acção recomendada |
45
+ | --- | --- |
46
+ | `401` ou teste vermelho | Confirme o username exacto e gere uma nova chave em Kaggle > Settings > API. |
47
+ | Limite ou `429` | Aguarde alguns minutos e evite iniciar várias descargas consecutivas; o Kaggle aplica rate limits dinâmicos. |
48
+ | Dataset sem dados | Confirme a ligação do dataset de tendências e execute novamente a preparação automática. |
49
+ | Chave exposta | Revogue-a no Kaggle, crie outra e actualize somente o cartão local. |
50
+
51
+ ## Referências
52
+
53
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
54
+ """,
55
+ },
56
+ "en": {
57
+ "title": "Kaggle Tutorial",
58
+ "caption": "Configure Kaggle credentials for Niche Finder, based on the Niche-Finder project.",
59
+ "body": """## What this tutorial configures
60
+
61
+ Thunderbolt's Kaggle Niche Finder was inspired by [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder). That reference uses the public [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) to study videos, niches, trends, and tags. Thunderbolt prepares and caches that dataset before running the analysis.
62
+
63
+ > **Important:** the current Thunderbolt flow is started manually from **Niche Finder > Niche Finder Kaggle**. You do not need to create a Kaggle kernel for this operation.
64
+
65
+ ## 1. Create or confirm your Kaggle account
66
+
67
+ Open [kaggle.com](https://www.kaggle.com/) and sign in. Confirm your email and complete any account verification requested by Kaggle. Your **username** is the identifier shown on your profile; do not include `@`, spaces, or the full profile URL.
68
+
69
+ ## 2. Get the API key
70
+
71
+ 1. Open [Kaggle Account API Tokens](https://www.kaggle.com/settings/api).
72
+ 2. Under **API**, click **Generate New Token**. The current Kaggle CLI can also use this token through `KAGGLE_API_TOKEN`.
73
+ 3. If an older tool requires the legacy format, open **Legacy API Credentials** and click **Create Legacy API Key**. Kaggle downloads a `kaggle.json` file containing `username` and `key`.
74
+ 4. Keep the file or key out of GitHub, public notebooks, and messages. If it is exposed, revoke it and generate a replacement immediately.
75
+
76
+ The official documentation confirms both paths: OAuth/CLI and API-key creation in the account token settings [1] [2].
77
+
78
+ ## 3. Fill in Thunderbolt
79
+
80
+ Open **API Configuration > API Keys > Niche Finder — Kaggle**. Enter your username without `@` in **Kaggle Username** and the secret value in **Kaggle API Key**. You may leave **Kernel slug** at its default; it is retained for legacy compatibility and is not required by the current dataset download. Click **Test API call**, confirm the green result, and then click **Save**.
81
+
82
+ The test performs only an authenticated, read-only profile lookup. It does not create kernels, run notebooks, or publish anything.
83
+
84
+ ## 4. Run the niche analysis
85
+
86
+ Go to **Niche Finder > Niche Finder Kaggle**, choose the available date, country, and filter options, and click **Analyze Niches**. On the first run, Thunderbolt prepares the dataset and stores a validated local cache. Later runs may reuse it; if the cache is incomplete or removed, retry after checking the credentials.
87
+
88
+ ## Quick troubleshooting
89
+
90
+ | Symptom | Recommended action |
91
+ | --- | --- |
92
+ | `401` or red test | Check the exact username and generate a new key at Kaggle > Settings > API. |
93
+ | Rate limit or `429` | Wait a few minutes and avoid repeated downloads; Kaggle uses dynamic rate limits. |
94
+ | Dataset has no rows | Check the trending dataset link and run the automatic preparation again. |
95
+ | Key exposed | Revoke it in Kaggle, create another one, and update only the local card. |
96
+
97
+ ## References
98
+
99
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
100
+ """,
101
+ },
102
+ "zh": {
103
+ "title": "Kaggle 教程",
104
+ "caption": "根据 Niche-Finder 项目配置 Kaggle 凭据,用于 Niche Finder。",
105
+ "body": """## 本教程配置什么
106
+
107
+ Thunderbolt 的 Kaggle 利基分析参考了 [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)。该项目使用公开的 [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) 分析视频、利基、趋势和标签。Thunderbolt 会在分析前准备并缓存该数据集。
108
+
109
+ > **重要:** 当前 Thunderbolt 流程在 **Niche Finder > Niche Finder Kaggle** 中手动启动。不需要创建 Kaggle kernel。
110
+
111
+ ## 1. 创建或确认 Kaggle 账户
112
+
113
+ 打开 [kaggle.com](https://www.kaggle.com/) 并登录,确认邮箱并完成 Kaggle 要求的账户验证。**username** 是个人资料中显示的标识;不要填写 `@`、空格或完整个人资料 URL。
114
+
115
+ ## 2. 获取 API Key
116
+
117
+ 1. 打开 [Kaggle API Tokens](https://www.kaggle.com/settings/api)。
118
+ 2. 在 **API** 区域点击 **Generate New Token**。新版 Kaggle CLI 也可以通过 `KAGGLE_API_TOKEN` 使用该令牌。
119
+ 3. 如果旧工具需要传统格式,请在 **Legacy API Credentials** 中点击 **Create Legacy API Key**,下载包含 `username` 和 `key` 的 `kaggle.json`。
120
+ 4. 不要把文件或密钥放入 GitHub、公开 Notebook 或消息中。泄露后立即撤销并重新生成。
121
+
122
+ 官方文档确认了 OAuth/CLI 和账户 Token 页面两种认证方式 [1] [2]。
123
+
124
+ ## 3. 填写 Thunderbolt 卡片
125
+
126
+ 进入 **API Configuration > API Keys > Niche Finder — Kaggle**。在 **Kaggle Username** 中填写不带 `@` 的用户名,在 **Kaggle API Key** 中填写密钥。**Kernel slug** 可以保持默认值;它用于兼容旧配置,当前数据集下载不需要它。点击 **Test API call**,确认绿色结果后点击 **Save**。
127
+
128
+ 测试只会进行经过身份验证的只读个人资料查询,不会创建 kernel、运行 Notebook 或发布内容。
129
+
130
+ ## 4. 运行利基分析
131
+
132
+ 进入 **Niche Finder > Niche Finder Kaggle**,选择日期、国家和可用筛选条件,然后点击 **Analyze Niches**。第一次运行会准备数据集并保存经过验证的本地缓存;之后可以复用缓存。如果缓存不完整,请确认凭据后再次准备。
133
+
134
+ ## 快速排查
135
+
136
+ | 现象 | 建议 |
137
+ | --- | --- |
138
+ | `401` 或红色测试 | 检查用户名,并在 Kaggle > Settings > API 重新生成密钥。 |
139
+ | `429` 或限流 | 等待几分钟,不要连续重复下载;Kaggle 使用动态限流。 |
140
+ | 数据集为空 | 检查趋势数据集链接并重新准备数据。 |
141
+ | 密钥泄露 | 在 Kaggle 撤销旧密钥,创建新密钥,只更新本地卡片。 |
142
+
143
+ ## 参考
144
+
145
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
146
+ """,
147
+ },
148
+ "de": {
149
+ "title": "Kaggle-Tutorial",
150
+ "caption": "Kaggle-Zugangsdaten für den Niche Finder nach dem Projekt Niche-Finder konfigurieren.",
151
+ "body": """## Was dieses Tutorial einrichtet
152
+
153
+ Der Kaggle-Nischenfinder von Thunderbolt ist von [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder) inspiriert. Die Referenz verwendet den öffentlichen [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code), um Videos, Nischen, Trends und Tags zu untersuchen. Thunderbolt bereitet den Datensatz vor und speichert einen lokalen Cache.
154
+
155
+ > **Wichtig:** Der aktuelle Thunderbolt-Ablauf wird manuell unter **Niche Finder > Niche Finder Kaggle** gestartet. Ein Kaggle-Kernel muss dafür nicht erstellt werden.
156
+
157
+ ## 1. Kaggle-Konto erstellen oder bestätigen
158
+
159
+ Öffnen Sie [kaggle.com](https://www.kaggle.com/), melden Sie sich an, bestätigen Sie Ihre E-Mail und erledigen Sie eventuell verlangte Kontoprüfungen. Der **Benutzername** ist der Name in Ihrem Profil; verwenden Sie kein `@`, keine Leerzeichen und nicht die vollständige Profil-URL.
160
+
161
+ ## 2. API-Key erhalten
162
+
163
+ 1. Öffnen Sie [Kaggle API Tokens](https://www.kaggle.com/settings/api).
164
+ 2. Klicken Sie im Bereich **API** auf **Generate New Token**. Die aktuelle Kaggle CLI kann diesen Token auch über `KAGGLE_API_TOKEN` verwenden.
165
+ 3. Für ältere Werkzeuge öffnen Sie **Legacy API Credentials** und klicken Sie auf **Create Legacy API Key**. Kaggle lädt `kaggle.json` mit `username` und `key` herunter.
166
+ 4. Bewahren Sie Datei und Key außerhalb von GitHub, öffentlichen Notebooks und Nachrichten auf. Bei einer Offenlegung sofort widerrufen und neu erzeugen.
167
+
168
+ Die offizielle Dokumentation bestätigt OAuth/CLI und die Erstellung eines API-Keys in den Kontoeinstellungen [1] [2].
169
+
170
+ ## 3. Thunderbolt-Karte ausfüllen
171
+
172
+ Öffnen Sie **API-Konfiguration > API Keys > Niche Finder — Kaggle**. Tragen Sie den Benutzernamen ohne `@` und den Key ein. **Kernel slug** kann auf dem Standardwert bleiben; er dient der Kompatibilität und ist für den aktuellen Datensatz-Download nicht erforderlich. Klicken Sie auf **API-Aufruf testen**, prüfen Sie das grüne Ergebnis und klicken Sie danach auf **Speichern**.
173
+
174
+ Der Test führt nur eine authentifizierte, schreibgeschützte Profilabfrage aus. Er erstellt keine Kernel, startet keine Notebooks und veröffentlicht nichts.
175
+
176
+ ## 4. Nischenanalyse ausführen
177
+
178
+ Gehen Sie zu **Niche Finder > Niche Finder Kaggle**, wählen Sie Datum, Land und Filter und klicken Sie auf **Analyze Niches**. Beim ersten Lauf wird der Datensatz vorbereitet und validiert lokal gespeichert. Bei einem unvollständigen Cache wiederholen Sie die Vorbereitung nach der Prüfung der Zugangsdaten.
179
+
180
+ ## Schnelle Fehlerbehebung
181
+
182
+ | Symptom | Empfehlung |
183
+ | --- | --- |
184
+ | `401` oder roter Test | Benutzernamen prüfen und unter Kaggle > Settings > API einen neuen Key erzeugen. |
185
+ | `429` oder Limit | Einige Minuten warten und Downloads nicht wiederholt starten; Kaggle verwendet dynamische Limits. |
186
+ | Datensatz leer | Trend-Datensatz prüfen und die automatische Vorbereitung wiederholen. |
187
+ | Key offengelegt | In Kaggle widerrufen, neuen Key erstellen und nur die lokale Karte aktualisieren. |
188
+
189
+ ## Quellen
190
+
191
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
192
+ """,
193
+ },
194
+ "vi": {
195
+ "title": "Hướng dẫn Kaggle",
196
+ "caption": "Cấu hình thông tin Kaggle cho Niche Finder dựa trên dự án Niche-Finder.",
197
+ "body": """## Hướng dẫn này cấu hình gì
198
+
199
+ Niche Finder Kaggle của Thunderbolt được tham khảo từ [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder). Dự án dùng [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) để phân tích video, ngách, xu hướng và thẻ. Thunderbolt chuẩn bị và lưu bộ dữ liệu vào bộ nhớ đệm trước khi phân tích.
200
+
201
+ > **Quan trọng:** quy trình hiện tại được chạy thủ công tại **Niche Finder > Niche Finder Kaggle**. Không cần tạo Kaggle kernel.
202
+
203
+ ## 1. Tạo hoặc xác nhận tài khoản Kaggle
204
+
205
+ Mở [kaggle.com](https://www.kaggle.com/), đăng nhập, xác nhận email và hoàn tất các bước xác minh nếu Kaggle yêu cầu. **Username** là tên trong hồ sơ; không nhập `@`, khoảng trắng hoặc URL đầy đủ.
206
+
207
+ ## 2. Lấy API Key
208
+
209
+ 1. Mở [Kaggle API Tokens](https://www.kaggle.com/settings/api).
210
+ 2. Trong phần **API**, chọn **Generate New Token**. Kaggle CLI hiện tại cũng dùng token qua `KAGGLE_API_TOKEN`.
211
+ 3. Với công cụ cũ, mở **Legacy API Credentials** và chọn **Create Legacy API Key** để tải `kaggle.json` gồm `username` và `key`.
212
+ 4. Không lưu file hoặc key trong GitHub, notebook công khai hay tin nhắn. Nếu bị lộ, hãy thu hồi và tạo key mới.
213
+
214
+ Tài liệu chính thức xác nhận cả OAuth/CLI và việc tạo API key trong phần cài đặt tài khoản [1] [2].
215
+
216
+ ## 3. Điền thẻ Thunderbolt
217
+
218
+ Mở **Cấu hình API > API Keys > Niche Finder — Kaggle**. Điền username không có `@` và API key. Có thể giữ **Kernel slug** mặc định; trường này chỉ duy trì tương thích và không cần cho việc tải dữ liệu hiện tại. Chọn **Kiểm tra lệnh gọi API**, xác nhận kết quả màu xanh rồi chọn **Lưu**.
219
+
220
+ Bài kiểm tra chỉ đọc hồ sơ qua một yêu cầu đã xác thực. Nó không tạo kernel, không chạy notebook và không xuất bản nội dung.
221
+
222
+ ## 4. Chạy phân tích ngách
223
+
224
+ Vào **Niche Finder > Niche Finder Kaggle**, chọn ngày, quốc gia và bộ lọc rồi chọn **Analyze Niches**. Lần đầu Thunderbolt chuẩn bị bộ dữ liệu và lưu bản cache đã kiểm tra. Nếu cache không đầy đủ, hãy kiểm tra thông tin rồi chạy lại.
225
+
226
+ ## Xử lý nhanh
227
+
228
+ | Hiện tượng | Cách xử lý |
229
+ | --- | --- |
230
+ | `401` hoặc kiểm tra đỏ | Kiểm tra username và tạo key mới tại Kaggle > Settings > API. |
231
+ | `429` hoặc giới hạn | Chờ vài phút và không tải lặp lại liên tục; Kaggle dùng giới hạn động. |
232
+ | Bộ dữ liệu trống | Kiểm tra liên kết bộ dữ liệu xu hướng và chuẩn bị lại. |
233
+ | Key bị lộ | Thu hồi trong Kaggle, tạo key mới và chỉ cập nhật thẻ cục bộ. |
234
+
235
+ ## Tài liệu tham khảo
236
+
237
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
238
+ """,
239
+ },
240
+ "tr": {
241
+ "title": "Kaggle Eğitimi",
242
+ "caption": "Niche-Finder projesini temel alarak Niche Finder için Kaggle kimlik bilgilerini yapılandırın.",
243
+ "body": """## Bu eğitim neyi yapılandırır
244
+
245
+ Thunderbolt Kaggle Niche Finder, [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder) projesinden uyarlanmıştır. Referans proje videoları, nişleri, trendleri ve etiketleri incelemek için herkese açık [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) verisini kullanır. Thunderbolt analizden önce bu veri setini hazırlar ve önbelleğe alır.
246
+
247
+ > **Önemli:** Güncel akış **Niche Finder > Niche Finder Kaggle** altında manuel başlatılır. Bu işlem için Kaggle kernel oluşturmanız gerekmez.
248
+
249
+ ## 1. Kaggle hesabı
250
+
251
+ [kaggle.com](https://www.kaggle.com/) adresini açın, giriş yapın, e-postanızı doğrulayın ve istenen hesap kontrollerini tamamlayın. **Kullanıcı adı**, profilinizde görünen addır; `@`, boşluk veya tam profil URL'si eklemeyin.
252
+
253
+ ## 2. API Key alma
254
+
255
+ 1. [Kaggle API Tokens](https://www.kaggle.com/settings/api) sayfasını açın.
256
+ 2. **API** bölümünde **Generate New Token** seçeneğine tıklayın. Güncel Kaggle CLI bu token'ı `KAGGLE_API_TOKEN` ile de kullanabilir.
257
+ 3. Eski araçlar için **Legacy API Credentials** bölümünde **Create Legacy API Key** seçeneğini kullanarak `username` ve `key` içeren `kaggle.json` dosyasını indirin.
258
+ 4. Dosyayı veya anahtarı GitHub'da, herkese açık notebooklarda ya da mesajlarda paylaşmayın. Açığa çıkarsa hemen iptal edip yenisini oluşturun.
259
+
260
+ Resmi belgeler OAuth/CLI ve hesap ayarlarındaki API key oluşturma yollarını açıklar [1] [2].
261
+
262
+ ## 3. Thunderbolt kartı
263
+
264
+ **API Yapılandırması > API Keys > Niche Finder — Kaggle** yolunu açın. Kullanıcı adını ve API key'i girin. **Kernel slug** varsayılan kalabilir; eski ayar uyumluluğu içindir ve güncel veri indirme için gerekli değildir. **API çağrısını test et** düğmesine tıklayın, yeşil sonucu kontrol edin ve ardından **Kaydet** seçeneğini kullanın.
265
+
266
+ Test yalnızca kimlik doğrulamalı, salt okunur bir profil isteği yapar. Kernel oluşturmaz, notebook çalıştırmaz ve yayınlama yapmaz.
267
+
268
+ ## 4. Niş analizini çalıştırma
269
+
270
+ **Niche Finder > Niche Finder Kaggle** sayfasına gidin, tarih, ülke ve filtreleri seçin ve **Analyze Niches** düğmesine tıklayın. İlk çalıştırmada veri seti hazırlanıp doğrulanmış yerel önbelleğe alınır.
271
+
272
+ ## Hızlı sorun giderme
273
+
274
+ | Belirti | Önerilen işlem |
275
+ | --- | --- |
276
+ | `401` veya kırmızı test | Kullanıcı adını kontrol edin ve Kaggle > Settings > API'den yeni key oluşturun. |
277
+ | `429` veya limit | Birkaç dakika bekleyin; Kaggle dinamik limitler uygular. |
278
+ | Veri seti boş | Trend veri seti bağlantısını kontrol edip hazırlığı tekrarlayın. |
279
+ | Key açığa çıktı | Kaggle'da iptal edin, yeni key oluşturun ve yalnızca yerel kartı güncelleyin. |
280
+
281
+ ## Kaynaklar
282
+
283
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
284
+ """,
285
+ },
286
+ "ru": {
287
+ "title": "Руководство Kaggle",
288
+ "caption": "Настройка данных Kaggle для Niche Finder на основе проекта Niche-Finder.",
289
+ "body": """## Что настраивает руководство
290
+
291
+ Kaggle Niche Finder в Thunderbolt создан с учётом [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder). Проект использует открытый [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) для анализа видео, ниш, трендов и тегов. Thunderbolt подготавливает и кэширует этот набор перед анализом.
292
+
293
+ > **Важно:** текущий процесс запускается вручную в **Niche Finder > Niche Finder Kaggle**. Создавать Kaggle kernel не нужно.
294
+
295
+ ## 1. Аккаунт Kaggle
296
+
297
+ Откройте [kaggle.com](https://www.kaggle.com/), войдите, подтвердите почту и завершите необходимые проверки аккаунта. **Username** — имя из профиля; не добавляйте `@`, пробелы или полный URL профиля.
298
+
299
+ ## 2. Получение API Key
300
+
301
+ 1. Откройте [Kaggle API Tokens](https://www.kaggle.com/settings/api).
302
+ 2. В разделе **API** нажмите **Generate New Token**. Новый Kaggle CLI также принимает этот токен через `KAGGLE_API_TOKEN`.
303
+ 3. Для старых инструментов откройте **Legacy API Credentials** и нажмите **Create Legacy API Key**, чтобы скачать `kaggle.json` с `username` и `key`.
304
+ 4. Не помещайте файл или ключ в GitHub, открытые Notebook или сообщения. При утечке отзовите ключ и создайте новый.
305
+
306
+ Официальная документация описывает OAuth/CLI и создание API key в настройках аккаунта [1] [2].
307
+
308
+ ## 3. Заполнение карточки Thunderbolt
309
+
310
+ Откройте **Настройка API > API Keys > Niche Finder — Kaggle** и заполните username и API key. **Kernel slug** можно оставить по умолчанию: он нужен для совместимости со старыми настройками и не требуется текущей загрузке данных. Нажмите **Проверить вызов API**, убедитесь в зелёном результате и нажмите **Сохранить**.
311
+
312
+ Проверка выполняет только аутентифицированный запрос профиля на чтение. Kernel и Notebook не создаются, публикация не выполняется.
313
+
314
+ ## 4. Запуск анализа ниш
315
+
316
+ Перейдите в **Niche Finder > Niche Finder Kaggle**, выберите даты, страну и фильтры и нажмите **Analyze Niches**. При первом запуске набор данных подготавливается и сохраняется в проверенный локальный кэш.
317
+
318
+ ## Быстрое решение проблем
319
+
320
+ | Симптом | Действие |
321
+ | --- | --- |
322
+ | `401` или красная проверка | Проверьте username и создайте новый ключ в Kaggle > Settings > API. |
323
+ | `429` или лимит | Подождите несколько минут; Kaggle использует динамические ограничения. |
324
+ | Нет данных | Проверьте ссылку на набор трендов и повторите подготовку. |
325
+ | Ключ раскрыт | Отзовите его в Kaggle, создайте новый и обновите только локальную карточку. |
326
+
327
+ ## Источники
328
+
329
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
330
+ """,
331
+ },
332
+ "es": {
333
+ "title": "Tutorial de Kaggle",
334
+ "caption": "Configura las credenciales de Kaggle para Niche Finder basándote en el proyecto Niche-Finder.",
335
+ "body": """## Qué configura este tutorial
336
+
337
+ El Niche Finder de Kaggle en Thunderbolt se inspira en [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder). La referencia usa el [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) para estudiar vídeos, nichos, tendencias y etiquetas. Thunderbolt prepara y guarda en caché ese conjunto antes del análisis.
338
+
339
+ > **Importante:** el flujo actual se inicia manualmente en **Niche Finder > Niche Finder Kaggle**. No es necesario crear un kernel de Kaggle.
340
+
341
+ ## 1. Cuenta de Kaggle
342
+
343
+ Abre [kaggle.com](https://www.kaggle.com/), inicia sesión, confirma tu correo y completa las verificaciones que solicite Kaggle. El **username** es el identificador del perfil; no añadas `@`, espacios ni la URL completa.
344
+
345
+ ## 2. Obtener la API Key
346
+
347
+ 1. Abre [Kaggle API Tokens](https://www.kaggle.com/settings/api).
348
+ 2. En **API**, pulsa **Generate New Token**. El Kaggle CLI actual también acepta el token mediante `KAGGLE_API_TOKEN`.
349
+ 3. Para herramientas antiguas, abre **Legacy API Credentials** y pulsa **Create Legacy API Key** para descargar `kaggle.json` con `username` y `key`.
350
+ 4. No guardes el archivo o la clave en GitHub, notebooks públicos ni mensajes. Si se expone, revócala y genera otra.
351
+
352
+ La documentación oficial confirma OAuth/CLI y la creación de claves en la configuración de tokens [1] [2].
353
+
354
+ ## 3. Completar la tarjeta de Thunderbolt
355
+
356
+ Abre **Configuración de API > API Keys > Niche Finder — Kaggle**. Introduce el username sin `@` y la API key. **Kernel slug** puede quedarse con el valor predeterminado; se conserva por compatibilidad y no es necesario para la descarga actual. Pulsa **Probar llamada API**, confirma el resultado verde y después **Guardar**.
357
+
358
+ La prueba solo consulta el perfil de forma autenticada y de lectura. No crea kernels, no ejecuta notebooks y no publica nada.
359
+
360
+ ## 4. Ejecutar el análisis
361
+
362
+ Ve a **Niche Finder > Niche Finder Kaggle**, selecciona fechas, país y filtros y pulsa **Analyze Niches**. En la primera ejecución se prepara el conjunto y se guarda una caché local validada.
363
+
364
+ ## Solución rápida
365
+
366
+ | Síntoma | Acción |
367
+ | --- | --- |
368
+ | `401` o prueba roja | Comprueba el username y genera una clave nueva en Kaggle > Settings > API. |
369
+ | `429` o límite | Espera unos minutos; Kaggle aplica límites dinámicos. |
370
+ | Conjunto vacío | Comprueba el enlace del dataset y repite la preparación. |
371
+ | Clave expuesta | Revócala en Kaggle, crea otra y actualiza solo la tarjeta local. |
372
+
373
+ ## Referencias
374
+
375
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
376
+ """,
377
+ },
378
+ "id": {
379
+ "title": "Tutorial Kaggle",
380
+ "caption": "Konfigurasikan kredensial Kaggle untuk Niche Finder berdasarkan proyek Niche-Finder.",
381
+ "body": """## Apa yang dikonfigurasi
382
+
383
+ Niche Finder Kaggle di Thunderbolt terinspirasi oleh [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder). Referensi tersebut memakai [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) untuk menganalisis video, niche, tren, dan tag. Thunderbolt menyiapkan serta menyimpan cache dataset sebelum analisis.
384
+
385
+ > **Penting:** alur Thunderbolt saat ini dijalankan secara manual dari **Niche Finder > Niche Finder Kaggle**. Anda tidak perlu membuat kernel Kaggle.
386
+
387
+ ## 1. Akun Kaggle
388
+
389
+ Buka [kaggle.com](https://www.kaggle.com/), masuk, konfirmasi email, dan selesaikan verifikasi yang diminta. **Username** adalah nama pada profil; jangan menambahkan `@`, spasi, atau URL lengkap.
390
+
391
+ ## 2. Mendapatkan API Key
392
+
393
+ 1. Buka [Kaggle API Tokens](https://www.kaggle.com/settings/api).
394
+ 2. Pada bagian **API**, klik **Generate New Token**. Kaggle CLI terbaru juga dapat memakai token melalui `KAGGLE_API_TOKEN`.
395
+ 3. Untuk alat lama, buka **Legacy API Credentials** dan klik **Create Legacy API Key** untuk mengunduh `kaggle.json` berisi `username` dan `key`.
396
+ 4. Jangan menyimpan file atau key di GitHub, notebook publik, atau pesan. Jika bocor, cabut dan buat yang baru.
397
+
398
+ Dokumentasi resmi menjelaskan OAuth/CLI dan pembuatan API key di pengaturan akun [1] [2].
399
+
400
+ ## 3. Mengisi kartu Thunderbolt
401
+
402
+ Buka **Konfigurasi API > API Keys > Niche Finder — Kaggle**. Masukkan username tanpa `@` dan API key. **Kernel slug** boleh memakai nilai bawaan; field ini dipertahankan untuk kompatibilitas dan tidak diperlukan untuk unduhan dataset saat ini. Klik **Uji panggilan API**, pastikan hasil hijau, lalu klik **Simpan**.
403
+
404
+ Pengujian hanya melakukan permintaan profil terautentikasi dan read-only. Tidak membuat kernel, menjalankan notebook, atau menerbitkan apa pun.
405
+
406
+ ## 4. Menjalankan analisis
407
+
408
+ Buka **Niche Finder > Niche Finder Kaggle**, pilih tanggal, negara, dan filter, lalu klik **Analyze Niches**. Saat pertama dijalankan, dataset disiapkan dan disimpan sebagai cache lokal yang telah divalidasi.
409
+
410
+ ## Pemecahan masalah
411
+
412
+ | Gejala | Tindakan |
413
+ | --- | --- |
414
+ | `401` atau tes merah | Periksa username dan buat key baru di Kaggle > Settings > API. |
415
+ | `429` atau batas | Tunggu beberapa menit; Kaggle menggunakan batas dinamis. |
416
+ | Dataset kosong | Periksa tautan dataset tren dan ulangi persiapan. |
417
+ | Key terbuka | Cabut di Kaggle, buat key baru, dan ubah hanya kartu lokal. |
418
+
419
+ ## Referensi
420
+
421
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
422
+ """,
423
+ },
424
+ "it": {
425
+ "title": "Tutorial Kaggle",
426
+ "caption": "Configura le credenziali Kaggle per Niche Finder sulla base del progetto Niche-Finder.",
427
+ "body": """## Cosa configura questo tutorial
428
+
429
+ Il Niche Finder Kaggle di Thunderbolt si ispira a [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder). Il progetto di riferimento usa il [Top Trending YouTube Videos Dataset](https://www.kaggle.com/datasets/asaniczka/trending-youtube-videos-113-countries/code) per analizzare video, nicchie, tendenze e tag. Thunderbolt prepara e memorizza nella cache questo dataset prima dell'analisi.
430
+
431
+ > **Importante:** il flusso attuale viene avviato manualmente da **Niche Finder > Niche Finder Kaggle**. Non è necessario creare un kernel Kaggle.
432
+
433
+ ## 1. Account Kaggle
434
+
435
+ Apri [kaggle.com](https://www.kaggle.com/), accedi, conferma l'e-mail e completa le verifiche richieste. Lo **username** è l'identificativo del profilo; non inserire `@`, spazi o l'URL completo.
436
+
437
+ ## 2. Ottenere la API Key
438
+
439
+ 1. Apri [Kaggle API Tokens](https://www.kaggle.com/settings/api).
440
+ 2. Nella sezione **API**, fai clic su **Generate New Token**. Il Kaggle CLI attuale può usare il token anche tramite `KAGGLE_API_TOKEN`.
441
+ 3. Per gli strumenti precedenti, apri **Legacy API Credentials** e fai clic su **Create Legacy API Key** per scaricare `kaggle.json` con `username` e `key`.
442
+ 4. Non conservare file o chiave in GitHub, notebook pubblici o messaggi. Se viene esposta, revocala e creane una nuova.
443
+
444
+ La documentazione ufficiale descrive OAuth/CLI e la creazione della chiave nelle impostazioni dell'account [1] [2].
445
+
446
+ ## 3. Compilare la scheda Thunderbolt
447
+
448
+ Apri **Configurazione API > API Keys > Niche Finder — Kaggle**. Inserisci username senza `@` e API key. **Kernel slug** può restare predefinito: è mantenuto per compatibilità e non serve per il download attuale. Fai clic su **Testa chiamata API**, verifica il risultato verde e poi fai clic su **Salva**.
449
+
450
+ Il test esegue solo una richiesta autenticata di lettura del profilo. Non crea kernel, non avvia notebook e non pubblica contenuti.
451
+
452
+ ## 4. Eseguire l'analisi
453
+
454
+ Vai a **Niche Finder > Niche Finder Kaggle**, scegli date, paese e filtri e fai clic su **Analyze Niches**. Al primo avvio il dataset viene preparato e salvato in una cache locale validata.
455
+
456
+ ## Risoluzione rapida
457
+
458
+ | Sintomo | Azione |
459
+ | --- | --- |
460
+ | `401` o test rosso | Controlla lo username e genera una nuova chiave in Kaggle > Settings > API. |
461
+ | `429` o limite | Attendi alcuni minuti; Kaggle usa limiti dinamici. |
462
+ | Dataset vuoto | Controlla il link del dataset e ripeti la preparazione. |
463
+ | Chiave esposta | Revocala in Kaggle, creane una nuova e aggiorna solo la scheda locale. |
464
+
465
+ ## Riferimenti
466
+
467
+ [1] [Kaggle Public API](https://www.kaggle.com/docs/api) · [2] [Kaggle CLI — Authentication](https://github.com/Kaggle/kaggle-cli/blob/main/docs/README.md) · [3] [johanfortus/Niche-Finder](https://github.com/johanfortus/Niche-Finder)
468
+ """,
469
+ },
470
+ },
471
+ "apify": {
472
+ "pt": {
473
+ "title": "Tutorial Apify",
474
+ "caption": "Configure a Apify para o Niche Finder e para a adaptação do workflow YTB Outlier Finder do n8n.",
475
+ "body": """## O que este tutorial configura
476
+
477
+ A aba **Niche Finder Apify** é a alternativa remota ao fluxo baseado no dataset Kaggle. Ela foi baseada e adaptada do workflow n8n [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), conhecido neste projecto como **YTB Outlier Finder**. O workflow de referência recupera palavras-chave, pesquisa vídeos no YouTube através de um actor Apify, aguarda o dataset, lê os resultados, resume os guiões e organiza a informação.
478
+
479
+ > **Diferença no Thunderbolt:** o fluxo é iniciado pelo botão **Pesquisar no Apify** e os resultados são tratados dentro da aplicação. Não é necessário configurar Airtable nem um gatilho semanal para fazer uma pesquisa manual.
480
+
481
+ ## 1. Criar a conta Apify
482
+
483
+ Abra [Apify Console](https://console.apify.com/) e crie uma conta ou entre na sua conta existente. Aceda a **Settings > API & Integrations**. O Apify documenta esta área como o local para gerir tokens pessoais e integrações.
484
+
485
+ ## 2. Criar e copiar a API Token
486
+
487
+ 1. Em [Settings > API & Integrations](https://console.apify.com/settings/integrations), escolha a opção para criar um novo token.
488
+ 2. Dê-lhe um nome reconhecível, por exemplo `thunderbolt-local`, e aplique o menor alcance disponível para a sua utilização, se a consola apresentar opções de permissões.
489
+ 3. Copie o token apenas uma vez para um local seguro. Ele funciona como uma credencial de acesso; não o coloque em workflows públicos, screenshots, GitHub ou mensagens.
490
+ 4. Se o token for exposto, elimine-o/revogá-lo na consola e crie outro.
491
+
492
+ A API oficial usa o cabeçalho `Authorization: Bearer YOUR_API_TOKEN`. O endpoint de diagnóstico documentado é `GET https://api.apify.com/v2/users/me` e deve responder `200` quando a credencial é válida [1].
493
+
494
+ ## 3. Preencher o cartão do Thunderbolt
495
+
496
+ Abra **Configuração API > API Keys > Niche Finder — Apify**. Preencha **Apify API Token**. Mantenha **Actor ID** com o valor predefinido, salvo se souber que pretende utilizar outro actor compatível; não troque o actor apenas para testar a chave. Ajuste os tempos de polling apenas quando necessário.
497
+
498
+ Clique em **Testar chamada API**. O Thunderbolt faz uma consulta read-only a `users/me`: não inicia actor, não cria dataset e não consome uma execução de scraping. Depois do resultado verde, clique em **Salvar**.
499
+
500
+ ## 4. Executar a pesquisa YTB Outlier Finder
501
+
502
+ Entre em **Niche Finder > Niche Finder Apify**, introduza as palavras-chave do nicho, país/idioma e os limites disponíveis e clique em **Pesquisar no Apify**. A aplicação inicia o actor configurado, aguarda a conclusão, lê o dataset devolvido e normaliza os vídeos para a análise local. Uma pesquisa pode demorar mais do que uma chamada de diagnóstico, porque o actor realmente consulta dados públicos do YouTube.
503
+
504
+ A lógica corresponde ao workflow n8n: **palavras-chave → pesquisa Apify → espera pelo dataset → leitura e normalização → análise de outliers**. O passo de Airtable do workflow original não é requisito do Thunderbolt.
505
+
506
+ ## Diagnóstico rápido
507
+
508
+ | Sintoma | Acção recomendada |
509
+ | --- | --- |
510
+ | `401` no teste | Crie outro token em Settings > API & Integrations e substitua o valor no cartão. |
511
+ | `403` ou actor sem permissão | Confirme a conta, o alcance do token e o Actor ID configurado. |
512
+ | Actor não encontrado | Use um Actor ID completo e compatível com o input esperado pelo Thunderbolt. |
513
+ | Execução pendente | Consulte a execução na própria aba; não inicie várias pesquisas iguais em paralelo. |
514
+ | Limites ou cobrança | Reveja o consumo e as condições actuais na consola Apify antes de executar novas pesquisas. |
515
+
516
+ ## Referências
517
+
518
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [Workflow YTB Outlier Finder no n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Vídeo associado](https://www.youtube.com/watch?v=pH2hVaij3FY)
519
+ """,
520
+ },
521
+ "en": {
522
+ "title": "Apify Tutorial",
523
+ "caption": "Configure Apify for Niche Finder and the Thunderbolt adaptation of the n8n YTB Outlier Finder workflow.",
524
+ "body": """## What this tutorial configures
525
+
526
+ The **Niche Finder Apify** page is the remote alternative to the Kaggle dataset flow. It was based on and adapted from the n8n workflow [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), referred to in this project as **YTB Outlier Finder**. The reference workflow retrieves keywords, searches YouTube through an Apify Actor, waits for the dataset, reads the results, summarizes scripts, and organizes the information.
527
+
528
+ > **Thunderbolt difference:** the flow starts with **Search Apify** and processes results inside the app. Airtable and a weekly trigger are not required for a manual search.
529
+
530
+ ## 1. Create an Apify account
531
+
532
+ Open [Apify Console](https://console.apify.com/) and sign up or sign in. Go to **Settings > API & Integrations**, the area Apify documents for managing personal tokens and integrations.
533
+
534
+ ## 2. Create and copy the API token
535
+
536
+ 1. Open [Settings > API & Integrations](https://console.apify.com/settings/integrations) and create a new token.
537
+ 2. Give it a clear name, such as `thunderbolt-local`, and choose the smallest available permission scope if the console offers scopes.
538
+ 3. Copy the token to a secure location. Never put it in public workflows, screenshots, GitHub, or messages.
539
+ 4. If it is exposed, revoke/delete it in the console and create a replacement.
540
+
541
+ Apify's API uses `Authorization: Bearer YOUR_API_TOKEN`. The documented diagnostic endpoint is `GET https://api.apify.com/v2/users/me`, which should return `200` for a valid credential [1].
542
+
543
+ ## 3. Fill in Thunderbolt
544
+
545
+ Open **API Configuration > API Keys > Niche Finder — Apify** and enter **Apify API Token**. Keep **Actor ID** at its default unless you know that another compatible Actor is required; do not change the Actor just to test the key. Adjust polling and timeout values only when necessary.
546
+
547
+ Click **Test API call**. Thunderbolt performs a read-only request to `users/me`: it does not start an Actor, create a dataset, or consume a scraping run. After the green result, click **Save**.
548
+
549
+ ## 4. Run the YTB Outlier Finder search
550
+
551
+ Go to **Niche Finder > Niche Finder Apify**, enter niche keywords and the available language/country and result limits, and click **Search Apify**. The app starts the configured Actor, waits for completion, reads the returned dataset, and normalizes videos for local analysis. A real search can take longer than the credential test because the Actor retrieves public YouTube data.
552
+
553
+ The adapted logic is: **keywords → Apify search → wait for dataset → read and normalize → outlier analysis**. The Airtable step from the original workflow is not required in Thunderbolt.
554
+
555
+ ## Quick troubleshooting
556
+
557
+ | Symptom | Recommended action |
558
+ | --- | --- |
559
+ | `401` in the test | Create another token in Settings > API & Integrations and replace it in the card. |
560
+ | `403` or Actor permission error | Check the account, token scope, and configured Actor ID. |
561
+ | Actor not found | Use a full Actor ID compatible with Thunderbolt's expected input. |
562
+ | Run remains pending | Monitor it in the page and do not launch identical searches in parallel. |
563
+ | Limits or charges | Review current usage and terms in the Apify console before starting more searches. |
564
+
565
+ ## References
566
+
567
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [YTB Outlier Finder workflow on n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Associated video](https://www.youtube.com/watch?v=pH2hVaij3FY)
568
+ """,
569
+ },
570
+ "zh": {
571
+ "title": "Apify 教程",
572
+ "caption": "为 Niche Finder 配置 Apify,并了解 Thunderbolt 对 n8n YTB Outlier Finder 流程的改编。",
573
+ "body": """## 本教程配置什么
574
+
575
+ **Niche Finder Apify** 是基于 Kaggle 数据集流程的远程替代方案。它参考并改编了 n8n 工作流 [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/),在本项目中称为 **YTB Outlier Finder**。原流程会取得关键词,通过 Apify Actor 搜索 YouTube,等待数据集,读取结果并整理信息。
576
+
577
+ > **Thunderbolt 的区别:** 点击 **Search Apify** 后在应用内部处理结果。手动搜索不需要 Airtable 或每周触发器。
578
+
579
+ ## 1. 创建 Apify 账户
580
+
581
+ 打开 [Apify Console](https://console.apify.com/) 并注册或登录,然后进入 **Settings > API & Integrations** 管理个人 Token。
582
+
583
+ ## 2. 创建并复制 API Token
584
+
585
+ 1. 在 [Settings > API & Integrations](https://console.apify.com/settings/integrations) 创建新 Token。
586
+ 2. 使用清晰的名称,例如 `thunderbolt-local`;如果控制台提供权限范围,请选择满足用途的最小范围。
587
+ 3. 将 Token 保存到安全位置,不要放入公开 workflow、截图、GitHub 或消息中。
588
+ 4. 如果 Token 泄露,请在控制台撤销/删除并重新创建。
589
+
590
+ Apify API 使用 `Authorization: Bearer YOUR_API_TOKEN`。官方记录的诊断接口是 `GET https://api.apify.com/v2/users/me`,有效凭据应返回 `200` [1]。
591
+
592
+ ## 3. 填写 Thunderbolt
593
+
594
+ 进入 **API Configuration > API Keys > Niche Finder — Apify**,填写 **Apify API Token**。除非明确需要兼容 Actor,否则保持默认 **Actor ID**;不要为了测试密钥而更换 Actor。
595
+
596
+ 点击 **Test API call**。Thunderbolt 只读取 `users/me`,不会启动 Actor、创建数据集或消耗抓取运行。看到绿色结果后点击 **Save**。
597
+
598
+ ## 4. 运行 YTB Outlier Finder 搜索
599
+
600
+ 进入 **Niche Finder > Niche Finder Apify**,填写利基关键词和可用的语言、国家及数量限制,然后点击 **Search Apify**。应用会启动配置的 Actor,等待完成,读取数据集并规范化视频。真实搜索比凭据测试耗时更长,因为 Actor 会检索公开的 YouTube 数据。
601
+
602
+ 改编后的顺序是:**关键词 → Apify 搜索 → 等待数据集 → 读取与规范化 → 异常视频分析**。原工作流的 Airtable 步骤不是 Thunderbolt 的要求。
603
+
604
+ ## 快速排查
605
+
606
+ | 现象 | 建议 |
607
+ | --- | --- |
608
+ | 测试返回 `401` | 在 Settings > API & Integrations 创建新 Token 并替换卡片内容。 |
609
+ | `403` 或 Actor 权限错误 | 检查账户、Token 权限和 Actor ID。 |
610
+ | 找不到 Actor | 使用完整且兼容的 Actor ID。 |
611
+ | 运行一直等待 | 在页面中查看状态,不要并行启动相同搜索。 |
612
+ | 限额或费用 | 开始更多搜索前,查看 Apify 控制台的当前用量和条款。 |
613
+
614
+ ## 参考
615
+
616
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [n8n YTB Outlier Finder 工作流](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [关联视频](https://www.youtube.com/watch?v=pH2hVaij3FY)
617
+ """,
618
+ },
619
+ "de": {
620
+ "title": "Apify-Tutorial",
621
+ "caption": "Apify für Niche Finder und die Thunderbolt-Anpassung des n8n-Workflows YTB Outlier Finder konfigurieren.",
622
+ "body": """## Was dieses Tutorial einrichtet
623
+
624
+ **Niche Finder Apify** ist die entfernte Alternative zum Kaggle-Datensatz. Die Seite basiert auf dem n8n-Workflow [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), der in diesem Projekt **YTB Outlier Finder** heißt. Die Referenz sammelt Keywords, sucht mit einem Apify Actor nach YouTube-Videos, wartet auf den Datensatz und verarbeitet die Ergebnisse.
625
+
626
+ > **Unterschied bei Thunderbolt:** Eine manuelle Suche startet über **Search Apify** und wird in der Anwendung verarbeitet. Airtable und ein wöchentlicher Trigger sind nicht erforderlich.
627
+
628
+ ## 1. Apify-Konto
629
+
630
+ Öffnen Sie [Apify Console](https://console.apify.com/), registrieren Sie sich oder melden Sie sich an und öffnen Sie **Settings > API & Integrations**.
631
+
632
+ ## 2. API-Token erstellen
633
+
634
+ 1. Erstellen Sie unter [Settings > API & Integrations](https://console.apify.com/settings/integrations) einen neuen Token.
635
+ 2. Verwenden Sie einen eindeutigen Namen wie `thunderbolt-local`. Falls Berechtigungsbereiche angeboten werden, wählen Sie den kleinsten passenden Umfang.
636
+ 3. Speichern Sie den Token sicher und geben Sie ihn nicht in öffentlichen Workflows, Screenshots, GitHub oder Nachrichten weiter.
637
+ 4. Bei Offenlegung Token in der Konsole widerrufen/löschen und ersetzen.
638
+
639
+ Die Apify API verwendet `Authorization: Bearer YOUR_API_TOKEN`. Der dokumentierte Prüf-Endpunkt ist `GET https://api.apify.com/v2/users/me`; bei gültigen Daten wird `200` erwartet [1].
640
+
641
+ ## 3. Thunderbolt ausfüllen
642
+
643
+ Öffnen Sie **API-Konfiguration > API Keys > Niche Finder — Apify**, tragen Sie **Apify API Token** ein und lassen Sie **Actor ID** standardmäßig, sofern kein kompatibler anderer Actor benötigt wird. Klicken Sie auf **API-Aufruf testen**. Die Prüfung liest nur `users/me`; sie startet keinen Actor und erstellt keinen Datensatz. Danach **Speichern** wählen.
644
+
645
+ ## 4. YTB-Outlier-Finder-Suche
646
+
647
+ Gehen Sie zu **Niche Finder > Niche Finder Apify**, geben Sie Keywords sowie die verfügbaren Sprach-, Länder- und Ergebnisgrenzen ein und klicken Sie auf **Search Apify**. Thunderbolt startet den Actor, wartet auf die Fertigstellung, liest den Datensatz und normalisiert Videos für die lokale Analyse.
648
+
649
+ Die Reihenfolge lautet: **Keywords → Apify-Suche → auf Datensatz warten → lesen und normalisieren → Outlier-Analyse**. Airtable aus dem ursprünglichen Workflow ist nicht erforderlich.
650
+
651
+ ## Schnelle Fehlerbehebung
652
+
653
+ | Symptom | Empfehlung |
654
+ | --- | --- |
655
+ | `401` beim Test | Neuen Token in Settings > API & Integrations erzeugen und ersetzen. |
656
+ | `403` oder Actor-Fehler | Konto, Token-Berechtigung und Actor ID prüfen. |
657
+ | Actor nicht gefunden | Vollständige kompatible Actor ID verwenden. |
658
+ | Lauf wartet | Status in der Seite prüfen und gleiche Suchen nicht parallel starten. |
659
+ | Limits oder Kosten | Vor weiteren Suchen aktuelle Nutzung und Bedingungen in der Apify-Konsole prüfen. |
660
+
661
+ ## Quellen
662
+
663
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [YTB Outlier Finder auf n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Zugehöriges Video](https://www.youtube.com/watch?v=pH2hVaij3FY)
664
+ """,
665
+ },
666
+ "vi": {
667
+ "title": "Hướng dẫn Apify",
668
+ "caption": "Cấu hình Apify cho Niche Finder và phiên bản Thunderbolt của workflow YTB Outlier Finder trên n8n.",
669
+ "body": """## Hướng dẫn này cấu hình gì
670
+
671
+ Trang **Niche Finder Apify** là lựa chọn từ xa thay cho luồng dữ liệu Kaggle. Trang này dựa trên và điều chỉnh workflow n8n [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), được gọi là **YTB Outlier Finder** trong dự án. Workflow lấy từ khóa, tìm video YouTube bằng Apify Actor, chờ dataset và xử lý kết quả.
672
+
673
+ > **Khác biệt:** tìm kiếm thủ công bắt đầu bằng **Search Apify** và kết quả được xử lý trong ứng dụng. Không cần Airtable hoặc trigger hàng tuần.
674
+
675
+ ## 1. Tạo tài khoản Apify
676
+
677
+ Mở [Apify Console](https://console.apify.com/), đăng ký hoặc đăng nhập và vào **Settings > API & Integrations**.
678
+
679
+ ## 2. Tạo API token
680
+
681
+ 1. Tạo token mới tại [Settings > API & Integrations](https://console.apify.com/settings/integrations).
682
+ 2. Đặt tên rõ ràng như `thunderbolt-local`; nếu có phạm vi quyền, chọn phạm vi nhỏ nhất phù hợp.
683
+ 3. Lưu token an toàn, không đưa vào workflow công khai, ảnh chụp, GitHub hoặc tin nhắn.
684
+ 4. Nếu bị lộ, thu hồi/xóa token trong Console và tạo token mới.
685
+
686
+ API Apify dùng `Authorization: Bearer YOUR_API_TOKEN`. Endpoint kiểm tra chính thức là `GET https://api.apify.com/v2/users/me` và thông tin hợp lệ trả về `200` [1].
687
+
688
+ ## 3. Điền Thunderbolt
689
+
690
+ Mở **Cấu hình API > API Keys > Niche Finder — Apify**, nhập **Apify API Token**. Giữ **Actor ID** mặc định trừ khi bạn cần Actor tương thích khác. Chọn **Kiểm tra lệnh gọi API**; Thunderbolt chỉ đọc `users/me`, không chạy Actor và không tạo dataset. Sau đó chọn **Lưu**.
691
+
692
+ ## 4. Chạy tìm kiếm YTB Outlier Finder
693
+
694
+ Vào **Niche Finder > Niche Finder Apify**, nhập từ khóa ngách và các giới hạn ngôn ngữ, quốc gia, số kết quả rồi chọn **Search Apify**. Ứng dụng khởi chạy Actor, chờ hoàn tất, đọc dataset và chuẩn hóa video cho phân tích cục bộ.
695
+
696
+ Trình tự được điều chỉnh là: **từ khóa → tìm kiếm Apify → chờ dataset → đọc và chuẩn hóa → phân tích outlier**. Bước Airtable của workflow gốc không bắt buộc.
697
+
698
+ ## Xử lý nhanh
699
+
700
+ | Hiện tượng | Cách xử lý |
701
+ | --- | --- |
702
+ | `401` | Tạo token mới trong Settings > API & Integrations và thay vào thẻ. |
703
+ | `403` hoặc lỗi quyền Actor | Kiểm tra tài khoản, quyền token và Actor ID. |
704
+ | Không tìm thấy Actor | Dùng Actor ID đầy đủ và tương thích. |
705
+ | Chạy đang chờ | Theo dõi ngay trong trang và không chạy trùng song song. |
706
+ | Giới hạn hoặc chi phí | Kiểm tra mức dùng và điều khoản hiện tại trong Console Apify. |
707
+
708
+ ## Tài liệu tham khảo
709
+
710
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [Workflow YTB Outlier Finder trên n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Video liên quan](https://www.youtube.com/watch?v=pH2hVaij3FY)
711
+ """,
712
+ },
713
+ "tr": {
714
+ "title": "Apify Eğitimi",
715
+ "caption": "Niche Finder için Apify'ı ve n8n YTB Outlier Finder iş akışının Thunderbolt uyarlamasını yapılandırın.",
716
+ "body": """## Bu eğitim neyi yapılandırır
717
+
718
+ **Niche Finder Apify**, Kaggle veri seti akışının uzak alternatifidir. Bu sayfa, projede **YTB Outlier Finder** adı verilen n8n iş akışı [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) temel alınarak uyarlanmıştır. Referans; anahtar kelimeleri alır, Apify Actor ile YouTube araması yapar, veri setini bekler ve sonuçları işler.
719
+
720
+ > **Thunderbolt farkı:** Manuel arama **Search Apify** düğmesiyle başlar ve sonuçlar uygulama içinde işlenir. Airtable veya haftalık tetikleyici gerekli değildir.
721
+
722
+ ## 1. Apify hesabı
723
+
724
+ [Apify Console](https://console.apify.com/) adresini açın, kayıt olun veya giriş yapın ve **Settings > API & Integrations** bölümüne gidin.
725
+
726
+ ## 2. API token oluşturma
727
+
728
+ 1. [Settings > API & Integrations](https://console.apify.com/settings/integrations) sayfasında yeni token oluşturun.
729
+ 2. `thunderbolt-local` gibi anlaşılır bir ad verin; izin kapsamları sunuluyorsa gereken en küçük kapsamı seçin.
730
+ 3. Token'ı güvenli yerde saklayın; herkese açık workflow, ekran görüntüsü, GitHub veya mesajlarda paylaşmayın.
731
+ 4. Açığa çıkarsa Console'dan iptal/silme işlemi yapıp yeni token oluşturun.
732
+
733
+ Apify API `Authorization: Bearer YOUR_API_TOKEN` kullanır. Resmi doğrulama endpoint'i `GET https://api.apify.com/v2/users/me` adresidir ve geçerli kimlik bilgileri `200` döndürmelidir [1].
734
+
735
+ ## 3. Thunderbolt ayarı
736
+
737
+ **API Yapılandırması > API Keys > Niche Finder — Apify** yolunu açın ve **Apify API Token** alanını doldurun. Uyumlu başka bir Actor gerekmiyorsa **Actor ID** varsayılan kalsın. **API çağrısını test et** düğmesi yalnızca `users/me` okur; Actor başlatmaz ve veri seti oluşturmaz. Yeşil sonuçtan sonra **Kaydet** seçeneğine tıklayın.
738
+
739
+ ## 4. YTB Outlier Finder araması
740
+
741
+ **Niche Finder > Niche Finder Apify** sayfasında niş anahtar kelimelerini ve mevcut dil, ülke ve sonuç sınırlarını girip **Search Apify** düğmesine tıklayın. Uygulama Actor'ı başlatır, bitmesini bekler, veri setini okur ve videoları yerel analiz için normalleştirir.
742
+
743
+ Uyarlanan sıra: **anahtar kelimeler → Apify araması → veri setini bekle → oku ve normalleştir → outlier analizi**. Orijinal iş akışındaki Airtable adımı Thunderbolt için zorunlu değildir.
744
+
745
+ ## Hızlı sorun giderme
746
+
747
+ | Belirti | Öneri |
748
+ | --- | --- |
749
+ | `401` | Settings > API & Integrations üzerinden yeni token oluşturup kartı güncelleyin. |
750
+ | `403` veya Actor yetki hatası | Hesabı, token izinlerini ve Actor ID'yi kontrol edin. |
751
+ | Actor bulunamadı | Tam ve uyumlu Actor ID kullanın. |
752
+ | Çalışma bekliyor | Sayfadan izleyin ve aynı aramaları paralel başlatmayın. |
753
+ | Limit veya ücret | Yeni aramalardan önce Apify Console'daki güncel kullanımı ve koşulları inceleyin. |
754
+
755
+ ## Kaynaklar
756
+
757
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [n8n YTB Outlier Finder workflow](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [İlgili video](https://www.youtube.com/watch?v=pH2hVaij3FY)
758
+ """,
759
+ },
760
+ "ru": {
761
+ "title": "Руководство Apify",
762
+ "caption": "Настройте Apify для Niche Finder и адаптации workflow YTB Outlier Finder из n8n.",
763
+ "body": """## Что настраивает руководство
764
+
765
+ Страница **Niche Finder Apify** — удалённая альтернатива потоку Kaggle. Она основана на workflow n8n [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), который в проекте называется **YTB Outlier Finder**. Исходный процесс получает ключевые слова, ищет видео YouTube через Apify Actor, ждёт набор данных и обрабатывает результаты.
766
+
767
+ > **Отличие Thunderbolt:** ручной поиск запускается кнопкой **Search Apify**, а результаты обрабатываются внутри приложения. Airtable и еженедельный trigger не требуются.
768
+
769
+ ## 1. Аккаунт Apify
770
+
771
+ Откройте [Apify Console](https://console.apify.com/), зарегистрируйтесь или войдите и перейдите в **Settings > API & Integrations**.
772
+
773
+ ## 2. Создание API token
774
+
775
+ 1. Создайте новый token в [Settings > API & Integrations](https://console.apify.com/settings/integrations).
776
+ 2. Назовите его, например `thunderbolt-local`; при наличии областей разрешений выберите минимально необходимую.
777
+ 3. Сохраните token безопасно. Не помещайте его в публичные workflow, снимки экрана, GitHub или сообщения.
778
+ 4. При утечке отзовите/удалите token в Console и создайте новый.
779
+
780
+ API Apify использует `Authorization: Bearer YOUR_API_TOKEN`. Официальная проверка выполняется через `GET https://api.apify.com/v2/users/me` и для действительных данных возвращает `200` [1].
781
+
782
+ ## 3. Карточка Thunderbolt
783
+
784
+ Откройте **Настройка API > API Keys > Niche Finder — Apify**, заполните **Apify API Token** и оставьте **Actor ID** по умолчанию, если другой совместимый Actor не нужен. Нажмите **Проверить вызов API**: Thunderbolt только читает `users/me`, не запускает Actor и не создаёт dataset. После зелёного результата нажмите **Сохранить**.
785
+
786
+ ## 4. Поиск YTB Outlier Finder
787
+
788
+ Перейдите в **Niche Finder > Niche Finder Apify**, введите ключевые слова ниши и доступные ограничения языка, страны и количества результатов, затем нажмите **Search Apify**. Приложение запускает Actor, ждёт завершения, читает dataset и нормализует видео для локального анализа.
789
+
790
+ Порядок адаптации: **ключевые слова → поиск Apify → ожидание dataset → чтение и нормализация → анализ outlier**. Шаг Airtable из исходного workflow не обязателен.
791
+
792
+ ## Быстрое решение проблем
793
+
794
+ | Симптом | Действие |
795
+ | --- | --- |
796
+ | `401` | Создайте новый token в Settings > API & Integrations и замените его в карточке. |
797
+ | `403` или ошибка разрешений Actor | Проверьте аккаунт, разрешения token и Actor ID. |
798
+ | Actor не найден | Используйте полный совместимый Actor ID. |
799
+ | Запуск ожидает | Следите за ним на странице и не запускайте одинаковые поиски параллельно. |
800
+ | Лимиты или расходы | Перед новыми поисками проверьте текущее использование и условия в Console Apify. |
801
+
802
+ ## Источники
803
+
804
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [Workflow YTB Outlier Finder в n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Связанное видео](https://www.youtube.com/watch?v=pH2hVaij3FY)
805
+ """,
806
+ },
807
+ "es": {
808
+ "title": "Tutorial de Apify",
809
+ "caption": "Configura Apify para Niche Finder y la adaptación en Thunderbolt del workflow YTB Outlier Finder de n8n.",
810
+ "body": """## Qué configura este tutorial
811
+
812
+ La página **Niche Finder Apify** es la alternativa remota al flujo de Kaggle. Se basa en el workflow de n8n [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), llamado **YTB Outlier Finder** en este proyecto. El flujo de referencia obtiene palabras clave, busca vídeos de YouTube mediante un Actor de Apify, espera el dataset y procesa los resultados.
813
+
814
+ > **Diferencia en Thunderbolt:** la búsqueda manual empieza con **Search Apify** y los resultados se procesan dentro de la aplicación. No se necesita Airtable ni un disparador semanal.
815
+
816
+ ## 1. Crear la cuenta Apify
817
+
818
+ Abre [Apify Console](https://console.apify.com/), regístrate o inicia sesión y entra en **Settings > API & Integrations**.
819
+
820
+ ## 2. Crear y copiar el API token
821
+
822
+ 1. Crea un token nuevo en [Settings > API & Integrations](https://console.apify.com/settings/integrations).
823
+ 2. Usa un nombre claro, como `thunderbolt-local`, y el alcance mínimo disponible si la consola ofrece permisos.
824
+ 3. Guarda el token de forma segura y no lo incluyas en workflows públicos, capturas, GitHub o mensajes.
825
+ 4. Si se expone, revócalo/elíminalo en la consola y crea otro.
826
+
827
+ La API de Apify usa `Authorization: Bearer YOUR_API_TOKEN`. El endpoint oficial de verificación es `GET https://api.apify.com/v2/users/me` y debe devolver `200` con credenciales válidas [1].
828
+
829
+ ## 3. Completar Thunderbolt
830
+
831
+ Abre **Configuración de API > API Keys > Niche Finder — Apify**, introduce **Apify API Token** y deja **Actor ID** por defecto salvo que necesites otro Actor compatible. Pulsa **Probar llamada API**: Thunderbolt solo lee `users/me`, no inicia un Actor ni crea un dataset. Después del resultado verde, pulsa **Guardar**.
832
+
833
+ ## 4. Ejecutar la búsqueda YTB Outlier Finder
834
+
835
+ Ve a **Niche Finder > Niche Finder Apify**, introduce palabras clave del nicho y los límites disponibles de idioma, país y resultados y pulsa **Search Apify**. La aplicación inicia el Actor, espera, lee el dataset y normaliza los vídeos para el análisis local.
836
+
837
+ La secuencia adaptada es: **palabras clave → búsqueda Apify → esperar dataset → leer y normalizar → análisis de outliers**. El paso de Airtable del workflow original no es obligatorio.
838
+
839
+ ## Solución rápida
840
+
841
+ | Síntoma | Acción |
842
+ | --- | --- |
843
+ | `401` | Crea otro token en Settings > API & Integrations y reemplázalo en la tarjeta. |
844
+ | `403` o error de permisos | Comprueba la cuenta, los permisos del token y el Actor ID. |
845
+ | Actor no encontrado | Usa un Actor ID completo y compatible. |
846
+ | Ejecución pendiente | Vigílala en la página y no ejecutes búsquedas iguales en paralelo. |
847
+ | Límites o costes | Revisa el uso y las condiciones actuales en Apify Console antes de iniciar más búsquedas. |
848
+
849
+ ## Referencias
850
+
851
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [Workflow YTB Outlier Finder en n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Vídeo asociado](https://www.youtube.com/watch?v=pH2hVaij3FY)
852
+ """,
853
+ },
854
+ "id": {
855
+ "title": "Tutorial Apify",
856
+ "caption": "Konfigurasikan Apify untuk Niche Finder dan adaptasi workflow YTB Outlier Finder n8n di Thunderbolt.",
857
+ "body": """## Apa yang dikonfigurasi
858
+
859
+ Halaman **Niche Finder Apify** adalah alternatif jarak jauh untuk alur dataset Kaggle. Halaman ini diadaptasi dari workflow n8n [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), yang disebut **YTB Outlier Finder** dalam proyek ini. Alurnya mengambil kata kunci, mencari video YouTube melalui Apify Actor, menunggu dataset, lalu memproses hasil.
860
+
861
+ > **Perbedaan Thunderbolt:** pencarian manual dimulai dengan **Search Apify** dan hasil diproses di dalam aplikasi. Airtable dan pemicu mingguan tidak diperlukan.
862
+
863
+ ## 1. Membuat akun Apify
864
+
865
+ Buka [Apify Console](https://console.apify.com/), daftar atau masuk, lalu buka **Settings > API & Integrations**.
866
+
867
+ ## 2. Membuat API token
868
+
869
+ 1. Buat token baru di [Settings > API & Integrations](https://console.apify.com/settings/integrations).
870
+ 2. Gunakan nama jelas seperti `thunderbolt-local`; jika tersedia pilihan izin, pilih cakupan paling kecil yang diperlukan.
871
+ 3. Simpan token dengan aman dan jangan memasukkannya ke workflow publik, screenshot, GitHub, atau pesan.
872
+ 4. Jika bocor, cabut/hapus token di Console dan buat yang baru.
873
+
874
+ API Apify memakai `Authorization: Bearer YOUR_API_TOKEN`. Endpoint pemeriksaan resmi adalah `GET https://api.apify.com/v2/users/me` dan kredensial valid mengembalikan `200` [1].
875
+
876
+ ## 3. Mengisi Thunderbolt
877
+
878
+ Buka **Konfigurasi API > API Keys > Niche Finder — Apify**, isi **Apify API Token**, dan biarkan **Actor ID** pada nilai bawaan kecuali Anda memerlukan Actor kompatibel lain. Klik **Uji panggilan API**; Thunderbolt hanya membaca `users/me`, tidak menjalankan Actor atau membuat dataset. Setelah hasil hijau, klik **Simpan**.
879
+
880
+ ## 4. Menjalankan pencarian YTB Outlier Finder
881
+
882
+ Buka **Niche Finder > Niche Finder Apify**, masukkan kata kunci niche serta batas bahasa, negara, dan jumlah hasil yang tersedia, lalu klik **Search Apify**. Aplikasi menjalankan Actor, menunggu selesai, membaca dataset, dan menormalkan video untuk analisis lokal.
883
+
884
+ Urutan adaptasinya: **kata kunci → pencarian Apify → tunggu dataset → baca dan normalisasi → analisis outlier**. Langkah Airtable dari workflow asli tidak wajib di Thunderbolt.
885
+
886
+ ## Pemecahan masalah
887
+
888
+ | Gejala | Tindakan |
889
+ | --- | --- |
890
+ | `401` | Buat token lain di Settings > API & Integrations dan ganti pada kartu. |
891
+ | `403` atau izin Actor gagal | Periksa akun, izin token, dan Actor ID. |
892
+ | Actor tidak ditemukan | Gunakan Actor ID lengkap yang kompatibel. |
893
+ | Proses masih menunggu | Pantau dari halaman dan jangan menjalankan pencarian sama secara paralel. |
894
+ | Batas atau biaya | Tinjau penggunaan dan ketentuan terbaru di Apify Console sebelum pencarian berikutnya. |
895
+
896
+ ## Referensi
897
+
898
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [Workflow YTB Outlier Finder di n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Video terkait](https://www.youtube.com/watch?v=pH2hVaij3FY)
899
+ """,
900
+ },
901
+ "it": {
902
+ "title": "Tutorial Apify",
903
+ "caption": "Configura Apify per Niche Finder e l'adattamento Thunderbolt del workflow n8n YTB Outlier Finder.",
904
+ "body": """## Cosa configura questo tutorial
905
+
906
+ La pagina **Niche Finder Apify** è l'alternativa remota al flusso del dataset Kaggle. È basata sul workflow n8n [Discover HIDDEN YouTube trends / outlier videos in your niche (Apify + Airtable)](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/), chiamato **YTB Outlier Finder** nel progetto. Il workflow di riferimento recupera parole chiave, cerca video su YouTube tramite un Actor Apify, attende il dataset e tratta i risultati.
907
+
908
+ > **Differenza Thunderbolt:** la ricerca manuale parte da **Search Apify** e i risultati vengono trattati nell'applicazione. Airtable e un trigger settimanale non sono necessari.
909
+
910
+ ## 1. Account Apify
911
+
912
+ Apri [Apify Console](https://console.apify.com/), registrati o accedi e vai a **Settings > API & Integrations**.
913
+
914
+ ## 2. Creare l'API token
915
+
916
+ 1. Crea un nuovo token in [Settings > API & Integrations](https://console.apify.com/settings/integrations).
917
+ 2. Usa un nome chiaro, per esempio `thunderbolt-local`; se sono disponibili permessi, scegli l'ambito minimo necessario.
918
+ 3. Conserva il token in sicurezza e non inserirlo in workflow pubblici, screenshot, GitHub o messaggi.
919
+ 4. Se viene esposto, revocalo/eliminalo nella Console e creane uno nuovo.
920
+
921
+ L'API Apify usa `Authorization: Bearer YOUR_API_TOKEN`. L'endpoint ufficiale di verifica è `GET https://api.apify.com/v2/users/me` e restituisce `200` con credenziali valide [1].
922
+
923
+ ## 3. Compilare Thunderbolt
924
+
925
+ Apri **Configurazione API > API Keys > Niche Finder — Apify**, inserisci **Apify API Token** e lascia **Actor ID** predefinito salvo la necessità di un Actor compatibile diverso. Fai clic su **Testa chiamata API**: Thunderbolt legge solo `users/me`, non avvia Actor e non crea dataset. Dopo il risultato verde, fai clic su **Salva**.
926
+
927
+ ## 4. Eseguire la ricerca YTB Outlier Finder
928
+
929
+ Vai a **Niche Finder > Niche Finder Apify**, inserisci parole chiave della nicchia e i limiti disponibili di lingua, paese e risultati, poi fai clic su **Search Apify**. L'app avvia l'Actor, attende il completamento, legge il dataset e normalizza i video per l'analisi locale.
930
+
931
+ La sequenza adattata è: **parole chiave → ricerca Apify → attesa dataset → lettura e normalizzazione → analisi outlier**. Il passaggio Airtable del workflow originale non è obbligatorio.
932
+
933
+ ## Risoluzione rapida
934
+
935
+ | Sintomo | Azione |
936
+ | --- | --- |
937
+ | `401` | Crea un nuovo token in Settings > API & Integrations e sostituiscilo nella scheda. |
938
+ | `403` o errore di autorizzazione | Controlla account, permessi del token e Actor ID. |
939
+ | Actor non trovato | Usa un Actor ID completo e compatibile. |
940
+ | Esecuzione in attesa | Controllala nella pagina e non avviare ricerche identiche in parallelo. |
941
+ | Limiti o costi | Controlla uso e condizioni attuali nella Console Apify prima di altre ricerche. |
942
+
943
+ ## Riferimenti
944
+
945
+ [1] [Apify API — Get started](https://docs.apify.com/api/v2/getting-started) · [2] [Apify Console — API & Integrations](https://console.apify.com/settings/integrations) · [3] [Workflow YTB Outlier Finder su n8n](https://n8n.io/workflows/4187-discover-hidden-youtube-trends-outlier-videos-in-your-niche-apify-airtable/) · [4] [Video associato](https://www.youtube.com/watch?v=pH2hVaij3FY)
946
+ """,
947
+ },
948
+ },
949
+ }
950
+
951
+
952
+ def tutorial_definition(kind: str, language: str) -> dict[str, str]:
953
+ """Return a localized tutorial definition, falling back to Portuguese."""
954
+ tutorials = _TUTORIALS.get(kind)
955
+ if tutorials is None:
956
+ raise KeyError(f"Unknown tutorial: {kind}")
957
+ return tutorials.get(language, tutorials["pt"])
958
+
959
+
960
+ def tutorial_title(kind: str, language: str) -> str:
961
+ return tutorial_definition(kind, language)["title"]
962
+
963
+
964
+ def tutorial_caption(kind: str, language: str) -> str:
965
+ return tutorial_definition(kind, language)["caption"]
966
+
967
+
968
+ def tutorial_body(kind: str, language: str) -> str:
969
+ return tutorial_definition(kind, language)["body"]
970
+
971
+
972
+ __all__ = [
973
+ "SUPPORTED_TUTORIAL_LANGUAGES",
974
+ "tutorial_body",
975
+ "tutorial_caption",
976
+ "tutorial_definition",
977
+ "tutorial_title",
978
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.3.29",
3
+ "version": "0.3.31",
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",