mirror of
https://codeberg.org/Hyperpipe/hyperpipe-backend
synced 2024-12-06 19:26:30 +01:00
update deps. and fmt
This commit is contained in:
+19
-19
@@ -1,30 +1,30 @@
|
||||
package lib
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"codeberg.org/Hyperpipe/hyperpipe-backend/utils"
|
||||
"github.com/tidwall/gjson"
|
||||
"net/url"
|
||||
|
||||
"codeberg.org/Hyperpipe/hyperpipe-backend/utils"
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
func GetAlbumUrl(id string) (map[string]string, int) {
|
||||
|
||||
ctx := utils.TypeBrowsePage(id, "album")
|
||||
raw, status := utils.FetchBrowse(ctx)
|
||||
ctx := utils.TypeBrowsePage(id, "album")
|
||||
raw, status := utils.FetchBrowse(ctx)
|
||||
|
||||
uri := gjson.Parse(raw).Get(
|
||||
"microformat.microformatDataRenderer.urlCanonical",
|
||||
).String()
|
||||
uri := gjson.Parse(raw).Get(
|
||||
"microformat.microformatDataRenderer.urlCanonical",
|
||||
).String()
|
||||
|
||||
u, err := url.Parse(uri)
|
||||
if err != nil {
|
||||
return map[string]string{
|
||||
"error": "500",
|
||||
"message": "failed to parse url",
|
||||
}, 500
|
||||
}
|
||||
u, err := url.Parse(uri)
|
||||
if err != nil {
|
||||
return map[string]string{
|
||||
"error": "500",
|
||||
"message": "failed to parse url",
|
||||
}, 500
|
||||
}
|
||||
|
||||
return map[string]string{
|
||||
"id": u.Query().Get("list"),
|
||||
}, status
|
||||
return map[string]string{
|
||||
"id": u.Query().Get("list"),
|
||||
}, status
|
||||
}
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ func GetArtistNext(id, params, ct, v string) (ArtistNext, int) {
|
||||
if id == "" || params == "" || ct == "" || v == "" {
|
||||
return ArtistNext{}, 404
|
||||
}
|
||||
|
||||
|
||||
context := utils.TypeBrowse(id, params, []string{ct, v})
|
||||
|
||||
raw, status := utils.FetchBrowse(context)
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ type MediaSession struct {
|
||||
}
|
||||
|
||||
type Next struct {
|
||||
Err error `json:"error"`
|
||||
Err error `json:"error,omitempty"`
|
||||
LyricsId string `json:"lyricsId"`
|
||||
Songs []Item `json:"songs"`
|
||||
MediaSession MediaSession `json:"mediaSession"`
|
||||
|
||||
Reference in New Issue
Block a user