Skip to content

Instantly share code, notes, and snippets.

@rkok
Created July 19, 2019 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkok/4a6291af88806067b545d1a1f233ed2f to your computer and use it in GitHub Desktop.
Save rkok/4a6291af88806067b545d1a1f233ed2f to your computer and use it in GitHub Desktop.
Bare-bones m3u generator
#!/bin/bash
#################################################################
# mkm3u.sh - Bare-bones m3u generator
# Usage:
# ./mkm3u.sh
# Setup:
# 1. Supply INPATHS. Paths which are relative
# to this script will result in relative paths in the m3u
# 2. (Optional) Edit file extensions "mp3|flac|xm|s3m|mod|it"
#################################################################
INPATHS='
path1
path2
'
for INPATH in $INPATHS; do
echo "[$(date)] Finding mp3/flac/etc in $INPATH ..."
find $INPATH | grep -iE '\.(mp3|flac|xm|s3m|mod|it)$' >> "all.m3u.tmp"
done
echo "[$(date)] Saving to all.m3u"
mv "all.m3u.tmp" "all.m3u"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment