diff --git a/xdg-sanity.sh b/xdg-sanity.sh index 0e10985..3ee015c 100755 --- a/xdg-sanity.sh +++ b/xdg-sanity.sh @@ -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 diff --git a/xdg-sanity/extensions/youtube-replace b/xdg-sanity/extensions/youtube-replace new file mode 100755 index 0000000..e0276d2 --- /dev/null +++ b/xdg-sanity/extensions/youtube-replace @@ -0,0 +1,3 @@ +# EXT-TYPE=replace + +replace youtube.com or youtu.be with piped.mint.lgbt \ No newline at end of file