minor code cleanup
Marco Andronaco andronacomarco@gmail.com
Sat, 13 Jan 2024 12:16:22 +0100
2 files changed,
1 insertions(+),
10 deletions(-)
M
invidious/api.go
→
invidious/api.go
@@ -79,7 +79,7 @@ return err
} if resp.StatusCode != http.StatusOK { - return HTTPError{resp.StatusCode} + return fmt.Errorf("HTTP error: %d", resp.StatusCode) } var jsonArray [][]interface{}
M
invidious/invidious.go
→
invidious/invidious.go
@@ -1,7 +1,6 @@
package invidious import ( - "fmt" "net/http" "regexp" "strconv"@@ -65,14 +64,6 @@ if err != nil {
return 0 } return res -} - -type HTTPError struct { - StatusCode int -} - -func (e HTTPError) Error() string { - return fmt.Sprintf("HTTP error: %d", e.StatusCode) } func (c *Client) GetVideo(videoId string, fromCache bool) (*Video, error) {