diff --git a/fetch.go b/fetch.go index c970c4e..bd4e758 100644 --- a/fetch.go +++ b/fetch.go @@ -1,11 +1,11 @@ package main import ( + "bytes" + "encoding/json" "io" "log" - "bytes" "net/http" - "encoding/json" ) func Fetch(path string, data []byte) (string, int, error) { @@ -88,4 +88,4 @@ func FetchNext(id string) (string, int) { log.Println(status) log.Println(res) -}*/ \ No newline at end of file +}*/ diff --git a/parser.go b/parser.go index 6fa3f5a..c2ea764 100644 --- a/parser.go +++ b/parser.go @@ -150,9 +150,9 @@ func GetNextSongs(n gjson.Result) []Item { j := v.Get("playlistPanelVideoRenderer") r = append(r, Item{ - Id: j.Get("navigationEndpoint.watchEndpoint.videoId").String(), - Title: RunsText(j.Get("title")), - Sub: j.Get("longBylineText.runs.2.text").String(), + Id: j.Get("navigationEndpoint.watchEndpoint.videoId").String(), + Title: RunsText(j.Get("title")), + Sub: j.Get("longBylineText.runs.2.text").String(), Thumbnails: GetThumbnails(j.Get("thumbnail.thumbnails")), }) }() @@ -210,7 +210,7 @@ func ParseNext(raw string) (string, error) { val := Next{ MediaSession: MediaSession{ - Album: RunsText(m.Get("album")), + Album: RunsText(m.Get("album")), Thumbnails: GetThumbnails(m.Get("thumbnailDetails.thumbnails")), }, Songs: GetNextSongs(n.Get("contents")), @@ -222,4 +222,4 @@ func ParseNext(raw string) (string, error) { } return string(res), nil -} \ No newline at end of file +} diff --git a/structs.go b/structs.go index 2085e04..635c9aa 100644 --- a/structs.go +++ b/structs.go @@ -1,6 +1,5 @@ package main - /* Parsers */ type Thumbnail struct { Height int64 `json:"height"` @@ -34,15 +33,14 @@ type Artist struct { type MediaSession struct { Thumbnails []Thumbnail `json:"thumbnails"` - Album string `json:"album"` + Album string `json:"album"` } type Next struct { - Songs []Item `json:"songs"` + Songs []Item `json:"songs"` MediaSession MediaSession `json:"mediaSession"` } - /* Structs and Types */ type Client struct { Name string `json:"clientName"` diff --git a/types.go b/types.go index 42f8834..a3a2f63 100644 --- a/types.go +++ b/types.go @@ -27,7 +27,7 @@ func GetTypeNext(id string) NextData { Context: BaseContext, Panel: true, Audio: true, - Tuner: "AUTOMIX_SETTING_NORMAL", + Tuner: "AUTOMIX_SETTING_NORMAL", MusicConfig: WatchMusicConfig{ Panel: true, Type: "MUSIC_VIDEO_TYPE_ATV",