#!/bin/bash
lol=$(echo "$1" | grep -oE '\-.*$')
one=$(echo $lol | cut -d_ -f1)
two=$(echo $lol | cut -d_ -f2)
mkdir "$2"
cd "$2"
for i in $(wget -qO - "https://api.vk.com/method/photos.get.xml?owner_id=${one}&album_id=${two}" | grep src_big | sed -n 's|<src_big>\(.*\)</src_big>|\1|p'|sed 's/^[ \t]*//'); do
echo "i = $i"
wget "$i"
done
./script.sh "https://vk.com/albumXXX" «save_to_dir»