mirror of
https://gitea.invidious.io/iv-org/youtube-utils.git
synced 2024-08-15 00:53:16 +00:00
api-helper: Use 'sed' to remove tracking parameters
This commit is contained in:
parent
5f20877542
commit
a9b2a07a1c
1 changed files with 14 additions and 3 deletions
|
@ -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 a new issue