PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : (BASH) - Upload Movies streamcloud.eu (BASH/Linux)



Syrius
14.05.2015, 22:37
Weil ich heut echt gut drauf bin, begehe ich mal wieder einen großen Fehler :D

Anbei ein BASH-Script/Funktion womit sich Filme/Clips im Format avi|flv|mpg|mp4|mp4x|wmv|mpeg|mov|mkv auf streamcloud.eu hochladen lassen


streamcloud_upload () {
echo -e "\n#--> STARTE UPLOAD: streamcloud.eu - FILE: ${1}\n"
mkdir -p api
COOKIE_STREAMCLOUD="api/cookie.streamcloud"
rm -f ${COOKIE_STREAMCLOUD}
STREAMCLOUD_LOGIN=`curl -sS ${PROXY_HOST} -A "${USERAGENT}" -c "${COOKIE_STREAMCLOUD}" -d "op=login&redirect=http%3A%2F%2Fstreamcloud.eu%2F&login=${ACCOUNT_USER}&password=${ACCOUNT_PASS}" "http://streamcloud.eu/"`
STREAMCLOUD_TEMP=`curl -sS ${PROXY_HOST} -A "${USERAGENT}" -b "${COOKIE_STREAMCLOUD}" "http://streamcloud.eu/?op=upload"`
STREAMCLOUD_SESSION_ID=`echo "${STREAMCLOUD_TEMP}" | grep "sess_id" | head -n1 | cut -d\" -f6`
STREAMCLOUD_SERVER_TEMP=`echo "${STREAMCLOUD_TEMP}" | grep "srv_tmp_url" | head -n1 | cut -d\" -f6`
STREAMCLOUD_DISK_ID=`echo "${STREAMCLOUD_TEMP}" | grep "disk_id" | head -n1 | cut -d\" -f6`
STREAMCLOUD_SERVER=`echo "${STREAMCLOUD_SERVER_TEMP}" | cut -d\/ -f3 | cut -d\: -f1`
STREAMCLOUD_SERVER_ID=`echo "${STREAMCLOUD_TEMP}" | grep "name=\"srv_id" | head -n1 | cut -d\" -f6`
STREAMCLOUD_UPLOAD_ID=`shuf -i 100000000000-999999999999 -n 1`
STREAMCLOUD_UPLOAD=`curl ${PROXY_HOST} -A "${USERAGENT}" -b "${COOKIE_STREAMCLOUD}" -F "upload_type=file" -F "sess_id=${STREAMCLOUD_SESSION_ID}" -F "srv_tmp_url=${STREAMCLOUD_SERVER_TEMP}" -F "srv_id=${STREAMCLOUD_SERVER_ID}" -F "disk_id=${STREAMCLOUD_DISK_ID}" -F "[email protected]${1}" -F "fakefilepc=${1}" -F "file_title=" -F "file_descr=" -F "tags=" -F "tos=1" -F "submit_btn= Hochladen! " -L "http://${STREAMCLOUD_SERVER}/cgi-bin/upload.cgi?upload_id=${STREAMCLOUD_UPLOAD_ID}&js_on=0&utype=reg&upload_type=file&disk_id=${STREAMCLOUD_DISK_ID}"`
STREAMCLOUD_LINK=`echo "${STREAMCLOUD_UPLOAD}" | grep "${STREAMCLOUD_FILENAME}" | head -n1 | cut -d\" -f2`
if [ -n "${STREAMCLOUD_LINK}" ]; then
echo "${STREAMCLOUD_FILENAME}:${STREAMCLOUD_LINK};" >> link.streamcloud
else
streamcloud_upload "${1}"
fi
}

Aufruf: streamcloud_upload "file.avi"