Compare commits

...

2 Commits

Author SHA1 Message Date
ffcf3ad4b0 Merge pull request 'Add redirect handling' (#9) from redirects into main
Reviewed-on: #9
2022-09-06 01:36:39 +00:00
1f912360e7 added redirect handling 2022-09-05 21:33:31 -04:00
2 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,9 @@ done
if [ "$MIME" = "" ] || [ "$MIME" = "$1" ] || [ "$MIME" = "$INPUT" ]
then
echo "Determining MIME type of $INPUT:"
MIME=$(curl -I -s "$INPUT" | sed -ne 's/^[cC]ontent-[tT]ype: //p' | sed -e 's/;.\+//g' | tr -d '\r')
# Determines HTTP code, might use for something else?
# CODE=$(curl -fLIs "$INPUT" | sed -ne 's/ [[:space:]]*$//p' | sed -ne 's|^HTTP/.\+ ||p')
MIME=$(curl -fLIs "$INPUT" | sed -ne 's/^[cC]ontent-[tT]ype: //p' | sed -e 's/;.\+//p' | tail -n1 | tr -d '\r')
echo $MIME
fi

View File

@ -0,0 +1,3 @@
# EXT-TYPE=replace
replace youtube.com or youtu.be with piped.mint.lgbt