Format of extra-headers in souphttpsrc

Hi I am trying to use extra-headers with souphttpsrc from cli.

I found this example

gst-launch-1.0 -v souphttpsrc  extra-headers=\"extra-headers\,\ HeaderFieldOne\=\(string\)Android\/2.3.15\,\ HeaderFieldTwo\=\(string\)Test\" location=http://static.polskieradio.pl/159a55d7-a4b5-4adc-aaff-a33a814c7320.mp3\?source\=MAIN_PLAYER_PR_V2 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! autoaudiosink

I want to add following header

{'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.19 Safari/537.36'}

Which results in following string

 \ User-Agent\=\(string\)Mozilla/5.0\/(Windows\/NT\/10.0;\/Win64;\/x64)\/AppleWebKit/537.36\/(KHTML,\/like\/Gecko)\/Chrome/91.0.4472.19\/Safari/537.36\

I wrote a small snippet of python to try to encode headers myself

key = 'User-Agent' 
value = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.19 Safari/537.36'

string = f" \ {key}\=\(string\){value.replace(' ', '\/')}\\"

print(string)

But after inserting inside command looks like that but it throws:

bash: syntax error near unexpected token ('`

gst-launch-1.0 -v souphttpsrc  extra-headers=\"extra-headers\,\ User-Agent\=\(string\)Mozilla/5.0\/(Windows\/NT\/10.0;\/Win64;\/x64)\/AppleWebKit/537.36\/(KHTML,\/like\/Gecko)\/Chrome/91.0.4472.19\/Safari/537.36\,\ HeaderFieldTwo\=\(string\)Test\" location=http://static.polskieradio.pl/159a55d7-a4b5-4adc-aaff-a33a814c7320.mp3\?source\=MAIN_PLAYER_PR_V2 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! autoaudiosink

I’ve also tried using standard bash escaping using this but it also didn’t help

How the escaping works?

You may try to insert a backslash before any ‘(’ or ‘)’.

GST_DEBUG=*soup*:LOG gst-launch-1.0 -v souphttpsrc  extra-headers='extra-headers, User-Agent=(string)"Mozilla/5.0/(Windows/NT/10.0;/Win64;/x64)/AppleWebKit/537.36/(KHTML,/like/Gecko)/Chrome/91.0.4472.19/Safari/537.36", HeaderFieldTwo=(string)Test' location=... ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! autoaudiosink 2>&1 | grep -i extra