all repos — fixyoutube-go @ d9344f281e4e23360836847844572d3c9242741e

A better way to embed YouTube videos everywhere (inspired by FixTweet).

minor code cleanup
Marco Andronaco andronacomarco@gmail.com
Sat, 13 Jan 2024 12:16:22 +0100
commit

d9344f281e4e23360836847844572d3c9242741e

parent

fae2afdff695e4d35f8d1f87d38c94badab89425

2 files changed, 1 insertions(+), 10 deletions(-)

jump to
M invidious/api.goinvidious/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.goinvidious/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) {