-
Notifications
You must be signed in to change notification settings - Fork 0
/
csn.go
51 lines (43 loc) · 891 Bytes
/
csn.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
/*
* Copyright (C) 2023 l4rzy
* MIT License
*/
package csn
import (
"net/http"
"time"
)
const (
VerMajor = 0
VerMinor = 1
VerPatch = 4
)
var (
csnClient *http.Client
)
// search options
const (
KindMusic = 1 << 1
KindVideo = 1 << 2
KindArtist = 1 << 3
KindAlbum = 1 << 4
KindPlaylist = 1 << 5
)
// music quality
const (
MusicQual32 = 1 << 1
MusicQual128 = 1 << 2
MusicQual320 = 1 << 3
MusicQual500 = 1 << 4
MusicQual1000 = 1 << 5
MusicQualAll = 62
)
const (
Home = "https://chiasenhac.vn/"
SearchNewFmt = "https://chiasenhac.vn/search/real?q=%v&type=json&rows=%v&view_all=true"
SearchFmt = "http://search.chiasenhac.vn/api/search.php?s=%v&code=csn22052018&per_page=%v"
MusicInfoFmt = "http://old.chiasenhac.vn/api/listen.php?code=csn22052018&return=json&m=%v"
)
func init() {
csnClient = &http.Client{Timeout: 10 * time.Second}
}