Skip to content

Commit

Permalink
Merge pull request #910 from ilyhalight/dev
Browse files Browse the repository at this point in the history
Fix yandex disk /i/ path
  • Loading branch information
ilyhalight authored Nov 10, 2024
2 parents 86d5b74 + 3e0915b commit 21553dd
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 21 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
<!-- добавить чанковую загрузку аудио файла в новом плеере -->
<!-- Вынести HLS в отдельный плеер (?) -->

# 1.x [WIP]
# 1.7.2

- Добавлена возможность использования эксперементальной вариации голосов Яндекса. Новые голоса работают, только при некоторых условиях, во всех остальных случаях используются старые (#897)
- Добавлен обход кэша при получение перевода интерфейса после нажатия на кнопку "Обновить файлы локализации"
- Исправлена некорректная генерация Sec-{Vsubs|Vtrans}-Token заголовков ([vot.js#36](https://github.com/FOSWLY/vot.js/issues/36))
- Исправлена ошибка из-за которой старый плеер не добавлял lipsync эвенты после первого выключения перевода (#902, #894, возможно #887)
- Исправлена работа Yandex Disk по пути /i/ (#908)

# 1.7.1

Expand Down
4 changes: 2 additions & 2 deletions dist/vot-min.user.js

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
// @connect onrender.com
// @connect workers.dev
// @namespace vot
// @version 1.7.1
// @version 1.7.2
// @icon https://translate.yandex.ru/icons/favicon.ico
// @author sodapng, mynovelhost, Toil, SashaXser, MrSoczekXD
// @homepageURL https://github.com/ilyhalight/voice-over-translation
Expand Down Expand Up @@ -4577,7 +4577,7 @@ class YandexDiskHelper extends BaseHelper {
async getVideoId(url) {
const fileId = /\/i\/([^/]+)/.exec(url.pathname)?.[1];
if (fileId) {
return fileId;
return `i/${fileId}`;
}

return url.pathname.startsWith(this.CLIENT_PREFIX)
Expand Down Expand Up @@ -10124,9 +10124,8 @@ class VideoHandler {

this.votVideoVolumeSlider.input.addEventListener("input", (e) => {
const value = Number(e.target.value);
this.votVideoVolumeSlider.label.querySelector(
"strong",
).textContent = `${value}%`;
this.votVideoVolumeSlider.label.querySelector("strong").textContent =
`${value}%`;
this.setVideoVolume(value / 100);
if (this.data.syncVolume) {
this.syncVolumeWrapper("video", value);
Expand Down Expand Up @@ -10985,9 +10984,8 @@ class VideoHandler {
const newSlidersVolume = Math.round(videoVolume);

this.votVideoVolumeSlider.input.value = newSlidersVolume;
this.votVideoVolumeSlider.label.querySelector(
"strong",
).textContent = `${newSlidersVolume}%`;
this.votVideoVolumeSlider.label.querySelector("strong").textContent =
`${newSlidersVolume}%`;
ui.updateSlider(this.votVideoVolumeSlider.input);

if (this.data.syncVolume === 1) {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"browserslist": "^4.24.2",
"enquirer": "^2.4.1",
"eslint": "^9.14.0",
"eslint-plugin-oxlint": "^0.11.0",
"eslint-plugin-oxlint": "^0.11.1",
"eslint-webpack-plugin": "^4.2.0",
"globals": "^15.12.0",
"husky": "^9.1.6",
"lightningcss": "^1.28.1",
"lint-staged": "^15.2.10",
"npm-run-all2": "^7.0.1",
"oxlint": "^0.11.0",
"oxlint": "^0.11.1",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"sass": "^1.80.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ index 5e6bbc3..ece8494 100644
async getVideoId(url) {
const pathname = url.pathname;
diff --git a/node_modules/vot.js/dist/helpers/vimeo.js b/node_modules/vot.js/dist/helpers/vimeo.js
index e0baf75..f66c02c 100644
index 4c6f30c..dbe4ebf 100644
--- a/node_modules/vot.js/dist/helpers/vimeo.js
+++ b/node_modules/vot.js/dist/helpers/vimeo.js
@@ -1,4 +1,3 @@
Expand Down Expand Up @@ -370,7 +370,7 @@ index 2507c45..c5fe05f 100644
//# sourceMappingURL=yandexdisk.d.ts.map
\ No newline at end of file
diff --git a/node_modules/vot.js/dist/helpers/yandexdisk.js b/node_modules/vot.js/dist/helpers/yandexdisk.js
index 8ecc67a..e7ea816 100644
index 8ecc67a..4bb383d 100644
--- a/node_modules/vot.js/dist/helpers/yandexdisk.js
+++ b/node_modules/vot.js/dist/helpers/yandexdisk.js
@@ -1,6 +1,92 @@
Expand Down Expand Up @@ -460,7 +460,7 @@ index 8ecc67a..e7ea816 100644
- return /\/i\/([^/]+)/.exec(url.pathname)?.[1];
+ const fileId = /\/i\/([^/]+)/.exec(url.pathname)?.[1];
+ if (fileId) {
+ return fileId;
+ return `i/${fileId}`;
+ }
+
+ return url.pathname.startsWith(this.CLIENT_PREFIX)
Expand Down
2 changes: 1 addition & 1 deletion src/headers.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "[VOT] - Voice Over Translation",
"description": "A small extension that adds a Yandex Browser video translation to other browsers",
"version": "1.7.1",
"version": "1.7.2",
"author": "sodapng, mynovelhost, Toil, SashaXser, MrSoczekXD",
"namespace": "vot",
"icon": "https://translate.yandex.ru/icons/favicon.ico",
Expand Down

0 comments on commit 21553dd

Please sign in to comment.