Skip to content

Commit

Permalink
Added utility script to download and extract yt transcripts
Browse files Browse the repository at this point in the history
  • Loading branch information
b08x committed Jan 2, 2024
1 parent c354427 commit ea1d6cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 4 additions & 5 deletions host_vars/soundbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ desktop:
terminal_alt: "alacritty"
browser: "google-chrome-stable"
audio: "jack"
# barrier:
# server:
# name: soundbot
# address: '[soundbot]:24800'
# config: "{{ user.home }}/.config/Debauchee/soundbot.conf"
barrier:
client:
name: soundbot
server: '[tinybot]:24800'

x:
autostart:
Expand Down
9 changes: 9 additions & 0 deletions roles/base/files/usr/local/bin/yt-dlp-transcript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

function mo_ytdlp_transcript_clean(){
local url=$1
yt-dlp --skip-download --write-subs --write-auto-subs --sub-lang en --sub-format ttml --convert-subs srt --output "transcript.%(ext)s" ${url};
cat ./transcript.en.srt | sed '/^$/d' | grep -v '^[0-9]*$' | grep -v '\-->' | sed 's/<[^>]*>//g' | tr '\n' ' ' > output.txt;
}

mo_ytdlp_transcript_clean $1

0 comments on commit ea1d6cf

Please sign in to comment.