Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to vot.js 1.3.1 #832

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 1.7.1 [WIP]

- Включен обход Media CSP для player.vimeo.com
- Исправлена работа встраиваемого плеера Vimeo (player.vimeo.com), если видео залито в приватный доступ и доступно только через встраивание
- Исправлена работа встраиваемого плеера Vimeo (player.vimeo.com), если видео залито в приватный доступ и доступно только через встраивание (#543, #828)
- Добавлена поддержка субтитров от сайта для Vimeo

# 1.7.0
Expand Down
2 changes: 1 addition & 1 deletion dist/vot-min.user.js

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ const yandexProtobuf = {
});

;// ./node_modules/vot.js/package.json
const package_namespaceObject = {"rE":"1.3.0"};
const package_namespaceObject = {"rE":"1.3.1"};
;// ./node_modules/vot.js/dist/secure.js

const utf8Encoder = new TextEncoder();
Expand Down Expand Up @@ -3950,9 +3950,15 @@ class VimeoHelper extends BaseHelper {
const baseUrl = new URL(cdnUrl);
const pathLength = Array.from(data.base_url.matchAll(/\.\.\//g)).length + 1;
const pathFragments = baseUrl.pathname.split("/");
baseUrl.pathname = pathFragments
.slice(0, pathFragments.length - pathLength)
.join("/");
let extraPath = data.base_url.replaceAll("../", "");
extraPath =
extraPath && !extraPath.startsWith("/") ? `/${extraPath}` : extraPath;
baseUrl.pathname =
pathFragments.slice(0, pathFragments.length - pathLength).join("/") +
extraPath;
if (!baseUrl.pathname.endsWith("/")) {
baseUrl.pathname += "/";
}
const videoData = data.audio.find((v) => v.mime_type === "audio/mp4" && v.format === "dash");
if (!videoData) {
throw new VideoHelperError("Failed to find video data");
Expand All @@ -3962,9 +3968,9 @@ class VimeoHelper extends BaseHelper {
throw new VideoHelperError("Failed to find first segment url");
}
const [videoName, videoParams] = segmentUrl.split("?", 2);
baseUrl.pathname += `/${videoData.base_url}${videoName}`;
const params = new URLSearchParams(videoParams);
params.delete("range");
baseUrl.pathname += `${videoData.base_url}${videoName}`;
baseUrl.href = baseUrl.href.split("?")[0] + "?" + params.toString();
return baseUrl.href;
}
Expand Down
Loading
Loading