Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- proxy_list=proxylst.txt
- user_agent_string_list=useragentlst.txt
- logfile=mpwget.log
- checking_website=http://checker.samair.ru/
- function randomline()
- {
- NB_LINES=$(expr $(wc -l $1 | sed -e 's/ *//' | cut -f1 -d " "))
- NB_RAND=0
- while [ "$NB_RAND" -eq 0 ]
- do
- NB_RAND=$(expr $RANDOM \% $NB_LINES)
- done
- RANDOM_RESULT=$(sed -n "${NB_RAND}p;${NB_RAND}q" $1)
- }
- function random_uagent()
- {
- # picking up a randon user-agent
- randomline useragentlst.txt
- uastring="$RANDOM_RESULT"
- NB_RAND_UA="$NB_RAND"
- NB_LINES_UA="$NB_LINES"
- unset RANDOM_RESULT NB_RAND NB_LINES
- }
- function partial_get()
- {
- while read proxyline
- do
- export http_proxy=$proxyline
- export ftp_proxy=$proxyline
- random_uagent
- wget -v -Q$quota -a $logfile -U "$uastring" $other_param --no-cookies --proxy $getwebsite
- done <$proxy_list
- }
- function checking_vars()
- {
- while read proxyline
- do
- random_uagent
- echo Selected proxy:
- echo $proxyline
- echo
- echo User-Agent $NB_RAND_UA of $NB_LINES_UA Selected:
- echo "$uastring"
- done <$proxy_list
- }
- if [ $# -ne 1 ]
- then
- echo "Syntax: $0 http(s)://YourLink"
- echo "$0 - will wget YourLink behind a proxy from $proxy_list for $quota and then append with the next proxy."
- echo "For each proxy, random User-Agent and random HTTP headers is taken."
- echo "Syntax: $0 check"
- echo "Will wget from the default proxy checker from the var checking_website which is set to: $checking_website"
- echo "Syntax: $0 printonly"
- echo "Will only print every vars on the screen to verify that it does the job."
- exit 1
- elif [ ${1%:*} = 'http' ]
- then
- getwebsite="$1"
- other_param= '-c'
- partial_get
- elif [ $1 = 'check' ]
- then
- getwebsite="$checking_website"
- partial_get
- elif [ $1 = 'printonly' ]
- then
- checking_vars
- else
- echo "Moooooooooo !"
- fi
- unset http_proxy ftp_proxy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement