@danhachuel/thunderbolt 0.6.76 → 0.6.77
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 +7 -6
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -4970,10 +4970,11 @@ def _task_artifact_path(task: dict[str, Any], *names: str) -> Path | None:
|
|
|
4970
4970
|
|
|
4971
4971
|
|
|
4972
4972
|
def _download_title(task: dict[str, Any]) -> str:
|
|
4973
|
-
"""Return
|
|
4974
|
-
raw_title = str(task.get("
|
|
4975
|
-
cleaned = re.sub(r'[<>:"
|
|
4976
|
-
cleaned =
|
|
4973
|
+
"""Return the original video name, safely normalised for downloaded files."""
|
|
4974
|
+
raw_title = str(task.get("topic") or task.get("title") or task.get("name") or "Vídeo").strip()
|
|
4975
|
+
cleaned = re.sub(r'[<>:"/\\|?*\x00-\x1f]+', "_", raw_title)
|
|
4976
|
+
cleaned = re.sub(r"\s+", "_", cleaned)
|
|
4977
|
+
cleaned = re.sub(r"_+", "_", cleaned).strip(" ._")
|
|
4977
4978
|
return cleaned or "Vídeo"
|
|
4978
4979
|
|
|
4979
4980
|
|
|
@@ -5713,7 +5714,7 @@ def _render_youtube_automation_cards():
|
|
|
5713
5714
|
st.download_button(
|
|
5714
5715
|
"Baixar Thumbnail",
|
|
5715
5716
|
data=thumbnail_path.read_bytes() if thumbnail_path else b"",
|
|
5716
|
-
file_name=_automation_download_name("
|
|
5717
|
+
file_name=_automation_download_name("Thumbnail", task, thumbnail_path, ".png"),
|
|
5717
5718
|
mime="image/png",
|
|
5718
5719
|
key=f"automation_download_thumbnail_{task['id']}",
|
|
5719
5720
|
use_container_width=True,
|
|
@@ -5761,7 +5762,7 @@ def _render_youtube_automation_cards():
|
|
|
5761
5762
|
st.download_button(
|
|
5762
5763
|
"Baixar Vídeo",
|
|
5763
5764
|
data=video_path.read_bytes() if video_path else b"",
|
|
5764
|
-
file_name=_automation_download_name("
|
|
5765
|
+
file_name=_automation_download_name("Vídeo", task, video_path, ".mp4"),
|
|
5765
5766
|
mime="video/mp4",
|
|
5766
5767
|
key=f"automation_download_video_{task['id']}",
|
|
5767
5768
|
use_container_width=True,
|
package/package.json
CHANGED