Skip to content

Instantly share code, notes, and snippets.

@d9k
Last active November 27, 2015 01:18
Show Gist options
  • Save d9k/0e20d20ea55a242c8e15 to your computer and use it in GitHub Desktop.
Save d9k/0e20d20ea55a242c8e15 to your computer and use it in GitHub Desktop.
vkopt output mp3 shuffle download
#/bin/bash
find tracks -size 0c -delete
#!/bin/bash
function echoUsage(){
echo "Usage: do-everything-together.sh [tracks-count]"
}
tracksCount=$1
if [[ -z "${tracksCount}" ]]; then
tracksCount=120
echoUsage
echo "tracks count would be ${tracksCount} by default"
fi
bash prepare-and-shuffle.sh ${tracksCount} && bash download-from-shuffled-wget.sh && bash delete-zero-length.sh && bash show-tracks-stats.sh
#!/bin/bash
allWget=all-wget.txt
shuffledWget=shuffled-wget.txt
# TODO
function echoUsage(){
echo "Usage: prepare-and-shuffle.sh [tracks-count]"
}
tracksCount=$1
if [[ ! -f "${allWget}" ]]; then
echo "Use VkOpt for Chrome to obtain wget links and put it to \"${allWget}\". Run script from the same folder while staying in it"
exit
fi
if [[ -z "${tracksCount}" ]]; then
tracksCount=120
echoUsage
echo "tracks count would be ${tracksCount} by default"
fi
sed "s/wget /wget --continue --tries=1 --timeout=10 /g" "${allWget}" > all-prepared-wget.txt
sort -R all-prepared-wget.txt | head -n ${tracksCount} > "${shuffledWget}"
ls -lh "${shuffledWget}"
head "${shuffledWget}"
echo ". . . . . . . . . ."
#!/bin/bash
allWget=all-wget.txt
shuffledWget=shuffled-wget.txt
# TODO
function echoUsage(){
echo "Usage: prepare-and-shuffle.sh [tracks-count]"
}
tracksCount=$1
if [[ ! -f "${allWget}" ]]; then
echo "Use VkOpt for Chrome to obtain wget links and put it to \"${allWget}\". Run script from the same folder while staying in it"
exit
fi
if [[ -z "${tracksCount}" ]]; then
tracksCount=120
echoUsage
echo "tracks count would be ${tracksCount} by default"
fi
sed "s/wget /wget --continue --tries=1 --timeout=10 /g" "${allWget}" > all-prepared-wget.txt
sort -R all-prepared-wget.txt | head -n ${tracksCount} > "${shuffledWget}"
ls -lh "${shuffledWget}"
head "${shuffledWget}"
echo ". . . . . . . . . ."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment