Skip to content

Instantly share code, notes, and snippets.

View cepedus's full-sized avatar
🧩
Always Learning

Martin Cepeda cepedus

🧩
Always Learning
View GitHub Profile
Transcript from subtitles
```
yt-dlp --skip-download --write-subs --write-auto-subs --sub-lang en --sub-format ttml --convert-subs srt --exec before_dl:"sed -e '/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9] --> [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]$/d' -e '/^[[:digit:]]\{1,3\}$/d' -e 's/<[^>]*>//g' -e '/^[[:space:]]*$/d' -i '' %(requested_subtitles.:.filepath)#q" 'YOUTUBE_CHANNEL_URL'
```
Only subtitles
```
yt-dlp --skip-download --write-subs --write-auto-subs --sub-lang en --sub-format ttml --convert-subs srt 'YOUTUBE_CHANNEL_URL'
@cepedus
cepedus / _remove_bg.bat
Created August 30, 2021 14:56
Snippet to remove white background of all PNGs in the same directory. Needs ImageMagick in PATH
@ECHO OFF
where magick >nul 2>&1 || (echo magick not found, please install from https://imagemagick.org/index.php and/or add to PATH && goto :end)
echo Removing background using ImageMagick...
forfiles /S /M *.png* /C "cmd /c magick convert @file -fuzz 10% -transparent white @file && echo @file DONE"
:end
PAUSE