Skip to content

Commit

Permalink
Merge pull request #813 from ilyhalight/bypass-csp
Browse files Browse the repository at this point in the history
Bypass Media CSP
  • Loading branch information
ilyhalight authored Sep 17, 2024
2 parents 6490fa3 + 05104ce commit cc9d026
Show file tree
Hide file tree
Showing 78 changed files with 788 additions and 343 deletions.
6 changes: 3 additions & 3 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You can see all the restrictions related to site support in [wiki](https://githu
- **[Twitch](https://www.twitch.tv)**
- **[VK](https://vk.com)**
- **[OK](https://ok.ru/)**
- **[[⚠️] Twitter](https://twitter.com/)**
- **[Twitter](https://twitter.com/)**
- **[9GAG](https://9gag.com/gag/)**
- **[Rutube](https://rutube.ru/)**
- **[Bilibili](https://bilibili.com/)**
Expand All @@ -61,14 +61,14 @@ You can see all the restrictions related to site support in [wiki](https://githu
- **[Bitchute](https://www.bitchute.com/)**
- **[Coursera](https://www.coursera.org/)**
- **[[⚠️] Udemy](https://www.udemy.com/)**
- **[[⚠️] Facebook\*](https://facebook.com/)**
- **[Facebook\*](https://facebook.com/)**
- **[TikTok](https://tiktok.com/)**
- **[Rumble](https://rumble.com/)**
- **[EPorner](https://www.eporner.com/)**
- **[Peertube](https://tube.shanti.cafe/)**
- **[Dailymotion](https://www.dailymotion.com/)**
- **[Trovo](https://trovo.live/)**
- **[[⚠️] Yandex Disk](https://disk.yandex.ru/)**
- **[Yandex Disk](https://disk.yandex.ru/)**
- **[Google Drive](https://drive.google.com/)**
- **[Banned Video](https://banned.video/)**
- **[Weverse](https://weverse.io/)**
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
- **[Twitch](https://www.twitch.tv)**
- **[VK](https://vk.com)**
- **[OK](https://ok.ru/)**
- **[[⚠️] Twitter](https://twitter.com/)**
- **[Twitter](https://twitter.com/)**
- **[9GAG](https://9gag.com/gag/)**
- **[Rutube](https://rutube.ru/)**
- **[Bilibili](https://bilibili.com/)**
Expand All @@ -62,14 +62,14 @@
- **[Bitchute](https://www.bitchute.com/)**
- **[Coursera](https://www.coursera.org/)**
- **[[⚠️] Udemy](https://www.udemy.com/)**
- **[[⚠️] Facebook\*](https://facebook.com/)**
- **[Facebook\*](https://facebook.com/)**
- **[TikTok](https://tiktok.com/)**
- **[Rumble](https://rumble.com/)**
- **[EPorner](https://www.eporner.com/)**
- **[Peertube](https://tube.shanti.cafe/)**
- **[Dailymotion](https://www.dailymotion.com/)**
- **[Trovo](https://trovo.live/)**
- **[[⚠️] Yandex Disk](https://disk.yandex.ru/)**
- **[Yandex Disk](https://disk.yandex.ru/)**
- **[Google Drive](https://drive.google.com/)**
- **[Banned Video](https://banned.video/)**
- **[Weverse](https://weverse.io/)**
Expand Down
13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
- Добавлена возможность выбрать формат загружаемых субтитров
- Добавлено округление до целого процента в слайдере "Уменьшить громкость видео до"
- Добавлена возможность включить загрузку аудио дорожки и субтитров с названием видео, если расширение его нашло (#791)
- Добавлена возможность включить обход 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
40 changes: 20 additions & 20 deletions dist/vot-min.user.js

Large diffs are not rendered by default.

194 changes: 172 additions & 22 deletions dist/vot.user.js

Large diffs are not rendered by default.

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.

22 changes: 17 additions & 5 deletions patches/vot.js+1.2.9+003+added-sites-selectors.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/node_modules/vot.js/dist/config/sites.js b/node_modules/vot.js/dist/config/sites.js
index 64e1530..ffc71a8 100644
index 64e1530..0f0c9ac 100644
--- a/node_modules/vot.js/dist/config/sites.js
+++ b/node_modules/vot.js/dist/config/sites.js
@@ -2,34 +2,69 @@ import { VideoService } from "../types/yandex.js";
@@ -2,34 +2,71 @@ import { VideoService } from "../types/yandex.js";
import { sitesInvidious, sitesPiped, sitesProxiTok, sitesPeertube, sitesPoketube, } from "./alternativeUrls.js";
export default [
{
Expand Down Expand Up @@ -31,12 +31,14 @@ index 64e1530..ffc71a8 100644
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 @@ -73,7 +75,7 @@ index 64e1530..ffc71a8 100644
},
{
host: VideoService.twitch,
@@ -40,209 +75,284 @@ export default [
@@ -40,210 +77,294 @@ export default [
/^clips.twitch.tv$/,
/^player.twitch.tv$/,
],
Expand Down Expand Up @@ -108,6 +110,7 @@ index 64e1530..ffc71a8 100644
url: "https://www.xvideos.com/",
match: /^(www.)?(xvideos|xv-ru).com$/,
+ selector: ".video-bg-pic",
+ needBypassCSP: true,
},
{
host: VideoService.pornhub,
Expand All @@ -129,7 +132,8 @@ index 64e1530..ffc71a8 100644
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 @@ -145,6 +149,7 @@ index 64e1530..ffc71a8 100644
+ 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 @@ -153,6 +158,7 @@ index 64e1530..ffc71a8 100644
+ match: (url) =>
+ url.host.includes("facebook.com") && url.pathname.includes("/reel/"),
+ selector: 'div[role="main"]',
+ needBypassCSP: true,
},
{
host: VideoService.rutube,
Expand Down Expand Up @@ -224,7 +230,8 @@ index 64e1530..ffc71a8 100644
- match: /^disk.yandex.ru|yadi.sk$/,
+ 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 @@ -298,6 +305,7 @@ index 64e1530..ffc71a8 100644
match: /^(www.|new.|old.)?reddit.com$/,
+ selector: ".reddit-video-player-root",
needExtraData: true,
+ needBypassCSP: true,
},
{
host: VideoService.kick,
Expand All @@ -312,6 +320,7 @@ index 64e1530..ffc71a8 100644
match: /^developer.apple.com$/,
+ selector: ".developer-video-player",
needExtraData: true,
+ needBypassCSP: true,
},
{
host: VideoService.epicgames,
Expand Down Expand Up @@ -349,6 +358,7 @@ index 64e1530..ffc71a8 100644
+ selector: ".playkit-container",
+ eventSelector: ".playkit-player",
needExtraData: true,
+ needBypassCSP: true,
},
{
host: VideoService.watchpornto,
Expand All @@ -362,5 +372,7 @@ index 64e1530..ffc71a8 100644
match: /^(www)?.linkedin.com$/,
+ selector: ".vjs-v7",
needExtraData: true,
+ needBypassCSP: true,
},
{
host: VideoService.custom,
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/vot.js/dist/config/sites.js b/node_modules/vot.js/dist/config/sites.js
index 66d084c..633eaf9 100644
index 6ff12e4..0530553 100644
--- a/node_modules/vot.js/dist/config/sites.js
+++ b/node_modules/vot.js/dist/config/sites.js
@@ -342,6 +342,14 @@ export default [
Expand Down
38 changes: 24 additions & 14 deletions scripts/wiki-gen/SITES-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ Available paths:
Limitations:

- Doesn't work in the video preview
- To work, you must completely remove [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) with pages
- 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

Expand Down Expand Up @@ -97,7 +99,10 @@ Available paths:
Limitations:

- Doesn't work in the video preview
- To work, you must completely remove [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) with pages
- 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

Expand Down Expand Up @@ -235,7 +240,7 @@ Available paths:

Limitations:

- To work, you may need to add a script to the [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ)
- 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

## Pornhub

Expand All @@ -257,7 +262,7 @@ Limitations:

## Twitter

Status: [⚠️] Works with limitations
Status: [] Working

Available (sub)domains:

Expand All @@ -270,8 +275,9 @@ Available paths:

Limitations:

- To work, you need to add a script to the [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ)
- 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

Expand All @@ -291,7 +297,7 @@ Limitations:

## Facebook

Status: [⚠️] Works with limitations
Status: [] Working

Available (sub)domains:

Expand All @@ -304,7 +310,7 @@ Available paths:

Limitations:

- To work, you need to add a script to the [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ)
- 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

## Rutube

Expand Down Expand Up @@ -431,7 +437,7 @@ Limitations:

## Yandex Disk

Status: [⚠️] Works with limitations
Status: [] Working

Available (sub)domains:

Expand All @@ -443,8 +449,9 @@ Available paths:

Limitations:

- To work, you need to add a script to the [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ)
- 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

Expand Down Expand Up @@ -592,7 +599,8 @@ Available paths:
Limitations:

- There are no subtitles
- To work, you must completely remove [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) with pages
- 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

Expand Down Expand Up @@ -627,6 +635,8 @@ Available paths:
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

Expand Down Expand Up @@ -719,7 +729,7 @@ Limitations:

## Sap

Status: [⚠️] Works with limitations
Status: [] Working

Available (sub)domains:

Expand All @@ -732,7 +742,7 @@ Available paths:

Limitations:

- To work, you must completely remove [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) with pages
- 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

## Watchpornto

Expand All @@ -749,7 +759,7 @@ Available paths:

## Linkedin

Status: [⚠️] Works with limitations
Status: [] Working

Available (sub)domains:

Expand All @@ -762,7 +772,7 @@ Available paths:

Limitations:

- To work, you must completely remove [CSP](https://github.com/ilyhalight/voice-over-translation/wiki/%5BEN%5D-FAQ) with pages
- 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

Expand Down
Loading

0 comments on commit cc9d026

Please sign in to comment.