From 1b41b6de847a6e0ee5fd4dcfce8a5bbf2e02be79 Mon Sep 17 00:00:00 2001 From: lwthiker Date: Sat, 19 Feb 2022 14:55:50 +0200 Subject: [PATCH] Add --compressed flag by default Similar to https://github.com/lwthiker/curl-impersonate/pull/5 --- chrome/curl_chrome98 | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/chrome/curl_chrome98 b/chrome/curl_chrome98 index f023aa0..8c5bc64 100755 --- a/chrome/curl_chrome98 +++ b/chrome/curl_chrome98 @@ -3,11 +3,6 @@ # Find the directory of this script dir=`echo "$0" | sed 's%/[^/]*$%%'` -PIPE=/tmp/curl-pipe - -rm -f "$PIPE" && mkfifo "$PIPE" -exec 5<>"$PIPE" 3>"$PIPE" 4<"$PIPE" 5>&- - # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using this reference # https://wiki.mozilla.org/Security/Cipher_Suites @@ -25,16 +20,5 @@ exec 5<>"$PIPE" 3>"$PIPE" 4<"$PIPE" 5>&- -H 'Sec-Fetch-Dest: document' \ -H 'Accept-Encoding: gzip, deflate, br' \ -H 'Accept-Language: en-US,en;q=0.9' \ - --http2 --false-start --tlsv1.2 \ - $@ >&3 - -exec 3>&- - -IFS= read -d '' -r -n 2 -u 4 header - -# Due to the "Accept-Encoding: gzip" header, we may receive a gzipped file. -if [ "$(echo -n $header | xxd -l 2 -p)" == "1f8b" ]; then - (printf "%s" "$header"; cat <&4) | gzip -cd; -else - printf "%s" "$header"; cat <&4; -fi + --http2 --false-start --tlsv1.2 --compressed \ + $@