(my/table-lookup table value find-row search-row)- What’s this project
- How to run
- Data
- Collecting playlists
- Downloading Audio
- Executing commands
- Custom Playlists
- Goals
It’s a script that downloads my playlists and puts them into nice playlists (m3u files)
To extract source code in emacs use the org-babel-tangle (C-c C-v C-t)
Then run the the-playlist.bash script
| name | id |
|---|---|
| balatro | PLEITERw4PaKFs_uS0MoXkIfGbsYJHmWVU |
| silksong | PLyfXx1BeqwFYFwnXDZo6xYSIsek2x2fhp |
| celeste | PLyfXx1BeqwFbnI87AyqLP5XcEg1u5kydi |
| hollow_knight | PLyfXx1BeqwFZXtJPE153jA-8NJWz579Pb |
| terraria | PLyfXx1BeqwFb9eMbR78HzJtvhAuGH2rnc |
| calamity | PLyfXx1BeqwFY7_xMkP9BCAogmUQbwFBjc |
| calamity_infernum | PLyfXx1BeqwFb0IcIT2_cbShbguqGOvnaq |
| baba | PLyfXx1BeqwFaO6xFIQXFhQTJtFdP4WYyc |
| deltarune | PLyfXx1BeqwFakIcMEOb5L3hLLuTWHZhFv |
| undertale | PLyfXx1BeqwFZoI5JKqSOCYTq9_fxIqPPc |
| isaac_rebirth | PLyfXx1BeqwFYwjv_IHypwL_QeR4IT4rW_ |
| isaac_afterbirth | PLyfXx1BeqwFYEsmSq2YcXYfPoSxhqUdKj |
| isaac_repentance | PLyfXx1BeqwFYukH-L7NXfhom6UPaSb33N |
| isaac_antibirth | PLyfXx1BeqwFZfbk9ksALFm-Q6hmQPacQ1 |
| minecraft | PLyfXx1BeqwFZ3paVLhJwsHpuWM4zlhLPj |
| stardew_valley | PLyfXx1BeqwFYtf2Dntv405dH8I9FP5GcV |
| cassette_beasts | PLyfXx1BeqwFZw1-JcUkkxHcodnwr_W6Nd |
| RoA | PLyfXx1BeqwFYNtQ2sBVUvZ0_PUYvGLe_x |
| rhythm_doctor | PLyfXx1BeqwFYvPfUFBjkZvmpFYFbSJQ2R |
| luck_be_a_landlord | PLyfXx1BeqwFbcG-8eBmiIbmDtNmn4tq2H |
| anime | PLyfXx1BeqwFZcwV_yqpe5khtlKWGf0jM_ |
| misc | PLyfXx1BeqwFZzRwmxQ1To7HQN37pj1EAs |
| operation | command |
|---|---|
| naiive_download_pl | yt-dlp -t aac –restrict-filenames |
| download_pl_m3u | yt-dlp –restrict-filenames -o ‘../pool/%(title)s.m4a’ –get-filename |
Queue up commands that download video titles and attatch the m4a file extension and put in an m3u file in the appropriate place
commands=()
mkdir playlists
for playlist_name in ${!playlists[@]}; do
echo "[THE PLAYLIST] Added $playlist_name to queue"
commands+=("($download_playlists_function ${playlists[$playlist_name]} > playlists/${playlist_name}.m3u && echo \"[THE PLAYLIST] Generated \\\"$playlist_name\\\" playlist\") &")
doneQueue up commands that download audio from playlists “balatro” must be detected such that it’s tracks can be slowed down after downloading to play like it does in game
handle_balatro () {
$download_audio_pl -o 'pool/tmp/%(title)s' $1
cd "pool/tmp"
balatro_list=($(ls))
for track in ${balatro_list[@]}; do
echo "[THE PLAYLIST] Slowing down balatro track: \"$track\""
ffmpeg -y -i "$track" -strict -2 -filter:a "atempo=0.75" -vn "../$track"
done
cd "../.."
rm "pool/tmp" -r
}
for playlist_name in ${!playlists[@]}; do
echo "[THE PLAYLIST] Queued up $playlist_name playlist"
if [ "$playlist_name" = "balatro" ]; then
commands+=("(handle_balatro ${playlists[$playlist_name]} && echo \"[THE PLAYLIST] Finished downloading $playlist_name playlist\") &")
else
commands+=("($download_audio_pl -o 'pool/%(title)s' ${playlists[$playlist_name]} && echo \"[THE PLAYLIST] Finished downloading $playlist_name playlist\") &")
fi
doneUp to this point we’ve built up a queue of commands. The commands get executed in a parallel way and in a way that when you press C-c (Ctrl-C) in the terminal, it exits propperly. This way also insures the terminal doesn’t hang (pretty nifty eh?)
(trap 'kill 0' SIGINT; eval ${commands[*]} wait)Yup that’s it
Generates the everything playlist
rm -f playlists/everything.m3u
cat playlists/* > playlists/everything.m3uGenerates the “isaac” playlist
rm playlists/isaac
cat playlists/isaac* > playlists/isaac.m3u- [X] Fix Balatro Playlist
- [ ] Renaming specific vids according to id
- [ ] Have
commandsbe a queue of getting filenames and downloading audio of individual vids so that I can implement sleeping as a workaround avoiding “Too many requests” error OR get rid of concurrent file downloading and use builtin workarounds in yt-dlp - [ ] Use permanent Toby Fox Undertale and deltarune
- [ ] Fix the anime playlists (e.g. alternate ops, extended endings)
- [ ] Make the actual silksong playlist
- [ ] Drawn to life: The next chapter
- [ ] Human Resource machine (when I finish it)