隔壁大佬做出的上传脚本
- bash <(curl -s "https://dpaste.org/AYb55/raw" | tr -d '\r') 1.png
复制代码
- #!/bin/bash
- uploadFile() {
- visiterId=$(curl -s -L "https://www.ecfw.monster/index/index/home?visiter_id=&visiter_name=&avatar=&business_id=130&groupid=0&special=137" \
- | grep "var visiter_id=" \
- | sed -r "s:.*var visiter_id= '(.*?)';.*:\1:g")
- activateVisiterId=$(curl -s 'https://www.ecfw.monster/admin/event/notice' \
- -H 'Accept: */*' \
- -H 'X-Requested-With: XMLHttpRequest' \
- -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 UOS' \
- -H 'Origin: https://www.ecfw.monster' \
- -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8' \
- -H "Cookie: visiter_id=$visiterId" \
- -d "visiter_id=$visiterId" \
- -d "visiter_name=游客$visiterId" \
- -d "business_id=130" \
- -d "from_url=https://www.ecfw.monster/" \
- -d "avatar=/assets/images/index/avatar-red2.png" \
- -d "groupid=0" \
- -d "special=137" \
- --compressed)
- picSuffix=$(curl -s 'https://www.ecfw.monster/admin/event/upload' \
- -H 'X-Requested-With: XMLHttpRequest' \
- -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36' \
- -H 'Origin: https://www.ecfw.monster' \
- -H 'Referer: https://www.ecfw.monster/index/index' \
- -F "upload=@$1" \
- -F "visiter_id=$visiterId" \
- -F 'business_id=130' \
- -F 'service_id=137' \
- --compressed | jq -r ".data" | sed -r 's:<img.*?"(.*?)" />:\1:g')
- echo "https://www.ecfw.monster$picSuffix"
- }
- absolutePath=$(readlink -f $1)
- if [ ! -f $absolutePath ];then
- echo "请修改路径"
- exit 1
- fi
- uploadFile $absolutePath
复制代码
|