@danhachuel/thunderbolt 0.4.47 → 0.4.48
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 +34 -0
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -1883,6 +1883,40 @@ def render_tiktok_channels():
|
|
|
1883
1883
|
prompt_ids, prompt_labels = _tiktok_prompt_options()
|
|
1884
1884
|
with import_tab:
|
|
1885
1885
|
st.caption("A pesquisa consulta exclusivamente a página pública do TikTok. Não existe método alternativo nem utilização de API.")
|
|
1886
|
+
st.subheader(f"Canais TikTok cadastrados ({len(channels)})")
|
|
1887
|
+
if channels:
|
|
1888
|
+
for channel in channels:
|
|
1889
|
+
channel_id = str(channel.get("id") or "")
|
|
1890
|
+
with st.container(border=True):
|
|
1891
|
+
card_cols = st.columns([0.7, 2.3, 1.0, 1.0, 1.35, 1.25])
|
|
1892
|
+
with card_cols[0]:
|
|
1893
|
+
avatar_url = _tiktok_avatar_url(channel)
|
|
1894
|
+
if avatar_url:
|
|
1895
|
+
st.image(avatar_url, width=58)
|
|
1896
|
+
else:
|
|
1897
|
+
st.markdown("### TT")
|
|
1898
|
+
with card_cols[1]:
|
|
1899
|
+
st.markdown(f"**{channel.get('name') or 'Perfil TikTok'}**")
|
|
1900
|
+
st.caption(f"{channel.get('handle') or 'sem handle'} · {channel.get('url') or 'sem URL'}")
|
|
1901
|
+
st.caption(channel.get("description") or "Perfil carregado da página pública do TikTok.")
|
|
1902
|
+
with card_cols[2]:
|
|
1903
|
+
st.metric("Seguidores", format_metric_number(channel.get("subscriber_count")))
|
|
1904
|
+
with card_cols[3]:
|
|
1905
|
+
st.metric("Curtidas", format_metric_number(channel.get("likes_count")))
|
|
1906
|
+
with card_cols[4]:
|
|
1907
|
+
current_prompt = str(channel.get("default_prompt_master") or channel.get("prompt_master") or "")
|
|
1908
|
+
selected_prompt = st.selectbox("Prompt Master", prompt_ids, index=prompt_ids.index(current_prompt) if current_prompt in prompt_ids else 0, format_func=lambda item: prompt_labels.get(item, item), key=f"tiktok_import_card_prompt_{channel_id}")
|
|
1909
|
+
with card_cols[5]:
|
|
1910
|
+
st.caption("Formato")
|
|
1911
|
+
st.write("Portrait 9:16")
|
|
1912
|
+
if st.button("Guardar", key=f"tiktok_import_card_save_{channel_id}", use_container_width=True, type="primary"):
|
|
1913
|
+
update_channel(channel_id, {"platform": "tiktok", "default_prompt_master": selected_prompt, "prompt_master": selected_prompt, "video_aspect_ratio": "Portrait 9:16", "style_wide": "portrait"})
|
|
1914
|
+
st.success("Prompt Master do canal guardado.")
|
|
1915
|
+
st.rerun()
|
|
1916
|
+
else:
|
|
1917
|
+
st.info("Ainda não existem canais TikTok cadastrados. Use o campo abaixo para pesquisar e cadastrar um perfil público.")
|
|
1918
|
+
st.divider()
|
|
1919
|
+
st.subheader("Importar novo canal pela página pública")
|
|
1886
1920
|
source = st.text_input("URL pública ou @handle", placeholder="https://www.tiktok.com/@conta", key="tiktok_channel_source")
|
|
1887
1921
|
lookup_cols = st.columns([1, 1])
|
|
1888
1922
|
with lookup_cols[0]:
|
package/package.json
CHANGED