Skip to content

Instantly share code, notes, and snippets.

@ericketts
Created June 27, 2020 05:42
Show Gist options
  • Save ericketts/b1c699f537b26c081214eaba21cc057d to your computer and use it in GitHub Desktop.
Save ericketts/b1c699f537b26c081214eaba21cc057d to your computer and use it in GitHub Desktop.
# -n# [xargs arg] for number of arguments to process at a time from the piped
# (file in this case, each line of file is a separate URL, so -n1 means
# treat each line as a separate argument)
# -P# [xargs arg] for number of parallel processes of command to run at a time,
# (in this case just run 2 at a time)
# -L [curl arg] instructs curl to follow redirects
# -O [curl arg] instructs curl to output the file using the name from the input
# arg
xargs -n1 -P2 curl -L -O < manifest.m3u
# or `manifest.m3u | xargs -n1 -P2 curl -L -O`
# loop for converting files from aiff -> alac
for file in *.aiff; do ffmpeg -i "$file" -vn -c:a alac -f ipod "${file%aiff}m4a"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment