TWebCopy 2.4.3.0: Using redirection URL?

Hi! When I open this redirection link (which comes from a Google search result) in a web browser then the link target PDF file is successfully downloaded:


https://www.google.at/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCYQFjAA&url=http%3A%2F%2Fwww.pdf995.com%2Fsamples%2Fpdf.pdf&ei=RV9HVa63HvTY7AaGqIGwCw&usg=AFQjCNFUjjZAJw2DPPGOy7FpbX0wEqSnzA&sig2=UxnoziVuf326oFUIzzkY1Q&bvm=bv.92291466,d.ZGU

This redirection URL points to this URL:

www.pdf995.com/samples/pdf.pdf

Of course the download of the PDF file with TMS WebCopy only works with the second URL. But if I only have the first redirection URL, is there a way to get to the second direct URL so I can download the file with WebCopy? Maybe by using a WebCopy property FollowRedirection?

This is far from trivial. The link leads to the HTML with Javascript:


<script>window.googleJavaScriptRedirect=1</script><script>var m={navigateTo:function(b,a,d){if(b!=a&&b.google){if(b.google.r){b.google.r=0;b.location.href=d;a.location.replace("about:blank");}}else{a.location.replace(d);}}};m.navigateTo(window.parent,window,"http://www.pdf995.com/samples/pdf.pdf");
</script><noscript><META http-equiv="refresh" content="0;URL='http://www.pdf995.com/samples/pdf.pdf'"></noscript>

and it is this Javascript that does redirection, so parsing this Javascript is beyond the feature set of TWebCopy unfortunately.

I wonder whether it would be possible to somehow SIMULATE opening the long redirection link (like somebody had clicked on it), then waiting for the server response and then - instead of showing the download dialog - transparently downloading the file to the local directory configured in WebCopy?

I think this is a bit beyond the scope of TWebCopy itself. Have you considered opening such URLs in the TWebBrowser and detect what the redirect is to via the TWebBrowser and then use this URL with TWebCopy?

Thanks, that could be a way to go.