2022-04-15 18:44:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z $(which jq) ]
|
|
|
|
then
|
|
|
|
echo "Missing jq package, please install"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
token_dat="./token.dat"
|
|
|
|
|
|
|
|
if [ ! -f $token_dat ]
|
|
|
|
then
|
|
|
|
echo "Missing ./token.dat"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
api_base_url="https://udongein.xyz/"
|
|
|
|
access_token="$(cat ${token_dat})"
|
|
|
|
|
|
|
|
sensitivity="$(ls | grep sfw | shuf -n 1)"
|
|
|
|
source_url="${sensitivity}/$(ls ${sensitivity} | shuf -n 1)"
|
|
|
|
is_sensitive=true
|
|
|
|
if [ "${sensitivity}" == "sfw" ]
|
|
|
|
then
|
|
|
|
is_sensitive=false
|
|
|
|
fi
|
|
|
|
|
2022-04-16 02:47:19 +02:00
|
|
|
media_json=$(curl -X POST "${api_base_url}/api/v1/media" \
|
|
|
|
-H "Authorization: Bearer ${access_token}" \
|
|
|
|
-F "file=@${source_url}")
|
|
|
|
|
2022-04-15 18:44:29 +02:00
|
|
|
media_id=$(jq -r ".id" <<< ${media_json})
|
|
|
|
|
|
|
|
curl -X POST -d '{"status":" :gyate_reisen_love:", "sensitive":'${is_sensitive}', "visibility":"'unlisted'", "media_ids":'[\"${media_id}\"]'}' \
|
2022-04-16 02:47:19 +02:00
|
|
|
-H "Authorization: Bearer ${access_token}" \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
"${api_base_url}/api/v1/statuses"
|