Created
December 20, 2019 16:37
-
-
Save haydonryan/94fb059b9b2773d3ff792cf3e527cf9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
newfile () { | |
fname=$1 | |
count=0 | |
while [ -e "$fname" ] | |
do | |
# fname="$1.$((++count)).mp4" | |
fname="$(basename $1 .mp4).$((++count)).mp4" | |
done | |
echo "$fname" | |
} | |
if [ $# -eq 0 ] | |
then | |
echo "Tiktok scraper" | |
echo "Usage:" | |
echo "get_tiktok_video.sh <URL to get>" | |
fi | |
URL=$(wget -q "$1" -O - 2>&1 | grep "video playsinline" | grep -Eoi 'loop="".src="[^\"]+"' | grep -Eoi 'https[^\"]+') | |
echo "Getting Video URL $URL" | |
echo "as $(newfile video.mp4)" | |
wget -O $(newfile video.mp4) "$URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment