mirror of
https://github.com/iv-org/youtube-utils.git
synced 2024-11-23 05:39:41 +00:00
api-helper: Use 'sed' to remove tracking parameters
This commit is contained in:
parent
5f20877542
commit
a9b2a07a1c
@ -483,8 +483,19 @@ fi
|
||||
|
||||
hdr_ua="User-Agent: ${user_agent}"
|
||||
|
||||
# Default to STDOUT if no output file was given
|
||||
if [ -z "$output" ]; then output='-'; fi
|
||||
|
||||
# Run!
|
||||
curl --compressed -o "$output" -H "$hdr_ct" -H "$hdr_ua" --data "$data" "$url"
|
||||
result=$(
|
||||
curl --compressed -H "$hdr_ct" -H "$hdr_ua" --data "$data" "$url" | \
|
||||
sed -E '
|
||||
/^\s+"(clickT|t)rackingParams.+,$/d
|
||||
s/,?\n\s+"(clickT|t)rackingParams.+$//
|
||||
'
|
||||
)
|
||||
|
||||
# Default to STDOUT if no output file was given
|
||||
if [ -z "$output" ]; then
|
||||
echo "$result"
|
||||
else
|
||||
echo "$result" > "$output"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user