Getting A Redirected URL

Hi there!

I have been randomly generating different URLs for sounds on archive.org, such as this fruity little number:
https://archive.org/download/KFJ_2012.10.31_live1.mp3/format=VBR+MP3&ignore=x.ogg

Although this URL plays in the browser, in-game it does not. This is because when put into your browser, it redirects you to another address:

Is there anyway I can simulate trying to get to the URL like in a browser, then get the redirected URL?

Really hoping there is a solution, this project has some potential I reckon.

Thanks for your time,
Magnus :slight_smile:

.

p.s - JS is preferred

Working off Bunny’s post, this was the solution:

First I had to find out what headers were available for this WWW. They are stored in a dictionary so can be listed like this:

for(var cKey in audioFileWWW.responseHeaders.Keys)
{
    Debug.Log("v--new--v");
    Debug.Log(cKey);
    Debug.Log(audioFileWWW.responseHeaders[cKey]);
}

This printed lots of info, then I found that the redirected URL was contained within the “LOCATION” header.

Finally you just look that up in the responseHeader dict to get you redirected Url:

var redirection = audioFileWWW.responseHeaders["LOCATION"]