Created
May 11, 2021 06:40
-
-
Save sirenko/b4d6b7179441f5e1994b9df3aac531f5 to your computer and use it in GitHub Desktop.
Download
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
youtube-dl --sub-lang en --write-auto-sub --sub-format srt --skip-download 'https://www.youtube.com/watch?v=AAABBBCCCDDD' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
## Clean up YT subtitles | |
# Usage: | |
# yt-subs2txt.sh subtitles.en.vtt | |
[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-" | |
cat $input |\ | |
grep -Ev '^0[0-9]*:' |\ | |
sed -e 's/<[^>]*>//g' |\ | |
grep "\S" |\ | |
uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment