Rip, extract and convert subtitles to .srt closed captions from .xml/dfxp/ttml and .vtt/WebVTT (e.g. Netflix, YouTube)
.xml
dfxp or .vtt
files), YouTube or other sources..srt
Feel free to create a Pull Request adding screenshots for each step/method that works best for you.
You need Google Chrome. not tested on other web browsers
Cmd
+ Alt
+ i
.F12
.?o=
at the beginning of the name (see image below).The information is extracted from this post.
You need FireFox and AdblockPlus Add-On. not tested on other browsers
youtube-dl --all-subs "https://www.youtube.com/watch?v=VHNfvFOBC0A"
NameOfTheVideo VHNfvFOBC0A.ca.vtt, NameOfTheVideo VHNfvFOBC0A.tlh.vtt
youtube-dl --list-subs "https://www.youtube.com/watch?v=VHNfvFOBC0A"
to_srt.py
python to_srt.py
from the terminal on the folder you have to_srt.py
)
to_srt.py
-i INPUT_PATH
and -o OUTPUT_PATH
for custom file locations.xml
and .vtt
files in the input directory will generate a converted .srt
file on the output oneVLC player could not reproduce that kind of xml subtitles and I could not find any tool that could easily transform the xml files to a suitable format (e.g. SubRip (.srt
)) in Linux or Mac. I got a request for WebVTT (.vtt
) and did the same.
python to_srt.py -i samples -o samples
from the the project's root directory and check the .srt
results (or python3 to_srt.py -i samples -o samples
).In no way I am encouraging any kind of illegal activity. Please know your local laws and ask for written permissions from content owners (e.g. Netflix, YouTube) when necessary.