ytcli

Des commandes pour utiliser youtube - retour accueil

git clone git://bebou.netlib.re/ytcli
Log | Files | Refs | README |

ytgetsubs (333B)


      1 #! /bin/sh
      2 
      3 subfile=$(mktemp)
      4 lang=$(yt-dlp --skip-download --list-subs "$1" |
      5 		sed -nE '/^Language/,$ p' |
      6 		fzy |
      7 		cut -d' ' -f1)
      8 yt-dlp --write-subs --skip-download  --sub-langs ${lang:-en} -o "$subfile" "$1"
      9 < $subfile.${lang:-en}.vtt grep -v '\-\->' |
     10 	sed 's/&nbsp;//g' |
     11 	tail -n+5 |
     12 	sed -zE 's/([^.!?])\n\n/\1\n/g' |
     13 	fmt