Page 1 of 2

Error trying to download the V1 and V2 files with current version number

Posted: 29 Apr 2024, 15:07
by JoeWinograd
Hi Folks,
I've been using two scripts for many years to download the current AHK version number, compare it to what I'm running, and offer to download the installer or ZIP file. The download of the V1 and V2 files with the version number stopped working sometime within the past few days. I extracted a small portion of the scripts to show the problem:

Code: Select all

; this is for V2
fileCurrentVersion:=A_Temp . "\AutoHotkeyCurrentVersionV2.txt"
urlCurrentVersion:="https://www.autohotkey.com/download/2.0/version.txt"
Try Download(urlCurrentVersion,fileCurrentVersion)
Catch Error as DownloadError
{
  DownloadErrorMessage:=DownloadError.Message
  MsgBox("Error Message " . DownloadErrorMessage . " trying to download V2 version number`n`nURL=" . urlCurrentVersion . "`n`nFile=" . fileCurrentVersion,"AutoHotkey V2 Download Failed","4112")
  ExitApp
}
Run fileCurrentVersion
ExitApp

Code: Select all

; this is for V1
fileCurrentVersion:=A_Temp . "\AutoHotkeyCurrentVersionV1.txt"
urlCurrentVersion:="https://www.autohotkey.com/download/1.1/version.txt"
UrlDownloadToFile,%urlCurrentVersion%,%fileCurrentVersion%
If (ErrorLevel!=0)
{
  MsgBox,4112,AutoHotkey V1 Download Failed,Error Level=%ErrorLevel% trying to download V1 version number`n`nURL=%urlCurrentVersion%`n`nFile=%fileCurrentVersion%
  ExitApp
}
Run,%fileCurrentVersion%
ExitApp
Each of those snippets should download then open the text file with the version number (which they've done for the last many years), but are now producing an error:

AutoHotkey v2 version number download failed.png
AutoHotkey v2 version number download failed.png (11.28 KiB) Viewed 4140 times
AutoHotkey v1 version number download failed.png
AutoHotkey v1 version number download failed.png (10.65 KiB) Viewed 4140 times

I don't know if this should be characterized as a "Bug Report", but it seemed as good a place as any to post it. But an admin should move it to a more appropriate place, if need be. Btw, going to those files in a web browser works fine, so the "bug" would seem to be related to the download feature. Regards, Joe

Re: Error trying to download the V1 and V2 files with current version number

Posted: 29 Apr 2024, 17:45
by TAC109
Problems like this occur when the AutoHotkey administrators turn on Cloudflare monitoring, which can inject ‘I am not a robot' code into the interaction.

All should return to normal when the Cloudflare monitoring is switched off.

Cheers

Re: Error trying to download the V1 and V2 files with current version number

Posted: 29 Apr 2024, 18:05
by JoeWinograd
Hi TAC,
Thanks for the explanation...much appreciated! Cheers, Joe

Re: Error trying to download the V1 and V2 files with current version number

Posted: 30 Apr 2024, 18:35
by TAC109
@joedf Do you still have some Cloudflare restrictions in place? UrlDownloadToFile from the AutoHotkey site is still not working.

Cheers

Re: Error trying to download the V1 and V2 files with current version number

Posted: 30 Apr 2024, 23:23
by joedf
No, just checked Cloudflare WAF / firewall rules, Hosting panel firewall, server iptables, and .htaccess files.... Didnt find anything blocking.... We even whitelist the /download/* folder on cloudflare...
I think there's something I'm missing.
Maybe @tank knows?

Interesting / weird, I can do wget and curl just fine...
I even tried https://www.autohotkey.com/download/versions.txt
All working with wget or curl but not UrlDownloadToFile... :think:

Re: Error trying to download the V1 and V2 files with current version number

Posted: 01 May 2024, 00:51
by TAC109
Thanks for looking into this @joedf.
I’m also having problems using UrlDownloadToFile on https://www.autohotkey.com/mpress/mpress.219.zip, used in the Ahk2Exe Updater.

Cheers

Re: Error trying to download the V1 and V2 files with current version number

Posted: 02 May 2024, 10:23
by tank
really sounds like a problem based on useragent, possible i broke it the other day

Re: Error trying to download the V1 and V2 files with current version number

Posted: 02 May 2024, 12:23
by joedf
:mrgreen: Oh useragent!!! Right, makes sense. Didnt even cross my mind.

Re: Error trying to download the V1 and V2 files with current version number

Posted: 06 May 2024, 12:05
by JoeWinograd
Hi Folks,
I don't know if anyone is looking into this, but just a quick note to say that, as of a few minutes ago, it is still not working (neither V1 nor V2). Regards, Joe

Re: Error trying to download the V1 and V2 files with current version number

Posted: 06 May 2024, 14:23
by joedf

Re: Error trying to download the V1 and V2 files with current version number

Posted: 06 May 2024, 14:37
by kczx3
joedf wrote:
06 May 2024, 14:23
Weird, https://autohotkey.com/download/1.1/version.txt works for me...
It only does not work when using URLDownloadToFile or Download...

Re: Error trying to download the V1 and V2 files with current version number

Posted: 06 May 2024, 15:02
by gregster
Interestingly, the respective codes from example #4 (asynchronous HTTP request) work for me in v1 and v2:
https://www.autohotkey.com/docs/v2/lib/Download.htm#ExXHR
https://www.autohotkey.com/docs/v1/lib/URLDownloadToFile.htm#XHR

Re: Error trying to download the V1 and V2 files with current version number

Posted: 06 May 2024, 15:09
by kczx3
I tried them and they didn't work. The WinHTTP example timed out and the XMLHttpRequest example gave error 12031.

Re: Error trying to download the V1 and V2 files with current version number

Posted: 06 May 2024, 21:11
by joedf
okay, wierd... Works on one PC but not on my other PC...

Re: Error trying to download the V1 and V2 files with current version number

Posted: 07 May 2024, 18:45
by tank
I have looked at every setting relted to firewall or cloudflare,
this one is very strange

Re: Error trying to download the V1 and V2 files with current version number

Posted: 11 May 2024, 22:29
by JoeWinograd
joedf wrote:Works on one PC but not on my other PC
Fails on every PC here that I've tried it on, including W8.1, W10, and W11. Still happening...just tried it on all three of those systems...both V1 and V2. Hoping someone can fix this. Regards, Joe

Re: Error trying to download the V1 and V2 files with current version number

Posted: 11 May 2024, 22:34
by tank
I wish I had even an error message

Re: Error trying to download the V1 and V2 files with current version number

Posted: 12 May 2024, 01:55
by JoeWinograd
I get the feeling that it has something to do with the https://www.autohotkey.com domain, as downloads from other domains work. For example, the downloads work fine in the scripts I posted with this URL:

https://raw.githubusercontent.com/AutoHotkey/AutoHotkey/alpha/license.txt

Also, it's not just the version files that fail...downloads of the EXE and ZIP files fail, too. As a temporary solution, would it be possible to host the downloads elsewhere until the https://www.autohotkey.com downloads are fixed?

Re: Error trying to download the V1 and V2 files with current version number

Posted: 12 May 2024, 23:26
by joedf

Re: Error trying to download the V1 and V2 files with current version number

Posted: 13 May 2024, 03:20
by JoeWinograd
Thanks for the idea. although I don't see anything with V1 in it at the first link. I know that V1 is deprecated, but I have high hopes that we may see something beyond 1.1.37.02, especially if a future version of Windows makes it necessary. It is not feasible to convert from V1 to V2 all the programs (or even the most important ones) that I wrote, including the required supporting libraries that I did not write.