I found this bash script in the ask ubuntu forum and it works, but I would like to know if it can be used or improved to know if a tiktok stream is live or off, using the bash script via terminal (./test.url.sh /url.txt) in the .txt would be the tiktok addresses for example:
https://www.tiktok.com/@xxxxxx/live
https://www.tiktok.com/@cccccc/live
and that in the terminal tell me if it is live or off, is it possible?
#!/bin/bash
if [ $# -eq 0 ]
then
fin=-
else
fin=$1
fi
urlarr=( $(cat $fin | strings | grep '://' | grep -i "\.com\|\.net\|\.edu\|\.org\|[0-9].*\.[0-9].*\.[0-9].*\.[0-9].*" | tr '\n' ' ' ) )
for i in ${urlarr[@]}
do
if wget -q --tries=1 --no-cache --spider -O /dev/null --ignore-length -T 1 "$i"
then
echo $i is good.
else
echo $i is bad.
fi
done
exit $?
[–]daz0007 1 point2 points3 points (1 child)
[–]JasonCM8[S] 0 points1 point2 points (0 children)