@danhachuel/thunderbolt 0.6.89 → 0.6.91
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 +24 -2
- package/hermes_ui/video_length.py +15 -4
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -116,7 +116,7 @@ from hermes_ui.update_manager import check_version, restart_current_process, upd
|
|
|
116
116
|
|
|
117
117
|
from hermes_ui.script_documents import list_script_documents, read_script_document, save_script_document, script_storage_path
|
|
118
118
|
from hermes_ui.script_generation import generate_script_document
|
|
119
|
-
from hermes_ui.video_length import DEFAULT_AVERAGE_VIDEO_TIME, channel_video_length, channel_video_time_value, length_generation_settings, words_from_channel_time
|
|
119
|
+
from hermes_ui.video_length import DEFAULT_AVERAGE_VIDEO_TIME, channel_video_length, channel_video_time_value, default_average_video_time, length_generation_settings, words_from_channel_time
|
|
120
120
|
from hermes_ui.voice_preview import DEFAULT_SAMPLE, load_preview_file, synthesize_preview
|
|
121
121
|
from hermes_ui.elevenlabs_voices import ElevenLabsVoicesError, cached_personal_voices, fetch_personal_voices, personal_voice_options
|
|
122
122
|
from hermes_ui.thumbnail_generation import ThumbnailGenerationError, generate_thumbnail_image
|
|
@@ -266,6 +266,28 @@ SUBTITLE_POSITION_OPTIONS = ["Bottom (Recommended)", "Top", "Center"]
|
|
|
266
266
|
ensure_storage()
|
|
267
267
|
st.set_page_config(page_title="Thunderbolt", page_icon="T", layout="wide", initial_sidebar_state="expanded")
|
|
268
268
|
|
|
269
|
+
if st.get_option("theme.base") == "light":
|
|
270
|
+
st.markdown(
|
|
271
|
+
"""
|
|
272
|
+
<style>
|
|
273
|
+
.stApp {
|
|
274
|
+
background: linear-gradient(315deg, #4f2991 3%, #7dc4ff 38%, #36cfcc 68%, #a92ed3 98%);
|
|
275
|
+
background-size: 400% 400%;
|
|
276
|
+
animation: thunderbolt-prismatic-gradient 15s ease infinite;
|
|
277
|
+
min-height: 100vh;
|
|
278
|
+
margin: 0;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@keyframes thunderbolt-prismatic-gradient {
|
|
282
|
+
0% { background-position: 0% 0%; }
|
|
283
|
+
50% { background-position: 100% 100%; }
|
|
284
|
+
100% { background-position: 0% 0%; }
|
|
285
|
+
}
|
|
286
|
+
</style>
|
|
287
|
+
""",
|
|
288
|
+
unsafe_allow_html=True,
|
|
289
|
+
)
|
|
290
|
+
|
|
269
291
|
st.markdown("""
|
|
270
292
|
<style>
|
|
271
293
|
/*
|
|
@@ -5711,7 +5733,7 @@ def render_tiktok_automation():
|
|
|
5711
5733
|
st.error("O Tempo Medio de Video deve estar no formato MM:SS, por exemplo 12:00.")
|
|
5712
5734
|
else:
|
|
5713
5735
|
avatar_url = _tiktok_avatar_url(channel)
|
|
5714
|
-
update_channel(channel_id, {"automation_on": bool(enabled), "automation_time": schedule_time.strip(), "average_video_time": average_video_time.strip() or
|
|
5736
|
+
update_channel(channel_id, {"automation_on": bool(enabled), "automation_time": schedule_time.strip(), "average_video_time": average_video_time.strip() or default_average_video_time(channel), "average_video_word_count": words_from_channel_time(average_video_time), "default_prompt_master": prompt, "prompt_master": prompt, "platform": "tiktok", "format": automation_format, "video_aspect_ratio": "Portrait 9:16", "style_wide": "portrait", "avatar_url": avatar_url, "thumbnail_url": avatar_url})
|
|
5715
5737
|
st.success("Automação TikTok guardada.")
|
|
5716
5738
|
st.rerun()
|
|
5717
5739
|
_render_tiktok_automation_cards()
|
|
@@ -7,17 +7,25 @@ from typing import Any
|
|
|
7
7
|
|
|
8
8
|
WORDS_PER_MINUTE = 150
|
|
9
9
|
DEFAULT_AVERAGE_VIDEO_TIME = "12:00"
|
|
10
|
+
DEFAULT_TIKTOK_AVERAGE_VIDEO_TIME = "01:20"
|
|
10
11
|
AVERAGE_VIDEO_TIME_KEY = "average_video_time"
|
|
11
12
|
AVERAGE_VIDEO_WORD_COUNT_KEY = "average_video_word_count"
|
|
12
13
|
|
|
13
14
|
|
|
15
|
+
def default_average_video_time(channel: dict[str, Any] | None = None) -> str:
|
|
16
|
+
"""Return the platform-specific default duration for a channel."""
|
|
17
|
+
platform = str((channel or {}).get("platform") or "").strip().casefold()
|
|
18
|
+
return DEFAULT_TIKTOK_AVERAGE_VIDEO_TIME if platform == "tiktok" else DEFAULT_AVERAGE_VIDEO_TIME
|
|
19
|
+
|
|
20
|
+
|
|
14
21
|
def channel_video_time_value(channel: dict[str, Any]) -> str:
|
|
15
22
|
"""Return the card value, migrating only the historical twelve-minute default."""
|
|
23
|
+
default_time = default_average_video_time(channel)
|
|
16
24
|
value = str(channel.get(AVERAGE_VIDEO_TIME_KEY) or "").strip()
|
|
17
25
|
configured_words = str(channel.get(AVERAGE_VIDEO_WORD_COUNT_KEY) or "").strip()
|
|
18
26
|
if value == "00:12" and configured_words in {"", "0", "1800"}:
|
|
19
|
-
return
|
|
20
|
-
return value or
|
|
27
|
+
return default_time
|
|
28
|
+
return value or default_time
|
|
21
29
|
|
|
22
30
|
|
|
23
31
|
def valid_hhmm(value: Any) -> bool:
|
|
@@ -115,8 +123,9 @@ def channel_video_length(channel: dict[str, Any], blueprint: Any = None, prompt_
|
|
|
115
123
|
words = explicit_word_count(blueprint, prompt_master)
|
|
116
124
|
if words:
|
|
117
125
|
return words, hhmm_from_minutes(round(words / WORDS_PER_MINUTE)), "Blueprint/Prompt Master"
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
default_time = default_average_video_time(channel)
|
|
127
|
+
default_minutes = minutes_from_hhmm(default_time)
|
|
128
|
+
return round(default_minutes * WORDS_PER_MINUTE), default_time, "padrão do canal"
|
|
120
129
|
|
|
121
130
|
|
|
122
131
|
def words_from_channel_time(value: Any) -> int:
|
|
@@ -138,6 +147,8 @@ __all__ = [
|
|
|
138
147
|
"AVERAGE_VIDEO_TIME_KEY",
|
|
139
148
|
"AVERAGE_VIDEO_WORD_COUNT_KEY",
|
|
140
149
|
"DEFAULT_AVERAGE_VIDEO_TIME",
|
|
150
|
+
"DEFAULT_TIKTOK_AVERAGE_VIDEO_TIME",
|
|
151
|
+
"default_average_video_time",
|
|
141
152
|
"channel_video_time_value",
|
|
142
153
|
"WORDS_PER_MINUTE",
|
|
143
154
|
"channel_video_length",
|
package/package.json
CHANGED