28 خطوط
458 B
Bash
Executable File
28 خطوط
458 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
URL=$1
|
|
HOOK=$2
|
|
|
|
# start server
|
|
forever start -o server.log server.js > /dev/null
|
|
sleep 1
|
|
|
|
while ! grep --quiet "TikTok Signature server started" server.log; do
|
|
sleep 1
|
|
done
|
|
|
|
# execute browser.js *URL*
|
|
SIGNATURE=$(node browser.js $URL)
|
|
|
|
# get response
|
|
DATA=$(python grab.py "$URL" "$SIGNATURE")
|
|
|
|
# send to webhook
|
|
if [ -z "$HOOK" ]; then
|
|
echo "$DATA"
|
|
else
|
|
curl -X POST \
|
|
-d "data=$DATA" \
|
|
"$HOOK"
|
|
fi |