@mr-quin/dango-manifests 0.1.0 → 0.2.0

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.
@@ -0,0 +1,114 @@
1
+ {
2
+ "apiVersion": 1,
3
+ "id": "builtin:youku",
4
+ "name": "Youku",
5
+ "version": "0.2.0",
6
+ "hosts": [
7
+ "search.youku.com",
8
+ "openapi.youku.com",
9
+ "acs.youku.com",
10
+ "log.mmstat.com"
11
+ ],
12
+ "search": {
13
+ "inputs": ["q"],
14
+ "steps": [
15
+ {
16
+ "type": "http",
17
+ "id": "search",
18
+ "request": {
19
+ "method": "GET",
20
+ "url": "'https://search.youku.com/api/search'",
21
+ "query": "{ 'keyword': q, 'site': '1', 'categories': '0', 'ftype': '0', 'ob': '0', 'pg': '1' }",
22
+ "rewriteHeaders": { "Referer": "'https://www.youku.com/'" }
23
+ }
24
+ }
25
+ ],
26
+ "output": "[search.pageComponentList[commonData.isYouku=1 or commonData.hasYouku=1].commonData.($parts := $split(feature, ' · '); { 'providerIds': { 'showId': showId }, 'indexedId': showId, 'title': $replace(titleDTO.displayName, /<[^>]+>/, '') ~> $trim, 'type': $trim($parts[1]), 'year': $number($regexExtract(feature, '([12][890][0-9][0-9])')), 'imageUrl': posterDTO.vThumbUrl, 'episodeCount': episodeTotal })[providerIds.showId]]"
27
+ },
28
+ "episodes": {
29
+ "inputs": ["showId"],
30
+ "steps": [
31
+ {
32
+ "type": "http",
33
+ "id": "page",
34
+ "request": {
35
+ "method": "GET",
36
+ "url": "'https://openapi.youku.com/v2/shows/videos.json'",
37
+ "query": "{ 'client_id': '53e6cc67237fc59a', 'package': 'com.huawei.hwvplayer.youku', 'ext': 'show', 'show_id': showId, 'page': '1', 'count': '100' }"
38
+ }
39
+ }
40
+ ],
41
+ "output": "[page.videos.{ 'providerIds': { 'vid': id }, 'indexedId': id, 'title': title, 'episodeNumber': $number(stage), 'imageUrl': thumbnail_v2 }]"
42
+ },
43
+ "danmaku": {
44
+ "inputs": ["vid"],
45
+ "steps": [
46
+ {
47
+ "type": "http",
48
+ "id": "info",
49
+ "request": {
50
+ "method": "GET",
51
+ "url": "'https://openapi.youku.com/v2/videos/show.json'",
52
+ "query": "{ 'client_id': '53e6cc67237fc59a', 'video_id': vid, 'package': 'com.huawei.hwvplayer.youku', 'ext': 'show' }"
53
+ },
54
+ "extract": {
55
+ "durationSec": "$number(duration)"
56
+ }
57
+ },
58
+ {
59
+ "type": "http",
60
+ "id": "cna",
61
+ "request": {
62
+ "method": "GET",
63
+ "url": "'https://log.mmstat.com/eg.js'",
64
+ "format": "text",
65
+ "credentials": "include"
66
+ },
67
+ "extractHeaders": {
68
+ "value": "$replace(`etag`, /^\"|\"$/, '')"
69
+ }
70
+ },
71
+ {
72
+ "type": "http",
73
+ "id": "tkEnc",
74
+ "request": {
75
+ "method": "GET",
76
+ "url": "'https://acs.youku.com/h5/mtop.com.youku.aplatform.weakget/1.0/'",
77
+ "query": "{ 'jsv': '2.5.1', 'appKey': '24679788' }",
78
+ "credentials": "include"
79
+ },
80
+ "extractHeaders": {
81
+ "tk": "$regexExtract(`set-cookie`, '_m_h5_tk=([^;]+)')"
82
+ }
83
+ },
84
+ {
85
+ "type": "assign",
86
+ "id": "prep",
87
+ "values": {
88
+ "iters": "$map($range(0, $floor(info.durationSec / 60) + 1), function($mat) { ($t := $millis(); $msg := { 'ctime': $t, 'ctype': 10004, 'cver': 'v1.0', 'guid': cna.value, 'mat': $mat, 'mcount': 1, 'pid': 0, 'sver': '3.1.0', 'type': 1, 'vid': vid }; $msgB64 := $base64Encode($stringify($msg)); $innerSign := $md5($msgB64 & 'MkmC9SoIw6xCkSKHhJ7b5D2r51kBiREr'); $data := $stringify($merge([$msg, { 'msg': $msgB64, 'sign': $innerSign }])); $outerSign := $md5($substring(tkEnc.tk, 0, 32) & '&' & $string($t) & '&24679788&' & $data); { 'url': 'https://acs.youku.com/h5/mopen.youku.danmu.list/1.0/?' & $sortedQueryString({ 'jsv': '2.5.6', 'appKey': '24679788', 't': $string($t), 'sign': $outerSign, 'api': 'mopen.youku.danmu.list', 'v': '1.0', 'type': 'originaljson', 'dataType': 'jsonp', 'timeout': '20000', 'jsonpIncPrefix': 'utility' }), 'body': 'data=' & $encodeUrlComponent($data) }) })"
89
+ }
90
+ },
91
+ {
92
+ "type": "forEach",
93
+ "id": "segments",
94
+ "in": "prep.iters",
95
+ "as": "iter",
96
+ "concurrency": 4,
97
+ "throttleMs": 100,
98
+ "request": {
99
+ "method": "POST",
100
+ "url": "iter.url",
101
+ "headers": { "Content-Type": "'application/x-www-form-urlencoded'" },
102
+ "body": "iter.body",
103
+ "credentials": "include",
104
+ "rewriteHeaders": { "Referer": "'https://v.youku.com'" }
105
+ },
106
+ "extract": {
107
+ "items": "$jsonParse(data.result).data.result"
108
+ },
109
+ "collect": "items"
110
+ }
111
+ ],
112
+ "output": "[segments.{ 'p': $string($number(playat) / 1000) & ',1,16777215,' & $string(uid), 'm': content }]"
113
+ }
114
+ }
@@ -1,96 +0,0 @@
1
- {
2
- "apiVersion": 1,
3
- "id": "builtin:ddp-compat",
4
- "name": "DanDanPlay Compatible",
5
- "version": "1.0.0",
6
- "hosts": ["*"],
7
- "configSchema": {
8
- "type": "object",
9
- "required": ["baseUrl"],
10
- "properties": {
11
- "baseUrl": {
12
- "type": "string",
13
- "title": "Base URL",
14
- "description": "Root of the DanDanPlay-compatible API (e.g. https://my-server.com)"
15
- },
16
- "chConvert": {
17
- "type": "integer",
18
- "enum": [0, 1, 2],
19
- "default": 0,
20
- "title": "Chinese conversion",
21
- "description": "0 = no conversion, 1 = convert to simplified, 2 = convert to traditional"
22
- },
23
- "auth": {
24
- "type": "object",
25
- "title": "Authentication",
26
- "description": "Custom request headers (e.g. Authorization) sent on every request",
27
- "properties": {
28
- "enabled": {
29
- "type": "boolean",
30
- "default": false,
31
- "title": "Enable auth headers"
32
- },
33
- "headers": {
34
- "type": "array",
35
- "title": "Headers",
36
- "items": {
37
- "type": "object",
38
- "required": ["key", "value"],
39
- "properties": {
40
- "key": { "type": "string", "title": "Header name" },
41
- "value": { "type": "string", "title": "Value" }
42
- }
43
- }
44
- }
45
- }
46
- }
47
- }
48
- },
49
- "search": {
50
- "inputs": ["q", "baseUrl", "auth"],
51
- "steps": [
52
- {
53
- "type": "http",
54
- "id": "search",
55
- "request": {
56
- "method": "GET",
57
- "url": "$replace(baseUrl, /\\/$/, '') & '/v2/search/anime'",
58
- "query": "{ 'keyword': q }",
59
- "headers": "$merge((auth.enabled and auth.headers ? auth.headers : []).{ key: value })"
60
- }
61
- }
62
- ],
63
- "output": "[search.animes.{ 'providerIds': { 'animeId': animeId, 'bangumiId': bangumiId }, 'indexedId': $string(animeId), 'title': animeTitle, 'type': type, 'typeDescription': typeDescription, 'imageUrl': imageUrl, 'episodeCount': episodeCount, 'year': $number($substringBefore(startDate, '-')) }]"
64
- },
65
- "episodes": {
66
- "inputs": ["bangumiId", "baseUrl", "auth"],
67
- "steps": [
68
- {
69
- "type": "http",
70
- "id": "bangumi",
71
- "request": {
72
- "method": "GET",
73
- "url": "$replace(baseUrl, /\\/$/, '') & '/v2/bangumi/' & $string(bangumiId)",
74
- "headers": "$merge((auth.enabled and auth.headers ? auth.headers : []).{ key: value })"
75
- }
76
- }
77
- ],
78
- "output": "[bangumi.bangumi.episodes.{ 'providerIds': { 'episodeId': episodeId, 'animeId': %.animeId, 'bangumiId': %.bangumiId }, 'indexedId': $string(episodeId), 'title': episodeTitle, 'episodeNumber': episodeNumber }]"
79
- },
80
- "danmaku": {
81
- "inputs": ["episodeId", "baseUrl", "auth"],
82
- "steps": [
83
- {
84
- "type": "http",
85
- "id": "comments",
86
- "request": {
87
- "method": "GET",
88
- "url": "$replace(baseUrl, /\\/$/, '') & '/v2/comment/' & $string(episodeId)",
89
- "query": "{ 'withRelated': 'true', 'chConvert': chConvert ? $string(chConvert) : undefined }",
90
- "headers": "$merge((auth.enabled and auth.headers ? auth.headers : []).{ key: value })"
91
- }
92
- }
93
- ],
94
- "output": "[comments.comments]"
95
- }
96
- }