How do I download from private GitHub Rep?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sn0wy0wl
Posts: 5
Joined: 18 Mar 2022, 00:14

How do I download from private GitHub Rep?

Post by sn0wy0wl » 06 May 2022, 10:35

Does anyone here have any experience with downloading from a private GitHub repository?

I am using this:
https://deciacco.github.io/posts/ahkgithubprivate/
To try and grab a file from my private repository, the process getting stuck at the 2nd set of requests and I don't know why:

Code: Select all

  request.option(6) := 0 ;no redirects
  request.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 AWS

  if (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", *
  msgbox failed ;added for testing - I am being stopped here.
  }
  else
  {
  msgbox success ;added for testing

The file I want to grab is called Test.exe and the repository is called TT, and the branch is called TestB.
These are my globals:

Code: Select all

 
global g_url := "https://api.github.com/repos/Sn0wy0wl/TT/releases"
global g_file := "Test.exe"
global g_saveto := A_Desktop . "\" . g_file

global g_token := "myToken"  ;Hiding for security.

Where am I going wrong here?

Return to “Ask for Help (v1)”