This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.go
83 lines (73 loc) · 2.1 KB
/
hello.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
"time"
"github.com/google/uuid"
)
func generateUUID() string {
uuid := uuid.New()
return fmt.Sprintf(`{"partnerUserId":"%s"}`, uuid)
}
func main() {
client := &http.Client{}
file, err := os.OpenFile("output.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Fatal(err)
}
defer file.Close()
// Loop indefinitely
for {
// Request data
var data = strings.NewReader(generateUUID())
req, err := http.NewRequest("POST", "https://api.discord.gx.games/v1/direct-fulfillment", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("authority", "api.discord.gx.games")
req.Header.Set("accept", "*/*")
req.Header.Set("accept-language", "en-US,en;q=0.9")
req.Header.Set("content-type", "application/json")
req.Header.Set("origin", "https://www.opera.com")
req.Header.Set("referer", "https://www.opera.com/")
req.Header.Set("sec-ch-ua", `"Opera GX";v="105", "Chromium";v="119", "Not?A_Brand";v="24"`)
req.Header.Set("sec-ch-ua-mobile", "?0")
req.Header.Set("sec-ch-ua-platform", `"Windows"`)
req.Header.Set("sec-fetch-dest", "empty")
req.Header.Set("sec-fetch-mode", "cors")
req.Header.Set("sec-fetch-site", "cross-site")
req.Header.Set("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0")
// Send request
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
// Read response body
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
// Extract token from response
var result map[string]string
if err := json.Unmarshal(bodyText, &result); err != nil {
log.Fatal(err)
}
token, exists := result["token"]
if !exists {
log.Fatal("Token not found in response")
}
// Generate URL
url := fmt.Sprintf("https://discord.com/billing/partner-promotions/1180231712274387115/%s\n", token)
if _, err := file.WriteString(url); err != nil {
log.Fatal(err)
}
// Delay for 3 seconds
time.Sleep(3 * time.Second)
}
}