Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- echo "paste link:"
- read link
- loginTemp="$(cut -d '_' -f1 <<< "$link")"
- docTemp="$(cut -d '_' -f2 <<< "$link")"
- id="$(cut -d 'c' -f3 <<< "$loginTemp")"
- doc=$(($docTemp+1000))
- filecount=0
- outcount=0
- SECONDS=0
- while [ $doc -gt 0 ]
- do
- link="https://vk.com/doc"$id"_"$doc
- img_link=$(curl -s $link | grep img | grep -o src="\"http.*" | grep -o "http.*\"" | sed 's/\?.*//')
- if [ -z $img_link ]
- then
- # if [ $(($outcount % 100)) -eq 0 ]
- if [ $(($outcount % 1000)) -eq 0 ]
- then
- # echo "${link} Found: ${filecount}"
- duration=$SECONDS
- echo "Item ${id} ${doc} Found: ${filecount} \
- Passed $(($duration / 3600)) h $((($duration / 60) % 60)) min $(($duration % 60)) sec"
- fi
- else
- echo "Got File"
- filecount=$[$filecount+1]
- echo $img_link >> links.txt
- wget $img_link
- fi
- doc=$[$doc-1]
- outcount=$[$outcount+1]
- img_link=""
- done
Advertisement
Add Comment
Please, Sign In to add comment