Last active
September 1, 2015 09:18
-
-
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.
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
#!/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