/usr/bin/megaupload
Code: Select all
#!/bin/bash
# place your megaupload cookie string here
# to obtain one, all you need to do is login to megaupload
# type the following in address bar
# javascript:document.write(document.cookie);
# your string is user=(something);
cstr=ABC123
description=test
for file in "$@"
do
echo -n "Uploading...$file..."
ident=`wget -qO- --no-cookies --header "Cookie: user=$cstr" http://www.megaupload.com/ | grep ENCTYPE | cut -d '"' -f 8`
value=`echo $ident | cut -d '=' -f 2`
data=`curl -s -b "user=$cstr" -F "UPLOAD_IDENTIFIER=$ident" -F "sessionid=$value" -F "file=@$file" -F "message=$description" -F "accept=on" $ident`
size=`echo $data | cut -d ' ' -f 10``echo $data | cut -d ' ' -f 11`
mega=`echo $data | cut -d "'" -f 6 | cut -d '=' -f 2`
echo "$file||$size||$mega" >> links
echo "Done!"
done
# chmod +x /usr/bin/megaupload
examples:
# megaupload file[1-9].avi -> will upload file1.avi,file2.avi...file9.avi
# megaupload file1.avi -> will upload file1.avi
# megaupload * -> will upload all files
A log will be written to a file called links.