mam konto kupene
distribucia ubuntu
Nahrada adekvatna k flashgetu asi nie je, alebo som neschopny to rozbehnut /co je tiez jedna z realnych moznostiRomanko napísal:mas pravdu hladam nejaku nahradu usdownloader alebo flasgetu
Kód: Vybrať všetko
http://blackhole.sk/jednoduchy-python-skript-pre-automaticke-stahovanie-suborov-z-rapidshare-com-v0-2
Len funguje pre uzivatelov bez uctu, s uctom to nema zmysel.Wishmaster napísal:Na blackhole.sk jeden typek urobil python script na download z rs.
tu je linkKód: Vybrať všetko
http://blackhole.sk/jednoduchy-python-skript-pre-automaticke-stahovanie-suborov-z-rapidshare-com-v0-2
Takuto kombinaciu som skusal, s viacerymi downloadermi. Zial neuspesne, hlavne co sa tyka front. Mozno nedokonalostou programu, mozno mnou. Kazdopadne, som si isty, ze to ide pod linuxom. Stale castejsie zistujem, ze je to "pandorina skrinka" /lepsie prirovnanie som nenasiel, chap bezodnachrono napísal:FlashGot + program na sťahovanie nie je alternatíva?
Kód: Vybrať všetko
#!/bin/sh
#
# rsget: download files from rapidshare.com
#
# by Thanos Tsouanas <[email protected]>
#
# Website: http://www.mathimatiko.net/software/rsget/
#
# Feel free to use / modify this script as you like.
# For details, see the BSD license.
#set -x
cmdlurls="1"
dir=`pwd`
# file exists ?
function setfileurls {
commandlineurls=""
fileexist=`ls ${setlnkfile}`
if [ "${fileexist}" == "${setlnkfile}" ]
then
while read link
do
commandlineurls="${commandlineurls} ${link}"
done < "${setlnkfile}"
fi
cmdlurls="0"
}
VERSION=2.5
WWW="http://www.mathimatiko.net/software/rsget/"
umask 033
#
# defaults
#
rsoutput=/tmp/rsoutput.html.$$
premiumurl=https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi
# these options can be set from the command line
maxrandomsleep=0
rsloginfile=$HOME/.rslogin
rscookiejar=rscookies.txt
minspeed=20000
agent='"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"'
outputdir=$PWD
declare -a curlopts
BOLD=$'\e[1;37m'
UNDERLINE=$'\e[4;37m'
NORMAL=$'\e[0;39m'
#
# functions
#
randomsleep() {
if [[ $maxrandomsleep -gt 0 ]]; then
random -e $maxrandomsleep
sleep $?
fi
}
rsprint() {
echo "$BOLD[rsget]$NORMAL :: $1"
}
rserror() {
echo "$BOLD[rsget-error]$NORMAL :: $1"
}
rsversion() {
echo "
rsget $VERSION
author: Thanos Tsouanas <[email protected]>
"
}
rshelp() {
echo "Usage: rsget [OPTIONS] [link_1 link_2 ... link_n]"
echo "
-i inputfile read urls from inputfile (the script is smart enough
to skip lines that are not rapidshare.com links)
-o outputdir write the files to outputdir (default: current dir)
-c cookiejar use cookiejar as a cookiejar; create it if it does not exist
(default: $rscookiejar)
-a agent-string identify as agent to the webserver (enclose it in quotes)
-k keep the cookiejar (pre-existing cookiejars are always kept)
-l rsloginfile use rsloginfile for login credentials (default: $rsloginfile)
-L logfile use logfile for writting succesfully retrieved links
-s silent
-v (de)buggingly verbose
-w do not resume; overwrite.
-r maxrandomsleep maximum number of seconds to randomly sleep between downloads
(default: $maxrandomsleep)
-R reverse the order of the download queue
-M maxspeed e.g. -M 150k (default: unset -- no limit imposed)
-m minspeed minimum avg speed in a 4 min period, in b/s (default: $minspeed)
-b display your balance status
-V display version
-h display this message
For more information, check rsget\'s website at:
$WWW
"
}
rslog() {
if [[ ! -z $logfile ]]; then
echo $1 >> $logfile
fi
}
# when you need credentials
setuser() {
if [[ -r $rsloginfile ]]; then
user=$(head -n 1 $rsloginfile)
passwd=$(tail -n 1 $rsloginfile)
if [[ -z $user || -z $passwd ]]; then
rserror "Your $UNDERLINE$rsloginfile$NORMAL is fucked up."
exit 1
fi
else
rsprint "No $rsloginfile found."
rsprint "This is probably the first time you are running rsget."
rsprint "Hit return to continue..."
read nothing
rsprint "You must create $UNDERLINE$rsloginfile$NORMAL with the ONLY the following two lines:"
rsprint "your_username"
rsprint "your_password"
echo
rsprint "After you have created it, try running rsget again."
rsprint "I will try to create it for you now."
rsprint "Hit ^C if you want to cancel and create the file yourself,"
rsprint "or return to proceed."
rsprint "(It is safer to create it yourself, using your favorite editor. $EDITOR)"
read nothing
echo -n 'Please enter your username in rs.com: '
read newuser
echo -n 'Please enter your password in rs.com: '
read newpasswd
echo $newuser > $rsloginfile
echo $newpasswd >> $rsloginfile
exit 1
fi
}
# what to do after fetching file $1
rsafterfetch() {
rslog "$1"
}
# how to fetch
rsfetch() {
curl \
--show-error \
--output $outputdir/$(basename $1) \
--location \
--cookie $rscookiejar \
--referer ";auto" \
-C - \
"${curlopts[@]}" \
"$1" && rsafterfetch "$1"
}
getrsbalance() {
curl \
--show-error \
--location \
--cookie $rscookiejar \
--referer ";auto" \
--insecure \
--output $rsoutput \
--user-agent "$agent" \
--silent \
"$premiumurl"
rsexpenses=$(sed -n 's#.*In the last 5 days you have downloaded <b>\(.*\) MB</b>.*#\1#p' $rsoutput)
if [ -n "$rsexpenses" ]
then
(( rsbalance = 25000 - $rsexpenses ))
rsprint "In the last 5 days you have downloaded $UNDERLINE$rsexpenses$NORMAL MB."
rsprint "You have $UNDERLINE$rsbalance$NORMAL MB left."
rm -f $rsoutput
fi
}
setuprscookiejar() {
if [[ ! -r $rscookiejar ]]; then
echo
rsprint "Creating cookie jar $UNDERLINE$rscookiejar.$$$NORMAL..."
curl \
--user-agent "$agent" \
--insecure \
--data "login=$user&password=$passwd" \
--cookie-jar "$rscookiejar.$$" \
--output /dev/null \
--silent \
--show-error \
"$premiumurl"
rsprint "$UNDERLINE$rscookiejar.$$$NORMAL is set."
echo
rscookiejar="$rscookiejar.$$"
else
keeprscookiejar=1
fi
}
# set the queue
setrsqueue() {
if [[ ! -z ${commandlineurls[@]} ]]; then
for link in ${commandlineurls[@]}; do
rsqueue=(${rsqueue[@]} $link)
done
fi
if [[ ! -z $inputfile ]]; then
for link in $(grep '^,*http.*rapidshare\.com' $inputfile); do
rsqueue=(${rsqueue[@]} $link)
done
fi
if [[ ! -z $reversemode ]]; then
rsqueue=(${(Oa)rsqueue})
fi
}
#
# parse options
#
# no args
if [[ -z $* ]]; then
rserror "RTFM:"
rshelp
exit 1
fi
while getopts bhRwvVsi:o:a:c:r:k:l:L:m:M:f:F opt; do
case $opt in
(V)
rsversion
exit 0
;;
(h)
rshelp
exit 0
;;
(b)
balancemode=1
;;
(R)
reversemode=1
;;
(a)
agent=$OPTARG
;;
(r)
maxrandomsleep=$OPTARG
(( maxrandomsleep = $maxrandomsleep + 1 ))
;;
(s)
curlopts=("${curlopts[*]}" --silent)
;;
(v)
curlopts=("${curlopts[*]}" --verbose)
;;
(w)
curlopts=("${curlopts[*]}" -C -)
;;
(k)
keeprscookiejar=1
;;
(M)
curlopts=("${curlopts[@]}" --limit-rate $OPTARG)
;;
(m)
minspeed=$OPTARG
;;
(i)
inputfile=$OPTARG
;;
(o)
outputdir=$OPTARG
if [[ ! -e $outputdir ]]; then
rsprint "Output directory not found. Creating it... ($outputdir)"
mkdir -p $outputdir
elif [[ ! -x $outputdir ]]; then
rserror "I cannot write to the output directory you specified: $outputdir"
exit 1
fi
;;
(c)
rscookiejar=$OPTARG
;;
(L)
logfile=$OPTARG
( touch $logfile || ( rserror "Cannot touch logfile."; exit 1 ) )
;;
(l)
rsloginfile=$OPTARG
;;
(f) setlnkfile="${dir}/${2}"; setfileurls;;
(\?)
rserror "Bad option, aborting."
exit 1
;;
esac
done
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
if [ "${cmdlurls}" == "1" ]
then
commandlineurls=($*)
fi
# ec "${commandlineurls[@]}"
# exit
# take care of curlopts
curlopts=("${curlopts[@]}" --user-agent "$agent" --speed-time 240 --speed-limit $minspeed)
#
# main
#
# need a user account for the rest of the script
setuser
setuprscookiejar
# balance mode
if [[ ! -z $balancemode ]]; then
getrsbalance
fi
setrsqueue
# unified download
if [[ ! -z $rsqueue ]]; then
rsprint "Links to rsget: $UNDERLINE${#rsqueue[*]}$NORMAL"
for (( current_id=0; current_id < ${#rsqueue[*]}; current_id++ )); do
link=${rsqueue[$current_id]}
(( c = current_id + 1 ))
echo
rsprint "rsgetting $c/${#rsqueue[*]}: $UNDERLINE$link$NORMAL"
rsfetch "$link" && rsprint "rsgot $UNDERLINE$link$NORMAL!"
echo
randomsleep
done
fi
# get rid of the cookiejar
if [[ -z $keeprscookiejar ]]; then
rm -f $rscookiejar
fi
exit 0