-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathacr.go
101 lines (97 loc) · 2.42 KB
/
acr.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package main
type ACRRecognitionResult struct {
Metadata struct {
Music []struct {
ExternalIds struct {
} `json:"external_ids"`
ExternalMetadata struct {
Youtube struct {
Vid string `json:"vid"`
} `json:"youtube"`
Deezer struct {
Album struct {
Name string `json:"name"`
} `json:"album"`
Track struct {
ID string `json:"id"`
Name string `json:"name"`
} `json:"track"`
Artists []struct {
Name string `json:"name"`
} `json:"artists"`
} `json:"deezer"`
Spotify struct {
Album struct {
Name string `json:"name"`
} `json:"album"`
Track struct {
ID string `json:"id"`
Name string `json:"name"`
} `json:"track"`
Artists []struct {
Name string `json:"name"`
} `json:"artists"`
} `json:"spotify"`
} `json:"external_metadata"`
ResultFrom int `json:"result_from"`
Album struct {
Name string `json:"name"`
} `json:"album"`
Artists []struct {
Name string `json:"name"`
} `json:"artists"`
Genres []struct {
Name string `json:"name"`
} `json:"genres"`
DurationMs int `json:"duration_ms"`
Score int `json:"score"`
Title string `json:"title"`
PlayOffsetMs int `json:"play_offset_ms"`
ReleaseDate string `json:"release_date"`
Label string `json:"label"`
Acrid string `json:"acrid"`
} `json:"music"`
TimestampUtc string `json:"timestamp_utc"`
} `json:"metadata"`
ResultType int `json:"result_type"`
Status struct {
Version string `json:"version"`
Code int `json:"code"`
Msg string `json:"msg"`
} `json:"status"`
CostTime float64 `json:"cost_time"`
}
type RecognizedMetadata struct {
// Title from the recognized song
Title string
// Album from the recognized song
Album string
// Artist from the recognized song
Artist string
// Respective ACR ID from the recognized song
AcrID string
// URL to Audd.io from the recognized song
Url string
// Respective links to known streaming platforms
Links MetadataLinks
// Respective IDs to known streaming platforms
IDs MetadataIDs
// Provider of the recognition (ACR, Audd.io, Shazam)
Provider string
}
type MetadataLinks struct {
// Deezer link
Deezer string
// Spotify link
Spotify string
// Apple Music link
YouTube string
}
type MetadataIDs struct {
// Deezer ID
Deezer string
// Spotify ID
Spotify string
// YouTube ID
YouTube string
}