-
-
Save nejni-marji/ce52ad7b6ebbf308bd34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
# {{{ Preparing files | |
touch /tmp/bandcamp.m3u | |
rm /tmp/bandcamp.m3u | |
youtube-dl --ignore-errors --get-title --get-url -- $1 > /tmp/bctotal | |
# }}} | |
# {{{ Making playlist | |
export len=`cat /tmp/bctotal | wc -l` | |
for i in `seq $(($len/2))`; do | |
export title=`sed $(($i*2-1))'q;d' /tmp/bctotal` | |
export url=`sed $(($i*2))'q;d' /tmp/bctotal` | |
echo '#EXTM3U' > /tmp/url-plist | |
echo '#EXTINF:,'$title >> /tmp/url-plist | |
echo $url >> /tmp/url-plist | |
cat /tmp/url-plist >> /tmp/bandcamp.m3u | |
done | |
# }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment