@@ -21,7 +21,7 @@ const INFO = 1
2121const WARNING = 2
2222const ERR = 3
2323
24- const ENDPOINT string = "https://node02 .steamworkshopdownloader.io/prod//api/"
24+ const ENDPOINT string = "https://node05 .steamworkshopdownloader.io/prod//api/"
2525
2626func logger (text string , errorlevel int ) {
2727
@@ -103,7 +103,7 @@ func main() {
103103request := gorequest .New ()
104104resp , body , _ := request .Post (ENDPOINT + "download/request" ).
105105Set ("Content-Type" , "application/json" ).
106- Send (`{"publishedFileId":` + idUrl + `, "collectionId":0 , "extract":true, " hidden":false, "direct":false , "autodownload":true}` ).
106+ Send (`{"publishedFileId":` + idUrl + `, "collectionId":null , "hidden":false, "downloadFormat":"raw" , "autodownload":true}` ).
107107End ()
108108
109109if resp .StatusCode != 200 {
@@ -115,7 +115,8 @@ func main() {
115115// Download request //
116116uid := gjson .Get (body , "uuid" ).String ()
117117var readyFile = false
118-
118+ var storageNode = ""
119+ var storagepath = ""
119120for i := 0 ; i < 10 ; i ++ { // Try 10 times for 2 seconds of waiting, total 20 seconds of preparation maximum
120121_ , body , _ := request .Post (ENDPOINT + "download/status" ).
121122Set ("Content-Type" , "application/json" ).
@@ -126,6 +127,8 @@ func main() {
126127
127128if strings .Contains (body , "prepared" ) {
128129readyFile = true
130+ storageNode = gjson .Get (body , uid + ".storageNode" ).String ()
131+ storagepath = gjson .Get (body , uid + ".storagePath" ).String ()
129132logger ("INITIATING DOWNLOADING. . . " , INFO )
130133break
131134}
@@ -135,7 +138,7 @@ func main() {
135138// File ready, start download //
136139if readyFile {
137140dir , _ := os .Getwd ()
138- err := DownloadFile (ENDPOINT + "download/transmit ?uuid="+ uid , dir + string (os .PathSeparator )+ idUrl + ".zip" )
141+ err := DownloadFile ("https://" + storageNode + "/prod//storage/" + storagepath + " ?uuid="+ uid , dir + string (os .PathSeparator )+ idUrl + ".zip" )
139142
140143if err != nil {
141144panic (err )
0 commit comments