Skip to content

Commit

Permalink
minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
birabittoh committed Jan 13, 2024
1 parent fae2afd commit d9344f2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion invidious/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *Client) NewInstance() error {
}

if resp.StatusCode != http.StatusOK {
return HTTPError{resp.StatusCode}
return fmt.Errorf("HTTP error: %d", resp.StatusCode)
}

var jsonArray [][]interface{}
Expand Down
9 changes: 0 additions & 9 deletions invidious/invidious.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package invidious

import (
"fmt"
"net/http"
"regexp"
"strconv"
Expand Down Expand Up @@ -67,14 +66,6 @@ func parseOrZero(number string) int {
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) {
logger.Info("Video https://youtu.be/", videoId, " was requested.")

Expand Down

0 comments on commit d9344f2

Please sign in to comment.