Hello together,
at first many many thanks to BeniBela for his excellent work on Internet Tools.
I have a small question; for my
http://arndtb.github.io/WoW-Addon-Updater/ I've trying to solve a little problem, but after hours of searching I have no clue, how I can solve that with Internet Tools.
To create entries for the Addon-database, the needed entries will be extracted from the website of an specified Addon-URL, for example
https://www.curseforge.com/wow/addons/recount.
Now I want to determine the Download-URL for the ZIP-File.
function GetAddonURL(url: string): string;
var
ReqAddonURL: IXQValue;
AddonURL: string;
begin
ReqAddonURL := process(url + '/download', '//a[@class="download__link"]/@href');
AddonURL := 'https://www.curseforge.com' + ReqAddonURL.toString;
Result := AddonURL;
end;
This will give the following result:
https://www.curseforge.com/wow/addons/recount/download/2509332/fileBut this page will be redirected, showing for example with curl on command line:
curl https://www.curseforge.com/wow/addons/recount/download/2509332/file -i
HTTP/1.1 307 Temporary RedirectDate: Sat, 06 Jan 2018 21:41:19 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: __cfduid=d00e032640c7a5584392814737cbce3951515274879; expires=Sun, 06-Jan-19 21:41:19 GMT; path=/; domain=.www.curseforge.com; HttpOnly
Cache-Control: private
Location: https://addons.cursecdn.com/files/2509/332/Recount-v7.3.2b.zipX-AspNetMvc-Version: 5.2
X-Frame-Options: SAMEORIGIN
X-AspNet-Version: 4.0.30319
X-UA-Compatible: IE=edge,chrome=1
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=600
Server: cloudflare-nginx
CF-RAY: 3d91d739fc6d979e-FRA
My problem is: How can I extract the „Location“-Header-Entry with the File-URL (
marked) with Internet Tools?
I’ve tried it with
process(AddonURL, 'extract(/, "https://([^&]+).zip")')
- but with no success.
Is there another way with Internet Tools, what I cannot see in the moment?
Thank you very much for your help and your ideas!