Hey guys,

Just thought this could be useful for other people out there.
When you download a youtube closed caption (subtitles) it usually comes in WebVTT format and encoded as UTF-8. That is a problem since many old media player boxes cannot play those subtitles. So I found a python script on GitHub that converts VTT to SRT and I made a bash script that takes care of the encoding. I also made it so that lines larger than 50 characters are cut in two, since some videos that I watch were subbed without consideration for line length, which could also be a problem. If someone thinks 50 is a wrong number to use please share with us and adjust the script accordingly to your needs. Simply run ./ytsubs.sh and all VTT files will be converted to SRT ones, with proper encoding and line length. Original files are not deleted.

As I have mentioned before, you are free to use my scripts for whatever you need them, but seeing as the original python script was not mine and is GPL-V3 licensed I will just consider that all is under the same conditions. Is it appropriate?

Hope this helps.


P.S.: I tried attaching the files as a ZIP file which was 5kB but Trisquel Forum refused it. I used TAR file which is 20kB. ZIP should be allowed since it's smaller.

Attachment: ytsubs.tar
Description: Unix tar archive

Reply via email to