You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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.
3
5
4
6
## Installation
5
7
To use this script, follow these steps:
@@ -11,24 +13,34 @@ To use this script, follow these steps:
11
13
| GNU/Linux or macOS |**`~/.config/mpv/scripts/`**|
12
14
| Windows |**`C:/Users/Username/AppData/Roaming/mpv/scripts/`**|
13
15
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.
15
17
16
18
3. Place the downloaded file in the script directory mentioned in step 1.
17
19
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`
19
21
20
22
5. Restart MPV or reload the scripts by pressing Shift + R while the player is running.
21
23
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
+
22
33
## 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.
24
36
25
37
With this script, you no longer have to manually disable forced subtitles every time you start playing a video.
26
38
27
39
## Contributing
28
40
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.
29
41
30
42
## 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).
32
44
33
45
## Acknowledgments
34
46
Special thanks to the MPV community for their support and the development of this script.
0 commit comments