@danhachuel/thunderbolt 0.6.90 → 0.6.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +17 -3
- 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
|
|
@@ -270,12 +270,26 @@ if st.get_option("theme.base") == "light":
|
|
|
270
270
|
st.markdown(
|
|
271
271
|
"""
|
|
272
272
|
<style>
|
|
273
|
-
|
|
273
|
+
html,
|
|
274
|
+
body,
|
|
275
|
+
.stApp,
|
|
276
|
+
[data-testid="stAppViewContainer"],
|
|
277
|
+
[data-testid="stAppViewContainer"] > .main {
|
|
274
278
|
background: linear-gradient(315deg, #4f2991 3%, #7dc4ff 38%, #36cfcc 68%, #a92ed3 98%);
|
|
275
279
|
background-size: 400% 400%;
|
|
280
|
+
background-attachment: fixed;
|
|
276
281
|
animation: thunderbolt-prismatic-gradient 15s ease infinite;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.stApp,
|
|
285
|
+
[data-testid="stAppViewContainer"],
|
|
286
|
+
[data-testid="stAppViewContainer"] > .main {
|
|
277
287
|
min-height: 100vh;
|
|
278
288
|
margin: 0;
|
|
289
|
+
background-color: transparent !important;
|
|
290
|
+
background-image: linear-gradient(315deg, #4f2991 3%, #7dc4ff 38%, #36cfcc 68%, #a92ed3 98%) !important;
|
|
291
|
+
background-size: 400% 400% !important;
|
|
292
|
+
background-attachment: fixed;
|
|
279
293
|
}
|
|
280
294
|
|
|
281
295
|
@keyframes thunderbolt-prismatic-gradient {
|
|
@@ -5733,7 +5747,7 @@ def render_tiktok_automation():
|
|
|
5733
5747
|
st.error("O Tempo Medio de Video deve estar no formato MM:SS, por exemplo 12:00.")
|
|
5734
5748
|
else:
|
|
5735
5749
|
avatar_url = _tiktok_avatar_url(channel)
|
|
5736
|
-
update_channel(channel_id, {"automation_on": bool(enabled), "automation_time": schedule_time.strip(), "average_video_time": average_video_time.strip() or
|
|
5750
|
+
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})
|
|
5737
5751
|
st.success("Automação TikTok guardada.")
|
|
5738
5752
|
st.rerun()
|
|
5739
5753
|
_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