I'm not sure if $ua->max_redirect(0) before the request will do that for you.
In reply to Re: Get redirected URL by vitoco in thread Get redirected URL by xorl