Skip to content

Commit

Permalink
Merge pull request #832 from ilyhalight/vot.js1.3.1
Browse files Browse the repository at this point in the history
Updated to vot.js 1.3.1
  • Loading branch information
ilyhalight authored Sep 25, 2024
2 parents e3dd13e + ac360f2 commit b5c5374
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 1,220 deletions.
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

0 comments on commit b5c5374

Please sign in to comment.