Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file="$1"
- browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
- username=`cat credits.ini | grep username |cut -d \= -f 2`
- password=`cat credits.ini | grep password |cut -d \= -f 2`
- accountype="GOOGLE" #gooApps = HOSTED , gmail=GOOGLE
- mime_type=`file -b --mime-type $file`
- msg=$(/usr/bin/curl \
- -v \
- --data-urlencode Email=$username \
- --data-urlencode Passwd=$password \
- -d accountType=$accountype \
- -d service=writely \
- -d source=cURL \
- "https://www.google.com/accounts/ClientLogin")
- token=`echo "$msg" | grep Auth | cut -d \= -f 2`
- uploadlink=`/usr/bin/curl \
- -Sv \
- -k \
- --request POST \
- -H "Content-Length: 0" \
- -H "Authorization: GoogleLogin auth=${token}" \
- -H "GData-Version: 3.0" \
- -H "Content-Type: $mime_type" \
- -H "Slug: $file" \
- "https://docs.google.com/feeds/upload/create-session/default/private/full/folder:$folderid/contents?convert=false" \
- -D /dev/stdout | grep "Location:" | sed s/"Location: "//`
- /usr/bin/curl \
- -Sv \
- -k \
- --request POST \
- --data-binary "@$file" \
- -H "Authorization: GoogleLogin auth=${token}" \
- -H "GData-Version: 3.0" \
- -H "Content-Type: $mime_type" \
- -H "Slug: $file" "$uploadlink" \
- -D /dev/stdout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement