mirror of
https://github.com/JuLi0n21/pwa-player.git
synced 2026-04-19 23:40:05 +00:00
actual changes :3
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user