-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtgshou.js
95 lines (85 loc) · 1.68 KB
/
tgshou.js
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
let appConfig = {
ver: 1,
title: 'tg搜索|夸克',
site: 'http://192.168.152.134:8080/video/yunpanshare',
tabs: [{
name: '搜索',
ui: 1,
ext: {
id: '',
},
}]
}
async function getConfig() {
let config = appConfig
return jsonify(config)
}
async function getCards() {
return jsonify({
list: [],
})
}
async function getTracks(ext) {
ext = argsify(ext)
let tracks = []
let url = ext.url
const { data } = await $fetch.get(url, {
headers: {
'token': '40da2be0d7ded05f',
},
})
argsify(data).list.forEach(e => {
const title = e.vod_name
const panShareUrl = e.vod_content.match(/链接:(https?:\/\/pan\.quark\.cn\/s\/\w+)\n/)[1]
tracks.push({
name: title,
pan: panShareUrl,
})
})
return jsonify({
list: [
{
title: '默认分组',
tracks,
}
],
})
}
async function getPlayinfo(ext) {
return jsonify({ urls: [] })
}
async function search(ext) {
ext = argsify(ext)
let cards = []
let page = ext.page || 1
if (page > 1) {
return jsonify({
list: [],
})
}
let text = encodeURIComponent(ext.text)
let url = `${appConfig.site}?wd=${text}&platform=ysc`
const { data } = await $fetch.get(url, {
headers: {
'token': '40da2be0d7ded05f',
},
})
argsify(data).list.forEach(e => {
const href = e.vod_id.toString()
const title = e.vod_name
const cover = e.vod_pic
const remarks = e.vod_remarks
cards.push({
vod_id: href,
vod_name: title,
vod_pic: cover,
vod_remarks: remarks,
ext: {
url: `${appConfig.site}?ac=detail&ids=${href}&platform=ysc`,
},
})
})
return jsonify({
list: cards,
})
}