Skip to content

Instantly share code, notes, and snippets.

@pik4ez
Last active September 1, 2015 09:18
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 pik4ez/bd628d53f2818574b683 to your computer and use it in GitHub Desktop.
Save pik4ez/bd628d53f2818574b683 to your computer and use it in GitHub Desktop.
Starter for vkalbu+dgrab. Processes albums list from file, grabs album contents using dgrab, uploads audio album to vk.com using vkalbu.
#!/bin/sh
albums_file=/path/to/albums_file
todo_file=/path/to/tmp/vkalbu_todo.json
# -u 10 and 10< in done section is used
# to prevent reading from stding inside
# vkalbu python script (captcha request)
# @see http://stackoverflow.com/questions/1521462/looping-through-the-content-of-a-file-in-bash
while read -u 10 album; do
echo "processing album $album"
echo "dgrabbing..."
/path/to/dgrab.py "$album" > "$todo_file"
if [ $? -ne 0 ]; then
echo "failed to dgrab $album"
exit 1
fi
echo "vkalbuming..."
/path/to/vkalbu.py "$todo_file"
if [ $? -ne 0 ]; then
echo "failed to vkalbu $todo_file"
exit 1
fi
done 10< "$albums_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment