From 0d812f581ca315595ba283d6fe4b3f569a480bfc Mon Sep 17 00:00:00 2001 From: Toil <62353659+ilyhalight@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:44:07 +0300 Subject: [PATCH] fix wiki-gen script --- scripts/wiki-gen/SITES-EN.md | 11 +---------- scripts/wiki-gen/SITES-RU.md | 3 +-- scripts/wiki-gen/index.js | 5 +++-- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/scripts/wiki-gen/SITES-EN.md b/scripts/wiki-gen/SITES-EN.md index fc21ea60..ee828302 100644 --- a/scripts/wiki-gen/SITES-EN.md +++ b/scripts/wiki-gen/SITES-EN.md @@ -50,8 +50,6 @@ Limitations: - Doesn't work in the video preview - To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way ## Piped @@ -100,9 +98,6 @@ Limitations: - Doesn't work in the video preview - To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way ## Poketube @@ -277,7 +272,6 @@ Limitations: - The translation in the feed doesn't work (It only works in open videos) - To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way ## Rumble @@ -451,7 +445,6 @@ Limitations: - It only works with public links - To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way ## OK.ru @@ -600,7 +593,6 @@ Limitations: - There are no subtitles - To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way ## Kick @@ -636,7 +628,6 @@ Limitations: - There are no subtitles - To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -- To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way ## Epicgames @@ -774,7 +765,7 @@ Limitations: - To ensure that the script works, you need to [enable the "Bypass Media CSP" setting](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) in the extension or delete the CSP in another way -## Direct link to MP4 +## Direct link to MP4/WEBM Status: [✅] Working diff --git a/scripts/wiki-gen/SITES-RU.md b/scripts/wiki-gen/SITES-RU.md index 71effef7..e09f4460 100644 --- a/scripts/wiki-gen/SITES-RU.md +++ b/scripts/wiki-gen/SITES-RU.md @@ -98,7 +98,6 @@ - Не работает в предпросмотре видео - Для гарантированной работы скрипта необходимо [включить настройку "Обход Media CSP"](https://github.com/ilyhalight/voice-over-translation/wiki/%5BRU%5D-FAQ) в расширение или удалить CSP другим способом -- Для гарантированной работы скрипта необходимо [включить настройку "Обход Media CSP"](https://github.com/ilyhalight/voice-over-translation/wiki/%5BRU%5D-FAQ) в расширение или удалить CSP другим способом ## Poketube @@ -766,7 +765,7 @@ - Для гарантированной работы скрипта необходимо [включить настройку "Обход Media CSP"](https://github.com/ilyhalight/voice-over-translation/wiki/%5BRU%5D-FAQ) в расширение или удалить CSP другим способом -## Direct link to MP4 +## Direct link to MP4/WEBM Статус: [✅] Работает diff --git a/scripts/wiki-gen/index.js b/scripts/wiki-gen/index.js index 2c9470a2..95212d38 100644 --- a/scripts/wiki-gen/index.js +++ b/scripts/wiki-gen/index.js @@ -104,7 +104,8 @@ function genMarkdown(sites, lang = "ru") { return removeDuplicatesKeepLast(sitesData, "host").map((site) => { const hasData = Object.hasOwn(siteData, site.host); const limitsData = hasData ? siteData[site.host].limits ?? [] : []; - if (site.needBypassCSP) { + if (site.needBypassCSP && !limitsData.includes(locales.needBypassCSP)) { + console.log(site); limitsData.push(locales.needBypassCSP); } @@ -154,7 +155,7 @@ async function main() { .replace("Yandexdisk", "Yandex Disk") .replace("Googledrive", "Google Drive") .replace("Okru", "OK.ru") - .replace("Custom", "Direct link to MP4") + .replace("Custom", "Direct link to MP4/WEBM") .replace("Bannedvideo", "Banned.Video") .replace( "geo.dailymotion.com",