Wget un fichier sur dl.free.fr

htaccess

Voici un petit script bash qui va vous permettre de télécharger un fichier sur dl.free.fr en ligne de commande…

#############################################
## download files with wget on dl.free.fr ##
#############################################
## created by Val1472, tutos by czeus2 ##
#############################################

USER_AGENT="Mozilla/5.0 (Linux; U; Linux x86; fr-FR; rv:1.7.5) Gecko/20041202 Firefox/1.0"

#First step is set cookie
wget --save-cookies cookie.txt --keep-session-cookies --user-agent="$USER_AGENT" $1 -O tmpFile

#Second step is to download the img file
PL_LINE=`grep "img src=\"/im.pl" tmpFile`
PL_FILE=`echo $PL_LINE | cut -d\" -f3`
wget --load-cookies cookie.txt http://dl.free.fr/$PL_FILE -O tmpFile

#Third step download with cookie
FILE=`echo $1 | sed s#http://dl.free.fr##g`
wget -c --load-cookies cookie.txt --referer="http://dl.free.fr/getfile.pl?file=$FILE" --user-agent="$USER_AGENT" $1

#Then clean tmp file
rm tmpFile cookie.txt

##Thanks to Val1472##
You can leave a response, or trackback from your own site.

Leave a Reply