Skip to content

Commit

Permalink
added needBypassCSP field to sites data
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyhalight committed Sep 17, 2024
1 parent 8cb4974 commit c833a22
Show file tree
Hide file tree
Showing 70 changed files with 249 additions and 167 deletions.
14 changes: 13 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,19 @@
- Добавлена возможность выбрать формат загружаемых субтитров
- Добавлено округление до целого процента в слайдере "Уменьшить громкость видео до"
- Добавлена возможность включить загрузку аудио дорожки и субтитров с названием видео, если расширение его нашло (#791)
- Добавлена возможность включить обход Media CSP через расширение, а не удалять его полностью через Tampermonkey или какие-либо другие расширения, что является не очень безопасным вариантом (включено по умолчанию, если браузер поддерживает WebAudio)
- Добавлена возможность включить обход Media CSP через расширение (включено по умолчанию, если браузер поддерживает WebAudio), а не удалять его полностью через Tampermonkey или какие-либо другие расширения, что является не очень безопасным вариантом. Работает, только, для ниже перечисленных веб-сайтов. Если вы нашли сайт, который необходимо добавить в список для обхода Media CSP - создайте Issues.

- "linkedin",
- "sap",
- "apple_developer",
- "xvideos",
- "twitter",
- "facebook",
- "yandexdisk",
- "reddit",
- "invidious",
- "piped"

- Добавлено автоопределение возвращаемого типа данных из LocalStorage, если присутствует стандартное значение
- Убрано выставление языка `auto` по умолчанию для Invidious и Piped
- Автосгенериванные субтитры с YouTube, теперь, используют уже существующие токены, а не генерируют новые
Expand Down
14 changes: 7 additions & 7 deletions dist/vot-min.user.js

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1863,12 +1863,14 @@ const sitesPoketube = [
url: "https://youtu.be/",
match: sitesInvidious,
selector: "#player",
needBypassCSP: true,
},
{
host: VideoService.piped,
url: "https://youtu.be/",
match: sitesPiped,
selector: ".shaka-video-container",
needBypassCSP: true,
},
{
host: VideoService.poketube,
Expand Down Expand Up @@ -1943,6 +1945,7 @@ const sitesPoketube = [
url: "https://www.xvideos.com/",
match: /^(www.)?(xvideos|xv-ru).com$/,
selector: ".video-bg-pic",
needBypassCSP: true,
},
{
host: VideoService.pornhub,
Expand All @@ -1964,7 +1967,8 @@ const sitesPoketube = [
url: "https://twitter.com/i/status/",
match: /^(twitter|x).com$/,
selector: 'div[data-testid="videoComponent"] > div:nth-child(1) > div',
eventSelector: 'div[data-testid="videoPlayer"]'
eventSelector: 'div[data-testid="videoPlayer"]',
needBypassCSP: true,
},
{
host: VideoService.rumble,
Expand All @@ -1978,6 +1982,7 @@ const sitesPoketube = [
match: (url) =>
url.host.includes("facebook.com") && url.pathname.includes("/videos/"),
selector: 'div[role="main"] div[data-pagelet$="video" i]',
needBypassCSP: true,
},
{
additionalData: "reels",
Expand All @@ -1986,6 +1991,7 @@ const sitesPoketube = [
match: (url) =>
url.host.includes("facebook.com") && url.pathname.includes("/reel/"),
selector: 'div[role="main"]',
needBypassCSP: true,
},
{
host: VideoService.rutube,
Expand Down Expand Up @@ -2055,7 +2061,8 @@ const sitesPoketube = [
url: "https://yadi.sk/i/",
match: /^disk.yandex.ru$/,
selector: ".video-player__player > div:nth-child(1)",
eventSelector: ".video-player__player"
eventSelector: ".video-player__player",
needBypassCSP: true,
},
{
host: VideoService.okru,
Expand Down Expand Up @@ -2128,6 +2135,7 @@ const sitesPoketube = [
match: /^(www.|new.|old.)?reddit.com$/,
selector: ".reddit-video-player-root",
needExtraData: true,
needBypassCSP: true,
},
{
host: VideoService.kick,
Expand All @@ -2142,6 +2150,7 @@ const sitesPoketube = [
match: /^developer.apple.com$/,
selector: ".developer-video-player",
needExtraData: true,
needBypassCSP: true,
},
{
host: VideoService.epicgames,
Expand Down Expand Up @@ -2194,6 +2203,7 @@ const sitesPoketube = [
selector: ".playkit-container",
eventSelector: ".playkit-player",
needExtraData: true,
needBypassCSP: true,
},
{
host: VideoService.watchpornto,
Expand All @@ -2207,6 +2217,7 @@ const sitesPoketube = [
match: /^(www)?.linkedin.com$/,
selector: ".vjs-v7",
needExtraData: true,
needBypassCSP: true,
},
{
host: VideoService.custom,
Expand All @@ -2217,7 +2228,7 @@ const sitesPoketube = [
]);

;// CONCATENATED MODULE: ./src/localization/locales/en.json
const en_namespaceObject = /*#__PURE__*/JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})","VOTSubtitlesDownloadFormat":"The format for downloading subtitles","VOTDownloadWithName":"Download files with the video name","VOTUpdateLocaleFiles":"Update localization files","VOTLocaleHash":"Locale hash","VOTUpdatedAt":"Updated at","VOTNeedWebAudioAPI":"To enable this, you must have a Web Audio API","VOTBypassMediaCSP":"Bypassing Media CSP"}');
const en_namespaceObject = /*#__PURE__*/JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})","VOTSubtitlesDownloadFormat":"The format for downloading subtitles","VOTDownloadWithName":"Download files with the video name","VOTUpdateLocaleFiles":"Update localization files","VOTLocaleHash":"Locale hash","VOTUpdatedAt":"Updated at","VOTNeedWebAudioAPI":"To enable this, you must have a Web Audio API","VOTBypassMediaCSP":"Bypassing Media CSP","VOTMediaCSPEnabledOnSite":"Media CSP is enabled on this site"}');
;// CONCATENATED MODULE: ./src/utils/debug.js
const debug = {};
debug.log = (...text) => {
Expand Down Expand Up @@ -7576,7 +7587,10 @@ class VideoHandler {
);

this.votBypassMediaCSPCheckbox = ui.createCheckbox(
localizationProvider.get("VOTBypassMediaCSP"),
localizationProvider.get("VOTBypassMediaCSP") +
(this.site.needBypassCSP
? ` (${localizationProvider.get("VOTMediaCSPEnabledOnSite")})`
: ""),
this.data?.bypassMediaCSP ?? false,
);
if (!this.audioContext) {
Expand Down Expand Up @@ -8936,18 +8950,7 @@ class VideoHandler {
return false;
}

return [
"linkedin",
"sap",
"apple_developer",
"xvideos",
"twitter",
"facebook",
"yandexdisk",
"reddit",
"invidious",
"piped",
].includes(this.site.host);
return this.site.needBypassCSP;
};

// Default actions on stop translate
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

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

Loading

0 comments on commit c833a22

Please sign in to comment.