Welcome to the community forums!
I believe you could use the solution described in How can I get responses from redirections? - #3 by codebien to get the Redirected Request URL and later parse a value with URL and URLSearchParams web apis by legander 路 Pull Request #9 路 grafana/jslib.k6.io 路 GitHub.
Hope that answers,
Cheers!