@mr-quin/dango-manifests 0.8.3 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -127,7 +127,7 @@ The smoke fetcher keeps a per-host cookie jar so bilibili's anti-bot wall lets u
127
127
  2. Capture representative responses from the source's API to `src/__tests__/fixtures/`.
128
128
  3. Write a per-manifest test that:
129
129
  - Parses the manifest against `zManifest` (catches schema drift)
130
- - Runs each pipeline with a mocked `FetchLike` against the captured fixtures
130
+ - Runs each pipeline with a mocked `FetchLike` against the captured fixtures, through `createContractRunner` so the output is also checked against the engine's row schemas
131
131
  - Asserts the canonical shape the engine emits
132
132
  4. (Optional) Add a section to `scripts/smoke-test.ts` to exercise the new manifest against a live endpoint.
133
133
 
package/catalog.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "packageVersion": "0.8.3",
2
+ "packageVersion": "0.9.1",
3
3
  "manifests": [
4
4
  {
5
5
  "id": "aiyifan",
@@ -18,14 +18,14 @@
18
18
  {
19
19
  "id": "bilibili",
20
20
  "name": "Bilibili",
21
- "version": "0.6.0",
21
+ "version": "0.7.0",
22
22
  "apiVersion": 1,
23
23
  "file": "src/manifests/bilibili.json"
24
24
  },
25
25
  {
26
26
  "id": "dandanplay",
27
27
  "name": "DanDanPlay",
28
- "version": "0.5.0",
28
+ "version": "0.6.0",
29
29
  "apiVersion": 1,
30
30
  "file": "src/manifests/dandanplay.json"
31
31
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mr-quin/dango-manifests",
3
- "version": "0.8.3",
3
+ "version": "0.9.1",
4
4
  "description": "Built-in dango manifests for danmaku sources",
5
5
  "author": "Mr-Quin",
6
6
  "license": "MIT",
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "aiyifan",
5
4
  "name": "Aiyifan",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "bahamut",
5
4
  "name": "Bahamut",
6
5
  "locales": {
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "bilibili",
5
4
  "name": "Bilibili",
6
5
  "locales": {
7
6
  "zh-CN": {
8
7
  "name": "B站",
9
8
  "configSchema.properties.danmakuFormat.title": "弹幕格式",
10
- "configSchema.properties.danmakuFormat.description": "xml 是旧版接口,最多约 3000 条弹幕;protobuf 分页返回全部弹幕",
9
+ "configSchema.properties.danmakuFormat.oneOf.0.title": "Protobuf:获取全部弹幕,视频越长越慢",
10
+ "configSchema.properties.danmakuFormat.oneOf.1.title": "XML:获取较快,最多约 3000 条弹幕",
11
11
  "cookieSet.title": "登录B站",
12
12
  "configSchema.properties.includeUserUploads.title": "包含用户投稿",
13
13
  "configSchema.properties.includeUserUploads.description": "搜索时一并返回用户投稿(UGC)视频,而不仅是官方番剧库。默认关闭:UGC 结果较杂,且多为切片。"
14
14
  }
15
15
  },
16
- "version": "0.6.0",
16
+ "version": "0.7.0",
17
17
  "hosts": ["api.bilibili.com"],
18
18
  "urlMatch": [
19
19
  {
@@ -39,9 +39,18 @@
39
39
  "danmakuFormat": {
40
40
  "type": "string",
41
41
  "enum": ["xml", "protobuf"],
42
+ "oneOf": [
43
+ {
44
+ "const": "protobuf",
45
+ "title": "Protobuf: every comment, slower for long videos"
46
+ },
47
+ {
48
+ "const": "xml",
49
+ "title": "XML: faster, capped at about 3000 comments"
50
+ }
51
+ ],
42
52
  "default": "protobuf",
43
- "title": "Danmaku format",
44
- "description": "xml is the legacy endpoint capped at ~3000 comments; protobuf paginates and returns everything"
53
+ "title": "Danmaku format"
45
54
  },
46
55
  "includeUserUploads": {
47
56
  "type": "boolean",
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": ["baseUrl"],
4
3
  "id": "dandanplay",
5
4
  "name": "DanDanPlay",
6
5
  "locales": {
7
6
  "zh-CN": {
8
7
  "name": "弹弹play",
9
8
  "configSchema.properties.baseUrl.title": "基础地址",
10
- "configSchema.properties.baseUrl.description": "弹弹play(或兼容)API 的根地址。默认为官方 https://api.dandanplay.net。指向代理或自建服务器即可覆盖。",
9
+ "configSchema.properties.baseUrl.description": "弹弹play 兼容 API 的根地址,例如代理或自建服务器。留空则使用官方 https://api.dandanplay.net,此时需要填写应用 ID 和应用密钥。",
11
10
  "configSchema.properties.appId.title": "应用 ID",
12
11
  "configSchema.properties.appId.description": "弹弹play 开放平台的 App ID。使用官方 API 时需填写;由代理在服务端签名时可留空。",
13
12
  "configSchema.properties.appSecret.title": "应用密钥",
@@ -18,19 +17,25 @@
18
17
  "configSchema.properties.auth.properties.headers.title": "请求头",
19
18
  "configSchema.properties.auth.properties.headers.items.properties.key.title": "请求头名称",
20
19
  "configSchema.properties.auth.properties.headers.items.properties.value.title": "值",
21
- "configSchema.properties.chConvert.title": "中文转换",
22
- "configSchema.properties.chConvert.description": "0 = 不转换,1 = 转为简体,2 = 转为繁体"
20
+ "configSchema.properties.chConvert.title": "简繁转换",
21
+ "configSchema.properties.chConvert.oneOf.0.title": "不转换",
22
+ "configSchema.properties.chConvert.oneOf.1.title": "转换成简体",
23
+ "configSchema.properties.chConvert.oneOf.2.title": "转换成繁体"
23
24
  }
24
25
  },
25
- "version": "0.5.0",
26
+ "version": "0.6.0",
26
27
  "hosts": ["*"],
27
28
  "configSchema": {
28
29
  "type": "object",
30
+ "anyOf": [
31
+ { "required": ["baseUrl"] },
32
+ { "required": ["appId", "appSecret"] }
33
+ ],
29
34
  "properties": {
30
35
  "baseUrl": {
31
36
  "type": "string",
32
37
  "title": "Base URL",
33
- "description": "Root of the DanDanPlay (or compatible) API. Defaults to the official https://api.dandanplay.net. Point this at a proxy or self-hosted server to override."
38
+ "description": "Root of a DanDanPlay-compatible API, such as a proxy or a self-hosted server. Leave empty to call the official https://api.dandanplay.net, which needs an App ID and App Secret."
34
39
  },
35
40
  "appId": {
36
41
  "type": "string",
@@ -69,9 +74,13 @@
69
74
  "chConvert": {
70
75
  "type": "integer",
71
76
  "enum": [0, 1, 2],
77
+ "oneOf": [
78
+ { "const": 0, "title": "No conversion" },
79
+ { "const": 1, "title": "Convert to simplified" },
80
+ { "const": 2, "title": "Convert to traditional" }
81
+ ],
72
82
  "default": 0,
73
- "title": "Chinese conversion",
74
- "description": "0 = no conversion, 1 = convert to simplified, 2 = convert to traditional"
83
+ "title": "Chinese conversion"
75
84
  }
76
85
  }
77
86
  },
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "hanjutv",
5
4
  "name": "Hanjutv",
6
5
  "locales": {
@@ -38,7 +37,7 @@
38
37
  }
39
38
  }
40
39
  ],
41
- "output": "($uid := 'DA000000000000000000'; $exists(search.data) and search.data != '' ? ($key := $exists(search.key) and search.key != '' ? search.key : $md5($uid & $string(search.ts)); $mix := $md5($key & '34F9Q53w/HJW8E6Q'); $aesKey := $base64Encode($substring($mix, 0, 16)); $aesIv := $base64Encode($substring($mix, 16, 16)); $raw := $aesCbcDecrypt(search.data, $aesKey, $aesIv, 'none'); $clean := $replace($trim($raw), /[\\u0000-\\u001f\\u007f-\\u009f]/, ''); $decoded := $jsonParse($clean); $list := $exists($decoded.seriesData.seriesList) ? $decoded.seriesData.seriesList : $decoded.seriesList; [$list.{ 'providerIds': { 'sid': $string(sid) }, 'indexedId': $string(sid), 'title': name, 'type': 'tvseries', 'typeDescription': '韩剧', 'imageUrl': $exists(image.thumb) ? image.thumb : '', 'episodeCount': 0, 'year': null }]) : [])"
40
+ "output": "($uid := 'DA000000000000000000'; $exists(search.data) and search.data != '' ? ($key := $exists(search.key) and search.key != '' ? search.key : $md5($uid & $string(search.ts)); $mix := $md5($key & '34F9Q53w/HJW8E6Q'); $aesKey := $base64Encode($substring($mix, 0, 16)); $aesIv := $base64Encode($substring($mix, 16, 16)); $raw := $aesCbcDecrypt(search.data, $aesKey, $aesIv, 'none'); $clean := $replace($trim($raw), /[\\u0000-\\u001f\\u007f-\\u009f]/, ''); $decoded := $jsonParse($clean); $list := $exists($decoded.seriesData.seriesList) ? $decoded.seriesData.seriesList : $decoded.seriesList; [$list.{ 'providerIds': { 'sid': $string(sid) }, 'indexedId': $string(sid), 'title': name, 'type': 'tvseries', 'typeDescription': '韩剧', 'imageUrl': $exists(image.thumb) ? image.thumb : '', 'episodeCount': 0 }]) : [])"
42
41
  },
43
42
  "episodes": {
44
43
  "inputs": ["sid"],
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "iqiyi",
5
4
  "name": "iQIYI",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "maiduidui",
5
4
  "name": "Maiduidui",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "mango",
5
4
  "name": "Mango TV",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "migu",
5
4
  "name": "Migu Video",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "renren",
5
4
  "name": "Renren",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "sohu",
5
4
  "name": "Sohu",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "tencent",
5
4
  "name": "Tencent Video",
6
5
  "locales": {
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "apiVersion": 1,
3
- "identityFields": [],
4
3
  "id": "youku",
5
4
  "name": "Youku",
6
5
  "locales": {