fp/scripts/capture-integration.sh

25 lines
729 B
Bash
Raw Normal View History

2024-09-21 03:01:21 +00:00
#!/bin/bash
if [ -z "${AUTOMATION_USER_JWT}" ]; then
echo "Error: AUTOMATION_USER_JWT variable is not defined."
exit 1
fi
# get a random room
response=$(curl -sL --fail GET http://localhost:8134/chaturbate/random-room)
exitcode=$?
url=$(echo $response | jq -r '.url')
if [[ $exitcode -ne 0 || -z "$response" || -z "$url" ]]; then
echo "failed to get random room. exitcode=${exitcode}, response=${response}, url=${url}"
exit $exitcode
fi
echo "Random online chaturbate room url=${url}"
# create a recording
curl -sL -H "Authorization: Bearer ${AUTOMATION_USER_JWT}" \
-H "Content-Type: application/json" \
-d '{"url": "'"${url}"'"}' \
http://localhost:9000/recordings
echo "finished creating recording"