Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # ./emotescrape [CHANNEL_NAME]
- file="cockandballszzzzzzzzzaaaaaaaa"
- wget -k -O "$file" --post-data "query=$1" https://twitchemotes.com/search/channel || (rm "$file" ; exit)
- dest="./$1_emotes"
- mkdir -p "$dest"
- page="$(cat "$file")"
- readarray files < <(echo "$page" | grep "https://static-cdn.jtvnw.net/emoticons/v2" | sed 's/src="\(.*\)2\.0" data-toggle="popover"/\13.0/')
- readarray names < <(echo "$page" | grep 'data-tooltip="' | sed 's/.*<br \/>\(.*\)<\/center.*/\1/')
- i=0
- for f in "${files[@]}"; do
- if echo "$f" | grep "animated" ; then
- fileext=".gif"
- else
- fileext=".png"
- fi
- wget -O "$dest/$(echo "${names[$i]}$fileext" | tr -d '\n')" $f &
- ((i++))
- done
- wait
- rm "$file"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement