Created
October 9, 2022 16:53
-
-
Save SydLambert/ba3f41f6f9e800a8e88f2ba664243ce5 to your computer and use it in GitHub Desktop.
Download the playlist files for all SomaFM stations into the current directory
This file contains hidden or 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
#!/usr/bin/env sh | |
curl -s https://somafm.com/channels.xml | grep -Po '((?<=<title><!\[CDATA\[).+?(?=\])|(?<=id=").+?(?="))' | sed 'N;s/\n/ /' | while read -r p; do | |
stationName=$(echo "$(echo "$p" | grep -Po '(?<= ).+$')" | perl -ple '$_=lc; s/[^\w\s]//g; s/ /-/g') | |
echo "Downloading $stationName" | |
curl -s "https://somafm.com/$(echo "$p" | grep -Po '^.+?(?= )')130.pls" > "$stationName.pls" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment