#SingleInstance,force#NoEnv#Include%A_ScriptDir%\..\json\JSON.ahk;https://github.com/cocobelgica/AutoHotkey-JSON;------------------------------------------------------------------;GLOBALSglobalg_url:="https://api.github.com/repos/<username>/<repository>/releases"globalg_file:="filename.zip"globalg_saveto:=A_Desktop. "/". g_file; You need to generate this in your github accountglobalg_token:="74jf8gh7ihdg9orlkk948rjfugnry369jgirn857"; <-- not a real token, demo purposes;------------------------------------------------------------------;MAIN CODEr:=falserequest:=comobjcreate("WinHttp.WinHttpRequest.5.1"); Lets get our "navigator"request.Open("GET",g_url,false)request.SetRequestHeader("Authorization","token ". g_token)request.Send(); Get the releases informationif (request.responsetext= "failed"||request.status!=200||comobjtype(request.responsestream)!=0xd){FileAppend,%"Error:`r`n". "Status: `r`n". request.status. "`r`n". "Headers: `r`n". request.getallresponseheaders(). "`r`n". "Response: `r`n". request.responsetext. "`r`n",*}else{jsObj:=JSON.Load(request.ResponseText); Parse the JSON file returned from the GitHub APIfor index,elementinjsObj.1.assets{; we need to get a certain file out of all the assetsif (element.name= g_file){g_url:=element.url}}}request.option(6):=0;no redirectsrequest.open("GET",g_url,false)request.setrequestheader("Authorization","token ". g_token)request.setrequestheader("Accept","application/octet-stream")request.send();FIRST request gets the 302 redirect to AWSif (request.responsetext= "failed"||request.status!=302||comobjtype(request.responsestream)!=0xd){FileAppend,%"Error:`r`n". "Status: `r`n". request.status. "`r`n". "Headers: `r`n". request.getallresponseheaders(). "`r`n". "Response: `r`n". request.responsetext. "`r`n",*}else{g_url:=request.getresponseheader("Location");get the redirect URLrequest.open("GET",g_url,false)request.send();SECOND request gets the file to downloadif (request.responsetext= "failed"||request.status!=200||comobjtype(request.responsestream)!=0xd){FileAppend,%"Error:`r`n". "Status: `r`n". request.status. "`r`n". "Headers: `r`n". request.getallresponseheaders(). "`r`n". "Response: `r`n". request.responsetext. "`r`n",*}else{g_url:=request.getresponseheader("Content-Length")URLDownloadToFile,%g_url,%g_saveto; download the fileif (ErrorLevel= 1){FileAppend,%splash_msg_prog. "Download Failed..."}else{FileAppend,%splash_msg_prog. "File downloaded!"}FileAppend,%"Done!`r`n",*}}}return