actual changes :3

This commit is contained in:
2025-05-21 01:20:56 +02:00
parent 005ae783c5
commit 396ccc28f4
22 changed files with 3710 additions and 36 deletions

View File

@@ -21,10 +21,9 @@ import (
// @version 1.0
// @description Server Hosting ur own osu files over a simple Api
// @host localhost:8080
// @host /
// @BasePath /api/v1/
func main() {
envMap, err := godotenv.Read(".env")
if err != nil {
fmt.Println("Error reading .env file")
@@ -125,7 +124,7 @@ func StartCloudflared(port string) (string, error) {
}
func sendUrl(endpoint, cookie string) error {
url := "http://proxy.illegalesachen.download/settings"
url := GetEnv("PROXY_URL", "https://proxy.illegalesachen.download/settings")
payload := struct {
Sharing *bool `json:"sharing"`
@@ -137,22 +136,19 @@ func sendUrl(endpoint, cookie string) error {
body, err := json.Marshal(payload)
if err != nil {
return fmt.Errorf("Error marshalling payload: %v", err)
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(body))
if err != nil {
return fmt.Errorf("Error creating request: %v", err)
return fmt.Errorf("failed to create request: %v", err)
}
req.Header.Add("Content-Type", "application/json")
req.AddCookie(&http.Cookie{
Name: "session_cookie",
Value: cookie,
})
req.Header.Set("Content-Type", "application/json")
fmt.Println(req)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
@@ -163,6 +159,5 @@ func sendUrl(endpoint, cookie string) error {
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("Error in request: %s", resp.Status)
}
fmt.Println("Response Status:", resp.Status)
return nil
}