azot 5.0.0-alpha.20 → 5.0.0-alpha.21
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/dist/azot.mjs +1 -1
- package/dist/{context--_LoC7SX.mjs → context-Bkk33DH6.mjs} +1 -1
- package/dist/context.mjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/package.json +1 -1
- package/dist/builtins/instagram/instagram.cjs +0 -121
- package/dist/builtins/ntv/ntv.cjs +0 -104
- package/dist/builtins/rbc/rbc.cjs +0 -37
- package/dist/builtins/rutube/rutube.cjs +0 -92
- package/dist/builtins/soundcloud/soundcloud.cjs +0 -94
- package/dist/builtins/tiktok/tiktok.cjs +0 -76
- package/dist/builtins/virtualroom/virtualroom.cjs +0 -46
- package/dist/builtins/vk/vk.cjs +0 -122
- package/dist/builtins/weibo/weibo.cjs +0 -64
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//#region src/extensions-api/main.ts
|
|
2
|
-
const runtimeContext = Azot ?? Streamyx ?? {};
|
|
3
|
-
if (runtimeContext) {
|
|
4
|
-
if (!runtimeContext.defineExtension) runtimeContext.defineExtension = (extension) => extension;
|
|
5
|
-
}
|
|
6
|
-
const defineExtension = runtimeContext.defineExtension;
|
|
7
|
-
runtimeContext.version;
|
|
8
|
-
runtimeContext.sleep;
|
|
9
|
-
runtimeContext.input;
|
|
10
|
-
runtimeContext.prompt;
|
|
11
|
-
runtimeContext.notify;
|
|
12
|
-
runtimeContext.confirm;
|
|
13
|
-
runtimeContext.ask;
|
|
14
|
-
runtimeContext.utils;
|
|
15
|
-
const Input = runtimeContext.Input;
|
|
16
|
-
const UrlSource = runtimeContext.UrlSource;
|
|
17
|
-
runtimeContext.ALL_FORMATS;
|
|
18
|
-
runtimeContext.DASH;
|
|
19
|
-
runtimeContext.DASH_FORMATS;
|
|
20
|
-
runtimeContext.HLS;
|
|
21
|
-
runtimeContext.HLS_FORMATS;
|
|
22
|
-
runtimeContext.MP4;
|
|
23
|
-
runtimeContext.MP3;
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/builtins/virtualroom/virtualroom.ts
|
|
26
|
-
var virtualroom_default = defineExtension({ async resolveEntries(url) {
|
|
27
|
-
const recordId = new URL(url).searchParams.get("recordId");
|
|
28
|
-
if (!recordId) {
|
|
29
|
-
console.error("Could not extract VirtualRoom recordId.");
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
const info = await fetch(`https://mv1.virtualroom.ru/vr/player/records/${recordId}/info`).then((response) => response.ok ? response.json() : null).catch(() => null);
|
|
33
|
-
const events = await fetch(`https://mv1.virtualroom.ru/vr/player/records/${recordId}/events`).then((response) => response.ok ? response.json() : null).catch(() => null);
|
|
34
|
-
const roomName = info?.data?.roomParameters?.name ?? "VirtualRoom";
|
|
35
|
-
return (events?.data?.translations ?? []).filter((translation) => !!translation.url).map((translation) => ({
|
|
36
|
-
title: [
|
|
37
|
-
roomName,
|
|
38
|
-
translation.type,
|
|
39
|
-
translation.source,
|
|
40
|
-
translation.start
|
|
41
|
-
].filter(Boolean).join(" "),
|
|
42
|
-
input: new Input({ source: new UrlSource(translation.url) })
|
|
43
|
-
}));
|
|
44
|
-
} });
|
|
45
|
-
//#endregion
|
|
46
|
-
module.exports = virtualroom_default;
|
package/dist/builtins/vk/vk.cjs
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
//#region src/extensions-api/main.ts
|
|
2
|
-
const runtimeContext = Azot ?? Streamyx ?? {};
|
|
3
|
-
if (runtimeContext) {
|
|
4
|
-
if (!runtimeContext.defineExtension) runtimeContext.defineExtension = (extension) => extension;
|
|
5
|
-
}
|
|
6
|
-
const defineExtension = runtimeContext.defineExtension;
|
|
7
|
-
runtimeContext.version;
|
|
8
|
-
runtimeContext.sleep;
|
|
9
|
-
runtimeContext.input;
|
|
10
|
-
runtimeContext.prompt;
|
|
11
|
-
runtimeContext.notify;
|
|
12
|
-
runtimeContext.confirm;
|
|
13
|
-
runtimeContext.ask;
|
|
14
|
-
runtimeContext.utils;
|
|
15
|
-
const Input = runtimeContext.Input;
|
|
16
|
-
const UrlSource = runtimeContext.UrlSource;
|
|
17
|
-
runtimeContext.ALL_FORMATS;
|
|
18
|
-
runtimeContext.DASH;
|
|
19
|
-
runtimeContext.DASH_FORMATS;
|
|
20
|
-
runtimeContext.HLS;
|
|
21
|
-
runtimeContext.HLS_FORMATS;
|
|
22
|
-
runtimeContext.MP4;
|
|
23
|
-
runtimeContext.MP3;
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/builtins/vk/vk.ts
|
|
26
|
-
const resolutions = [
|
|
27
|
-
"2160",
|
|
28
|
-
"1440",
|
|
29
|
-
"1080",
|
|
30
|
-
"720",
|
|
31
|
-
"480",
|
|
32
|
-
"360",
|
|
33
|
-
"240",
|
|
34
|
-
"144"
|
|
35
|
-
];
|
|
36
|
-
const parseVideoIds = (url) => {
|
|
37
|
-
const match = url.match(/video-(\d+)_(\d+)/);
|
|
38
|
-
if (!match) return null;
|
|
39
|
-
return {
|
|
40
|
-
ownerId: match[1],
|
|
41
|
-
videoId: match[2]
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
const findPlayerPayload = (payload) => {
|
|
45
|
-
if (!payload) return null;
|
|
46
|
-
for (const item of payload) {
|
|
47
|
-
if (!Array.isArray(item)) continue;
|
|
48
|
-
for (const nested of item) if (nested && typeof nested === "object" && "player" in nested) return nested;
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
51
|
-
};
|
|
52
|
-
const selectQuality = (params, options) => {
|
|
53
|
-
const selectedQuality = options.videoQuality?.replace("p", "").trim();
|
|
54
|
-
const available = resolutions.filter((resolution) => !!params[`url${resolution}`]);
|
|
55
|
-
if (!available.length) return null;
|
|
56
|
-
if (selectedQuality && available.includes(selectedQuality)) return selectedQuality;
|
|
57
|
-
return available[0];
|
|
58
|
-
};
|
|
59
|
-
var vk_default = defineExtension({ async resolveEntries(url, options) {
|
|
60
|
-
const videoIds = parseVideoIds(url);
|
|
61
|
-
if (!videoIds) {
|
|
62
|
-
console.error("Could not extract VK video identifiers");
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
const response = await fetch("https://vkvideo.ru/al_video.php?act=show", {
|
|
66
|
-
method: "POST",
|
|
67
|
-
headers: {
|
|
68
|
-
"content-type": "application/x-www-form-urlencoded; charset=utf-8",
|
|
69
|
-
accept: "*/*",
|
|
70
|
-
"accept-language": "ru-RU,ru;q=0.9",
|
|
71
|
-
"sec-ch-ua": "\"Chromium\";v=\"130\", \"Google Chrome\";v=\"130\", \"Not?A_Brand\";v=\"99\"",
|
|
72
|
-
"sec-ch-ua-mobile": "?0",
|
|
73
|
-
"sec-ch-ua-platform": "\"macOS\"",
|
|
74
|
-
"sec-fetch-dest": "empty",
|
|
75
|
-
"sec-fetch-mode": "cors",
|
|
76
|
-
"sec-fetch-site": "same-origin",
|
|
77
|
-
"x-requested-with": "XMLHttpRequest",
|
|
78
|
-
Referer: url,
|
|
79
|
-
"Referrer-Policy": "strict-origin-when-cross-origin"
|
|
80
|
-
},
|
|
81
|
-
body: new URLSearchParams({
|
|
82
|
-
al: "1",
|
|
83
|
-
autoplay: "1",
|
|
84
|
-
claim: "",
|
|
85
|
-
force_no_repeat: "true",
|
|
86
|
-
is_video_page: "true",
|
|
87
|
-
list: "",
|
|
88
|
-
module: "direct",
|
|
89
|
-
t: "",
|
|
90
|
-
video: `-${videoIds.ownerId}_${videoIds.videoId}`
|
|
91
|
-
}).toString()
|
|
92
|
-
});
|
|
93
|
-
if (!response.ok) throw new Error(`VK request failed: ${response.status} ${response.statusText}`);
|
|
94
|
-
const playerState = findPlayerPayload((await response.json()).payload);
|
|
95
|
-
const params = playerState?.player?.params;
|
|
96
|
-
const player = params && params.length > 0 ? params[0] : void 0;
|
|
97
|
-
if (!playerState || !player) {
|
|
98
|
-
console.error("Could not find VK player payload");
|
|
99
|
-
return [];
|
|
100
|
-
}
|
|
101
|
-
if (playerState.mvData?.is_active_live === 1 || playerState.mvData?.is_active_live === "1") {
|
|
102
|
-
console.error("Live videos are not supported");
|
|
103
|
-
return [];
|
|
104
|
-
}
|
|
105
|
-
const quality = selectQuality(player, options);
|
|
106
|
-
const mediaUrl = quality ? player[`url${quality}`] : void 0;
|
|
107
|
-
const sourceUrl = player.dash_sep || mediaUrl;
|
|
108
|
-
if (!sourceUrl) {
|
|
109
|
-
console.error("Could not find video URL");
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
return [{
|
|
113
|
-
type: "video",
|
|
114
|
-
title: [player.md_title?.trim(), player.md_author?.trim()].filter(Boolean).join(" "),
|
|
115
|
-
input: new Input({ source: new UrlSource(sourceUrl, { requestInit: { headers: {
|
|
116
|
-
Referer: url,
|
|
117
|
-
Cookie: document.cookie
|
|
118
|
-
} } }) })
|
|
119
|
-
}];
|
|
120
|
-
} });
|
|
121
|
-
//#endregion
|
|
122
|
-
module.exports = vk_default;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
//#region src/extensions-api/main.ts
|
|
2
|
-
const runtimeContext = Azot ?? Streamyx ?? {};
|
|
3
|
-
if (runtimeContext) {
|
|
4
|
-
if (!runtimeContext.defineExtension) runtimeContext.defineExtension = (extension) => extension;
|
|
5
|
-
}
|
|
6
|
-
const defineExtension = runtimeContext.defineExtension;
|
|
7
|
-
runtimeContext.version;
|
|
8
|
-
runtimeContext.sleep;
|
|
9
|
-
runtimeContext.input;
|
|
10
|
-
runtimeContext.prompt;
|
|
11
|
-
runtimeContext.notify;
|
|
12
|
-
runtimeContext.confirm;
|
|
13
|
-
runtimeContext.ask;
|
|
14
|
-
const utils = runtimeContext.utils;
|
|
15
|
-
const Input = runtimeContext.Input;
|
|
16
|
-
const UrlSource = runtimeContext.UrlSource;
|
|
17
|
-
runtimeContext.ALL_FORMATS;
|
|
18
|
-
runtimeContext.DASH;
|
|
19
|
-
runtimeContext.DASH_FORMATS;
|
|
20
|
-
runtimeContext.HLS;
|
|
21
|
-
runtimeContext.HLS_FORMATS;
|
|
22
|
-
runtimeContext.MP4;
|
|
23
|
-
runtimeContext.MP3;
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/builtins/weibo/weibo.ts
|
|
26
|
-
var weibo_default = defineExtension({ async resolveEntries(url) {
|
|
27
|
-
const result = utils.execUrlPatterns(url, ["/:userId(\\d+)/:bid", "/detail/:mid"], ["https://weibo.com/", "https://m.weibo.cn"]);
|
|
28
|
-
const id = result.pathname.bid || result.pathname.mid;
|
|
29
|
-
if (!id) return [];
|
|
30
|
-
const json = await fetch(`https://m.weibo.cn/statuses/show?id=${id}`, {
|
|
31
|
-
credentials: "include",
|
|
32
|
-
referrer: `https://m.weibo.cn/status/${result.pathname.bid ?? id}?jumpfrom=weibocom`,
|
|
33
|
-
method: "GET",
|
|
34
|
-
mode: "cors"
|
|
35
|
-
}).then((response) => response.json()).catch(() => null);
|
|
36
|
-
if (!json?.data) {
|
|
37
|
-
console.error("Could not resolve Weibo post metadata");
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
const results = [];
|
|
41
|
-
const pictures = json.data.pics;
|
|
42
|
-
const pageInfo = json.data.page_info;
|
|
43
|
-
if (pictures?.length) for (const video of pictures.filter((picture) => picture.type === "video" || picture.type === "livephoto")) {
|
|
44
|
-
if (!video.videoSrc) continue;
|
|
45
|
-
results.push({
|
|
46
|
-
type: "video",
|
|
47
|
-
title: video.pid,
|
|
48
|
-
input: new Input({ source: new UrlSource(video.videoSrc) })
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else if (pageInfo?.type === "video") {
|
|
52
|
-
const pageInfoUrl = Object.values(pageInfo.urls ?? {})[0];
|
|
53
|
-
const mediaInfoUrl = pageInfo.media_info?.stream_url_hd || pageInfo.media_info?.stream_url;
|
|
54
|
-
const sourceUrl = pageInfoUrl || mediaInfoUrl;
|
|
55
|
-
if (sourceUrl) results.push({
|
|
56
|
-
type: "video",
|
|
57
|
-
title: pageInfo.title || pageInfo.page_title,
|
|
58
|
-
input: new Input({ source: new UrlSource(sourceUrl) })
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return results;
|
|
62
|
-
} });
|
|
63
|
-
//#endregion
|
|
64
|
-
module.exports = weibo_default;
|