Makes linkhandler handle more

It now handles some peertube, more invidious and xkcd
This commit is contained in:
Jonathan Hodgson 2020-09-19 11:12:00 +01:00
parent 2acea3ea54
commit 0d357e8f9e
2 changed files with 10 additions and 2 deletions

View file

@ -7,7 +7,11 @@ elif [[ "$comic" == "random" ]] || [[ "$comic" == "r" ]]; then
number=$(shuf -i1-$latest -n1)
json=$(curl https://xkcd.com/$number/info.0.json 2> /dev/null)
else
json=$(curl https://xkcd.com/$comic/info.0.json 2> /dev/null)
if [[ "$comic" = *"xkcd.com"* ]]; then
json=$(curl $comic/info.0.json 2> /dev/null)
else
json=$(curl https://xkcd.com/$comic/info.0.json 2> /dev/null)
fi
fi
echo $json | /usr/bin/jq -C
echo $json | /usr/bin/jq ".img" | xargs curl -s -o /tmp/xkcd