Open yan12125 opened 7 years ago
I was able to use xmlstarlet and ttml2srt.py (by nomoketo) to only extract my own language on multi-language ttml subtitles file:
xmlstarlet ed -N ns=http://www.w3.org/2006/04/ttaf1 -d "//ns:div[not(contains(@xml:lang,'Italian'))]" "/path/of/the/original/subtitle.mul.ttml" > "/path/to/save/subtitle.ttml" && python3 ttml2srt.py "/path/to/just/converted/subtitle.ttml" > "/path/to/save/subtitle.srt"
since ttml is an xml file by using the correct namespace you can use xmlstarlet to only extract one language not contains xml:lang 'Language' from daisuki ttml multilanguage files... and ttml2srt.py is only a basic converter (maybe you use a better one) to convert ttml to srt.
[x] I've verified and I assure that I'm running youtube-dl 2017.02.27
[x] At least skimmed through README and most notably FAQ and BUGS sections
[x] Searched the bugtracker for similar issues including closed ones
What is the purpose of your issue?
test:daisuki
Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
Description of your issue, suggested solution and other information
test:daisuki has a TTML subtitle http://bngnwww.b-ch.com/caption/35470338/1206/275503087581916/0817102633.xml. It contains multiple languages:
Seems SRT does not support multiple languages in the same file? If so
dfxp2srt
should return a lang => subtitle dictionary andFFmpegSubtitlesConvertorPP
need to handle multiple files.Ref: #4738