MCPcopy Create free account
hub / github.com/develop202/migu_video / cateList

Function cateList

utils/fetchList.js:95–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93
94// 获取分类集合
95async function cateList() {
96 const resp = await fetchUrl("https://program-sc.miguvideo.com/live/v2/tv-data/1ff892f2b5ab4a79be6e25b69d2f5d05")
97 if (!resp || !resp.body) return []
98 let liveList = resp.body.liveList
99 // 热门内容重复
100 liveList = liveList.filter(item => {
101 return item.name != "热门"
102 })
103
104 // 央视作为首个分类
105 liveList.sort((a, b) => {
106 if (a.name === "央视") return -1;
107 if (b.name === "央视") return 1
108 return 0
109 })
110
111 return liveList
112}
113
114// 所有数据
115async function dataList() {

Callers 1

dataListFunction · 0.85

Calls 1

fetchUrlFunction · 0.90

Tested by

no test coverage detected