Commit ce40be9838

ce40be9838e477e1fe86b8b728ac91b3d8e63bc8

parent: 7b10795b4e

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-21 14:51 UTC

Fix: Logs in dubug

Layout: unified · split

internal/episode_url.go +4 −4
@@ -60,7 +60,7 @@ func extractLinks(provider_id string) map[string]interface{} {
6060 req, err := http.NewRequest("GET", url, nil)
6161 var videoData map[string]interface{}
6262 if err != nil {
63 fmt.Println("Error creating request:", err)
63 Log(fmt.Sprint("Error creating request:", err), logFile)
6464 return videoData
6565 }
6666
@@ -79,14 +79,14 @@ func extractLinks(provider_id string) map[string]interface{} {
7979 // Read the response body
8080 body, err := io.ReadAll(resp.Body)
8181 if err != nil {
82 fmt.Println("Error reading response:", err)
82 Log(fmt.Sprint("Error reading response:", err), logFile)
8383 return videoData
8484 }
8585
8686 // Parse the JSON response
8787 err = json.Unmarshal(body, &videoData)
8888 if err != nil {
89 fmt.Println("Error parsing JSON:", err)
89 Log(fmt.Sprint("Error parsing JSON:", err), logFile)
9090 return videoData
9191 }
9292
@@ -151,7 +151,7 @@ func GetEpisodeURL(config CurdConfig, id string, epNo int) ([]string, error) {
151151 var response allanimeResponse
152152 err = json.Unmarshal([]byte(responseStr), &response)
153153 if err != nil {
154 fmt.Println("Error parsing JSON: ", err)
154 Log(fmt.Sprint("Error parsing JSON: ", err), logFile)
155155 }
156156
157157 var allinks []string // This will be returned