Skip to content

Commit dc6ac75

Browse files
authored
Update README.md
1 parent d52a7a8 commit dc6ac75

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# mpv-sub_not_forced
2-
This is a LUA script for MPV that automatically prevents the selection of FORCED subtitles at the start.
1+
# mpv-sub_not_forced_not_sdh
2+
This is a LUA script for MPV that automatically prevents the selection of FORCED and SDH subtitles at the start.
3+
- Forced subtitles are subtitles that are displayed only for sections of the video that contain non-dialogue elements such as signs, captions, or foreign language translations.
4+
- SDH means Subtitles for the Deaf or Hard of Hearing.
35

46
## Installation
57
To use this script, follow these steps:
@@ -11,24 +13,34 @@ To use this script, follow these steps:
1113
| GNU/Linux or macOS | **`~/.config/mpv/scripts/`** |
1214
| Windows | **`C:/Users/Username/AppData/Roaming/mpv/scripts/`** |
1315

14-
2. Download the `mpv-sub_not_forced.lua` file from this repository.
16+
2. Download the `mpv-sub_not_forced_not_sdh` file from this repository.
1517

1618
3. Place the downloaded file in the script directory mentioned in step 1.
1719

18-
4. Make it executable: `chmod +x ~/.config/mpv/scripts/mpv-sub_not_forced.lua`
20+
4. Make it executable: `chmod +x ~/.config/mpv/scripts/mpv-sub_not_forced_not_sdh`
1921

2022
5. Restart MPV or reload the scripts by pressing Shift + R while the player is running.
2123

24+
6. You can modify the script to play a specific langage.
25+
For example, if you want the script to play English subtitles but exclude the FORCED and SDH ones, you can make the following modification to line #4:
26+
`if sub.type == "sub" and not sub.forced and (sub.title == nil or not sub.title:find("SDH")) then`
27+
Replace it with:
28+
`if sub.type == "sub" and sub.lang:find("en") and not sub.forced and (sub.title == nil or not sub.title:find("SDH")) then`
29+
By adding the additional condition sub.lang:find("en"), you are checking if the subtitle language matches "en" (for English). This modification ensures that only English subtitles that are not FORCED and do not contain "SDH" in their title will be selected.
30+
31+
Please make sure to understand the consequences of this modification and adjust it according to your specific needs.
32+
2233
## Usage
23-
Once the script is installed, it will automatically prevent the selection of forced subtitles when you start playing a video with MPV. Forced subtitles are subtitles that are displayed only for sections of the video that contain non-dialogue elements such as signs, captions, or foreign language translations.
34+
Once the script is installed, it will automatically prevent the selection of FORCED and SDH subtitles when you start playing a video with MPV. Forced subtitles are subtitles that are displayed only for sections of the video that contain non-dialogue elements such as signs, captions, or foreign language translations.
35+
SDH means Subtitles for the Deaf or Hard of Hearing.
2436

2537
With this script, you no longer have to manually disable forced subtitles every time you start playing a video.
2638

2739
## Contributing
2840
If you have any suggestions, bug reports, or would like to contribute to this project, feel free to open an issue or submit a pull request on the GitHub repository.
2941

3042
## License
31-
This script is licensed under the [MIT License](https://github.com/pzim-devdata/mpv-sub_not_forced/blob/main/LICENSE).
43+
This script is licensed under the [MIT License](https://github.com/pzim-devdata/mpv-sub_not_forced_not_sdh/blob/main/LICENSE).
3244

3345
## Acknowledgments
3446
Special thanks to the MPV community for their support and the development of this script.

0 commit comments

Comments
 (0)