Skip to content

Added more options for specific uses cases#121

Open
matherose wants to merge 1 commit into
ratoaq2:mainfrom
matherose:main
Open

Added more options for specific uses cases#121
matherose wants to merge 1 commit into
ratoaq2:mainfrom
matherose:main

Conversation

@matherose

@matherose matherose commented Jul 25, 2025

Copy link
Copy Markdown

Add support for filtering PGS subtitles by type based on MKVToolNix metadata:

  • --full-only [FULL subtitles]
  • --forced-only [FORCED subtitles]
  • --forced-included [FULL + FORCED]
  • --sdh-only [SDH subtitles]
  • --sdh-included [FULL + SDH]
  • --all-included (default) [FULL, FORCED & SDH]

Add support for filtering PGS subtitles by type based on MKVToolNix metadata:

- --full-only: Extract only FULL subtitles (regular, non-forced, non-SDH)
- --forced-only: Extract only FORCED subtitles (for foreign language text/signs)
- --forced-included: Extract FULL and FORCED subtitles together
- --sdh-only: Extract only SDH subtitles (for Deaf and Hard of hearing)
- --sdh-included: Extract FULL and SDH subtitles together
- --all-included: Extract FULL, FORCED and SDH subtitles together

Features:
- Auto-detection of subtitle types via MKV metadata
- FORCED: Detected via forced_track property
- SDH: Auto-detected from track names (SDH, CC, Hearing Impaired, etc.)
- FULL: Regular subtitles that are neither forced nor SDH
- Enhanced file naming with type suffix (e.g., movie.en.forced.srt)
- Support for multiple subtitle types per language when using mixed filters
- Updated API with SubtitleTypeFilter enum
- Comprehensive documentation and examples

Resolves issue where --forced-included and --sdh-included options were
mutually exclusive, now users can extract all subtitle types with --all-included.
@ratoaq2

ratoaq2 commented Jul 26, 2025

Copy link
Copy Markdown
Owner

Thanks for the contribution. I'm not giving much attention to my existing opensource python projects lately.

This is not a "small change", but a bigger set of changes/features. So, let me give you some feedback:

  • All the track related parsing should not be pgsrip responsibility. That's delegated to https://github.com/ratoaq2/trakit where it can already detect properly the language, hearing_impaired, closed_caption, forced, etc. Probably MkvTrack should be refactored to call trakit only once and provide the properties "hearing_impaired", "closed_caption", "force" as well... not just the language.
  • Instead of all these 6 "combinations" as options: "full-only", "forced-only", etc; probably we should have a way to include or exclude individual options.

If you're willing to accept this feedback, we can incorporate these features to pgsrip.

@ratoaq2

ratoaq2 commented Jul 27, 2025

Copy link
Copy Markdown
Owner

I have already refactored MkvTrack to include these flags and I'll refactor MediaPath to also have those flags since they are needed for other requested features.

Then I'll include the options to include/exclude them when ripping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants