fix: subtitle structured output format and remove redundant items field - #10
Open
guowenfh wants to merge 1 commit into
Open
fix: subtitle structured output format and remove redundant items field#10guowenfh wants to merge 1 commit into
guowenfh wants to merge 1 commit into
Conversation
- Fix --subtitle-format srt not producing actual SRT text in structured output - Add subtitle_formatted_text param to normalize_video_command_payload - Remove items field from subtitle payload (keep only text for AI/human consumers) - Remove unused normalize_subtitle_items function - Update test to verify timeline format text instead of items
Author
|
Expected to save about 45% tokens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--subtitle-format srtnot producing actual SRT formatted text in structured output (--json/--yaml)itemsfield from subtitle payload — keep onlytextfor AI/human consumersnormalize_subtitle_itemsfunctionChanges
bili_cli/commands/video.py: Compute formatted text based onsubtitle_formatand pass to payloadbili_cli/payloads.py:subtitle_formatted_textparameter tonormalize_video_command_payloaditemsfield from subtitle payloadnormalize_subtitle_itemsfunctiontests/test_cli.py: Update test to verify timeline format text instead of itemsBefore
{ "subtitle": { "available": true, "format": "srt", "text": "plain text...", // ❌ not SRT format "items": [...] // redundant } }After
{ "subtitle": { "available": true, "format": "srt", "text": "1\n00:00:00,121 --> 00:00:05,121\n永不放弃你...\n\n2\n..." // ✅ actual SRT } }