porter-workflow 0.2.4__tar.gz → 0.2.6__tar.gz
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.
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/CHANGELOG.md +33 -1
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/PKG-INFO +1 -1
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/__init__.py +1 -1
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/base.py +4 -1
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/subtitles/ass.py +7 -4
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/subtitles/phrasing.py +25 -2
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/chain.py +16 -4
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/.gitignore +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/LICENSE +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/README.md +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/THIRD_PARTY_NOTICES.md +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/pyproject.toml +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/README.md +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/SKILL.md +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/assets/config.example.json +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/references/ARCHITECTURE.md +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/references/CONFIG.md +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/references/MCP.md +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/scripts/bootstrap.sh +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/scripts/inspect.sh +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/scripts/porter.sh +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/base.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/bcut.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/chain.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/google_web.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/platform_subs.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/videocaptioner.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/whisper_api.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/asr/whisper_local.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/config.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/context.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/doctor/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/doctor/guides.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/doctor/probes.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/errors.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/events.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/jobs/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/jobs/records.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/jobs/store.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/logging.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/burn.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/encode.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/enhance.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/ffmpeg.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/prepare.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/probe.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/media/standardize.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/mirrors.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/models/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/models/inspection.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/models/materials.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/models/metadata.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/models/plan.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/models/request.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/models/subtitle.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/pipeline.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/plan.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/bilibili.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/downloader.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/inspector.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/instagram.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/local.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/registry.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/spec.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/tiktok.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/titles.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/urls.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/x.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/ydl.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/platforms/youtube.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/ports.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/py.typed +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/subtitles/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/subtitles/srt.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/subtitles/transcript.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/base.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/bing.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/google.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/llm.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/mymemory.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/reuse.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/translate/videocaptioner.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/utils/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/utils/text.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter/utils/time.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/__main__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/app.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/commands/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/commands/config.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/commands/doctor.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/commands/inspect.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/commands/jobs.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/commands/plan.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/commands/run.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_cli/render.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/limits.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/server.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/shutdown.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/stdout_guard.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/__init__.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/config.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/docs.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/doctor.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/inspect.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/jobs.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/meta.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/plan.py +0 -0
- {porter_workflow-0.2.4 → porter_workflow-0.2.6}/src/porter_mcp/tools/stages.py +0 -0
|
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.6] - 2026-09-25
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Fixed oversized subtitle font rendering during hard-sub burning.**
|
|
15
|
+
In previous versions, `compute_adaptive_subtitle_style` was omitted when
|
|
16
|
+
generating ASS subtitles in the `TRANSLATE` phase, causing baseline 1080p
|
|
17
|
+
font and margin values to be written into low-resolution or mismatched
|
|
18
|
+
virtual canvases. Additionally, when resuming an existing master video,
|
|
19
|
+
initial unverified metadata (e.g. 640x360 from YouTube) was not updated
|
|
20
|
+
from the physical video file. Together, these caused libass to upscale
|
|
21
|
+
subtitles by up to 300% on 1080p release videos.
|
|
22
|
+
- **Fixed hardcoded font size in adaptive single-track Chinese ASS style.**
|
|
23
|
+
Single-track Chinese subtitles now dynamically inherit user-configured
|
|
24
|
+
`zh_font_size` scaling instead of clamping to a static 58px.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **Bilingual cues no longer pair a Chinese line with the English of a different
|
|
29
|
+
clause.** Cutting a translated sentence back into cues splits the Chinese by
|
|
30
|
+
phrasing and then cuts the English to match, but the English breakpoint search
|
|
31
|
+
ranged over the whole remaining sentence. A terminal-punctuation bonus of +15
|
|
32
|
+
is worth about 7.5 words of the distance penalty (-2/word), so a break a whole
|
|
33
|
+
clause from its target beat the correct one. On a real 59-sentence transcript,
|
|
34
|
+
9 of the 45 split sentences put more than 20% of one language against 20% of
|
|
35
|
+
the other -- a viewer reading "…on the cash map" beside "…you're completely
|
|
36
|
+
safe." The search is now bounded to a window around the Chinese-driven target
|
|
37
|
+
(15% of the sentence's words), so punctuation chooses among *nearby* breaks
|
|
38
|
+
instead of dragging the cut away. Measured on that transcript: 9 of 45 -> 1.
|
|
39
|
+
|
|
10
40
|
## [0.2.4] - 2026-09-24
|
|
11
41
|
|
|
12
42
|
### Fixed
|
|
@@ -342,7 +372,9 @@ Skill of the same name).
|
|
|
342
372
|
assets and a standardised `raw/` + `cooked/` output layout.
|
|
343
373
|
- Agent Skill packaging (`SKILL.md`, scripts, references, example config).
|
|
344
374
|
|
|
345
|
-
[Unreleased]: https://github.com/RolinShmily/porter-workflow/compare/v0.2.
|
|
375
|
+
[Unreleased]: https://github.com/RolinShmily/porter-workflow/compare/v0.2.6...HEAD
|
|
376
|
+
[0.2.6]: https://github.com/RolinShmily/porter-workflow/compare/v0.2.5...v0.2.6
|
|
377
|
+
[0.2.5]: https://github.com/RolinShmily/porter-workflow/compare/v0.2.4...v0.2.5
|
|
346
378
|
[0.2.4]: https://github.com/RolinShmily/porter-workflow/compare/v0.2.3...v0.2.4
|
|
347
379
|
[0.2.3]: https://github.com/RolinShmily/porter-workflow/compare/v0.2.2...v0.2.3
|
|
348
380
|
[0.2.2]: https://github.com/RolinShmily/porter-workflow/compare/v0.2.1...v0.2.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: porter-workflow
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Automated video localization, multi-engine ASR, subtitle translation, and dual-version FFmpeg hardsub pipeline for AI agents, CLI, and MCP hosts.
|
|
5
5
|
Project-URL: Homepage, https://github.com/RolinShmily/porter-workflow
|
|
6
6
|
Project-URL: Repository, https://github.com/RolinShmily/porter-workflow
|
|
@@ -42,7 +42,7 @@ from porter.errors import (
|
|
|
42
42
|
from porter.logging import configure as configure_logging
|
|
43
43
|
from porter.logging import get_logger
|
|
44
44
|
|
|
45
|
-
__version__ = "0.2.
|
|
45
|
+
__version__ = "0.2.6"
|
|
46
46
|
|
|
47
47
|
#: Public API, resolved lazily. Maps attribute name -> defining module.
|
|
48
48
|
_LAZY_EXPORTS: dict[str, str] = {
|
|
@@ -66,7 +66,7 @@ from porter.media.prepare import (
|
|
|
66
66
|
master_is_complete,
|
|
67
67
|
standardize_master,
|
|
68
68
|
)
|
|
69
|
-
from porter.media.probe import find_downloaded_video
|
|
69
|
+
from porter.media.probe import find_downloaded_video, probe
|
|
70
70
|
from porter.models.materials import RawMaterials, TaskLayout
|
|
71
71
|
from porter.models.metadata import VideoMetadata
|
|
72
72
|
from porter.models.request import JobOptions
|
|
@@ -226,6 +226,9 @@ class YtDlpExtractor:
|
|
|
226
226
|
if not ctx.options.force and master_is_complete(runner, video_path, audio_path):
|
|
227
227
|
_logger.info("reusing the existing master in %s", layout.raw_dir)
|
|
228
228
|
ctx.progress(Phase.PREPARE, 95.0, "reusing existing raw materials")
|
|
229
|
+
existing_info = probe(runner, video_path)
|
|
230
|
+
if existing_info is not None:
|
|
231
|
+
metadata = apply_measured_dimensions(metadata, existing_info)
|
|
229
232
|
else:
|
|
230
233
|
# --- 4. subtitles (best effort) -----------------------------
|
|
231
234
|
self._download_subtitles(url, base_policy, layout, plan, ctx)
|
|
@@ -103,14 +103,16 @@ def compute_adaptive_subtitle_style(
|
|
|
103
103
|
if is_vertical:
|
|
104
104
|
# Vertical video (e.g. 1080x1920 Shorts / Reels / TikTok)
|
|
105
105
|
scale_v = h / 1920.0
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
zh_ratio = base_style.zh_font_size / 52.0
|
|
107
|
+
en_ratio = base_style.en_font_size / 34.0
|
|
108
|
+
bilingual_style.zh_font_size = max(24, round(56 * zh_ratio * scale_v))
|
|
109
|
+
bilingual_style.en_font_size = max(16, round(38 * en_ratio * scale_v))
|
|
108
110
|
bilingual_style.bilingual_zh_margin_v = max(40, round(220 * scale_v))
|
|
109
111
|
bilingual_style.bilingual_en_margin_v = max(25, round(140 * scale_v))
|
|
110
112
|
bilingual_style.outline_width = max(1.5, round(4.0 * scale_v, 1))
|
|
111
113
|
bilingual_style.shadow = max(1.0, round(2.0 * scale_v, 1))
|
|
112
114
|
|
|
113
|
-
zh_style.zh_font_size = max(28, round(64 * scale_v))
|
|
115
|
+
zh_style.zh_font_size = max(28, round(64 * zh_ratio * scale_v))
|
|
114
116
|
zh_style.margin_v = max(35, round(180 * scale_v))
|
|
115
117
|
zh_style.outline_width = max(1.5, round(4.2 * scale_v, 1))
|
|
116
118
|
zh_style.shadow = max(1.0, round(2.0 * scale_v, 1))
|
|
@@ -143,7 +145,8 @@ def compute_adaptive_subtitle_style(
|
|
|
143
145
|
bilingual_style.shadow = max(1.0, round(base_style.shadow * scale_h * aspect_boost, 1))
|
|
144
146
|
|
|
145
147
|
# Pure Chinese track calculations (larger font size for clean single track)
|
|
146
|
-
|
|
148
|
+
zh_ratio = base_style.zh_font_size / 52.0
|
|
149
|
+
zh_single_size = max(20, round(58 * zh_ratio * scale_h * aspect_boost))
|
|
147
150
|
zh_single_margin = max(15, round(base_style.margin_v * scale_h * aspect_boost))
|
|
148
151
|
|
|
149
152
|
zh_style.zh_font_size = zh_single_size
|
|
@@ -239,6 +239,15 @@ HANGING_CONJUNCTIONS = {
|
|
|
239
239
|
"when", "where", "as",
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
#: How far, as a fraction of a sentence's words, an English cut may be moved from
|
|
243
|
+
#: the position the Chinese implies. Punctuation makes a break read better, so the
|
|
244
|
+
#: scoring rewards it -- but ``split_english_text_to_n_parts`` used to search every
|
|
245
|
+
#: remaining position, and a terminal-punctuation bonus (+15) is worth about 7.5
|
|
246
|
+
#: words of the distance penalty (-2/word). A break a whole clause away therefore
|
|
247
|
+
#: beat the correct one, pairing a Chinese line with the English of a different
|
|
248
|
+
#: clause. Bounded at 15% so punctuation chooses among *nearby* breaks only.
|
|
249
|
+
_BREAK_WINDOW_RATIO = 0.15
|
|
250
|
+
|
|
242
251
|
#: Chinese connectives used as secondary split points when a phrase is too long
|
|
243
252
|
#: for one line. Order matters: the first match in the string wins.
|
|
244
253
|
CHINESE_CONJUNCTIONS = [
|
|
@@ -555,13 +564,27 @@ def split_english_text_to_n_parts(
|
|
|
555
564
|
chosen_cuts: list[int] = []
|
|
556
565
|
min_cut = 0
|
|
557
566
|
|
|
567
|
+
# How far a cut may move from where the Chinese put it. Without this the
|
|
568
|
+
# search below ranges over the whole remaining sentence, and because a
|
|
569
|
+
# terminal punctuation bonus is worth ~7.5 words of distance penalty, a cut
|
|
570
|
+
# nine words away from its target wins whenever it lands after a full stop --
|
|
571
|
+
# which is a whole clause, and shows the viewer a Chinese line and an English
|
|
572
|
+
# line that are not each other's translation. Measured on a real 59-sentence
|
|
573
|
+
# transcript: 9 of the 45 split sentences drifted past a 20% share mismatch.
|
|
574
|
+
window = max(2, round(total_words * _BREAK_WINDOW_RATIO))
|
|
575
|
+
|
|
558
576
|
for i, target_pos in enumerate(target_cuts):
|
|
559
577
|
remaining_parts = (n_parts - 1) - i
|
|
560
578
|
max_cut = total_words - 1 - remaining_parts
|
|
561
579
|
|
|
562
|
-
|
|
580
|
+
low = max(min_cut, round(target_pos) - window)
|
|
581
|
+
high = min(max_cut, round(target_pos) + window)
|
|
582
|
+
if low > high: # window missed the legal span entirely
|
|
583
|
+
low, high = min_cut, max_cut
|
|
584
|
+
|
|
585
|
+
best_k = low
|
|
563
586
|
best_score = float("-inf")
|
|
564
|
-
for k in range(
|
|
587
|
+
for k in range(low, high + 1):
|
|
565
588
|
candidate = score_breakpoint(k, target_pos)
|
|
566
589
|
if candidate > best_score:
|
|
567
590
|
best_score = candidate
|
|
@@ -62,7 +62,11 @@ from porter.errors import JobCancelled, PorterError
|
|
|
62
62
|
from porter.events import ArtifactKind, ArtifactReady, Phase
|
|
63
63
|
from porter.logging import get_logger
|
|
64
64
|
from porter.models.subtitle import SubtitleItem, SubtitleSet, TranscriptSentence
|
|
65
|
-
from porter.subtitles.ass import
|
|
65
|
+
from porter.subtitles.ass import (
|
|
66
|
+
compute_adaptive_subtitle_style,
|
|
67
|
+
generate_bilingual_ass,
|
|
68
|
+
generate_zh_ass,
|
|
69
|
+
)
|
|
66
70
|
from porter.subtitles.phrasing import (
|
|
67
71
|
has_chinese_translation,
|
|
68
72
|
merge_short_fragments,
|
|
@@ -313,7 +317,9 @@ class TranslationChain:
|
|
|
313
317
|
save_transcript_json(sentences, subtitles.transcript_json_path)
|
|
314
318
|
save_transcript_txt(sentences, subtitles.transcript_txt_path)
|
|
315
319
|
|
|
316
|
-
|
|
320
|
+
bilingual_style, zh_style, res_x, res_y = compute_adaptive_subtitle_style(
|
|
321
|
+
width, height, ctx.config.style
|
|
322
|
+
)
|
|
317
323
|
subtitles.subtitle_bilingual_srt.write_text(
|
|
318
324
|
generate_bilingual_srt(subtitles.items), encoding="utf-8"
|
|
319
325
|
)
|
|
@@ -322,13 +328,19 @@ class TranslationChain:
|
|
|
322
328
|
)
|
|
323
329
|
subtitles.subtitle_bilingual_ass.write_text(
|
|
324
330
|
generate_bilingual_ass(
|
|
325
|
-
items=subtitles.items,
|
|
331
|
+
items=subtitles.items,
|
|
332
|
+
style=bilingual_style,
|
|
333
|
+
play_res_x=res_x,
|
|
334
|
+
play_res_y=res_y,
|
|
326
335
|
),
|
|
327
336
|
encoding="utf-8",
|
|
328
337
|
)
|
|
329
338
|
subtitles.subtitle_zh_ass.write_text(
|
|
330
339
|
generate_zh_ass(
|
|
331
|
-
items=subtitles.items,
|
|
340
|
+
items=subtitles.items,
|
|
341
|
+
style=zh_style,
|
|
342
|
+
play_res_x=res_x,
|
|
343
|
+
play_res_y=res_y,
|
|
332
344
|
),
|
|
333
345
|
encoding="utf-8",
|
|
334
346
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/assets/config.example.json
RENAMED
|
File without changes
|
{porter_workflow-0.2.4 → porter_workflow-0.2.6}/skills/porter-skill/references/ARCHITECTURE.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|