mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into react
# Conflicts: # public/_locales/en/messages.json # src/js-components/skipNotice.ts
This commit is contained in:
69
.github/workflows/release.yml
vendored
69
.github/workflows/release.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: Upload Release Build
|
||||
|
||||
on: release
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -9,21 +11,68 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Build Artifacts
|
||||
- name: Build Artifacts
|
||||
uses: ./.github/workflows/ci
|
||||
# Initialization
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-node@v1
|
||||
- run: npm install
|
||||
- name: Copy configuration
|
||||
run: cp config.json.example config.json
|
||||
|
||||
# Create Chrome artifacts
|
||||
- name: Create Chrome artifacts
|
||||
run: npm run build:chrome
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: ChromeExtension
|
||||
path: dist
|
||||
- run: mkdir ./builds
|
||||
- uses: montudor/action-zip@v0.1.0
|
||||
with:
|
||||
args: zip -qq -r ./builds/ChromeExtension.zip ./dist
|
||||
|
||||
# Create Firefox artifacts
|
||||
- name: Create Firefox artifacts
|
||||
run: npm run build:firefox
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: FirefoxExtension
|
||||
path: dist
|
||||
- uses: montudor/action-zip@v0.1.0
|
||||
with:
|
||||
args: zip -qq -r ./builds/FirefoxExtension.zip ./dist
|
||||
|
||||
# Create Beta artifacts (Builds with the name changed to beta)
|
||||
- name: Create Chrome Beta artifacts
|
||||
run: npm run build:chrome -- --env.stream=beta
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: ChromeExtensionBeta
|
||||
path: dist
|
||||
- uses: montudor/action-zip@v0.1.0
|
||||
with:
|
||||
args: zip -qq -r ./builds/ChromeExtensionBeta.zip ./dist
|
||||
|
||||
- name: Create Firefox Beta artifacts
|
||||
run: npm run build:firefox -- --env.stream=beta
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: FirefoxExtensionBeta
|
||||
path: dist
|
||||
- uses: montudor/action-zip@v0.1.0
|
||||
with:
|
||||
args: zip -qq -r ./builds/FirefoxExtensionBeta.zip ./dist
|
||||
|
||||
# Upload each release asset
|
||||
- name: Upload to release
|
||||
uses: JasonEtco/upload-to-release@master
|
||||
uses: Shopify/upload-to-release@master
|
||||
with:
|
||||
args: ./builds/ChromeExtension.zip
|
||||
args: builds/ChromeExtension.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload to release
|
||||
uses: JasonEtco/upload-to-release@master
|
||||
uses: Shopify/upload-to-release@master
|
||||
with:
|
||||
args: ./builds/FirefoxExtension.zip
|
||||
args: builds/FirefoxExtension.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
24
README.md
24
README.md
@@ -40,32 +40,30 @@ The backend server code is available here: https://github.com/ajayyy/SponsorBloc
|
||||
|
||||
It is a simple Sqlite database that will hold all the timing data.
|
||||
|
||||
To make sure that this project doesn't die, I have made the database publicly downloadable at https://api.sponsor.ajay.app/database.db. So, you can download a backup or get archive.org to take a backup for you if you want.
|
||||
To make sure that this project doesn't die, I have made the database publicly downloadable at https://sponsor.ajay.app/database.db. You can download a backup or get archive.org to take a backup for you if you want.
|
||||
|
||||
Hopefully this project can be combined with projects like [this](https://github.com/Sponsoff/sponsorship_remover) and use this data to create a neural network to predict when sponsored segments happen. That project is sadly abandoned now, so I have decided to attempt to revive this idea.
|
||||
The dataset and API are now being used in some [ports](https://github.com/ajayyy/SponsorBlock/wiki/Unofficial-Ports) as well as a [neural network](https://github.com/andrewzlee/NeuralBlock).
|
||||
|
||||
A [previous project](https://github.com/Sponsoff/sponsorship_remover) attempted to create a neural network to predict when sponsored segments happen. That project is sadly abandoned now, so I have decided to attempt to revive this idea starting from a crowd-sourced system instead.
|
||||
|
||||
# API
|
||||
|
||||
You can read the API docs [here](https://github.com/ajayyy/SponsorBlockServer#api-docs).
|
||||
|
||||
# Build Yourself
|
||||
# Building
|
||||
|
||||
You can load this project as an unpacked extension. Make sure to rename the `config.json.example` file to `config.json` before installing.
|
||||
There are also other build scripts available. Install `npm`, then run `npm install` in the repository to install dependencies.
|
||||
|
||||
There are also other build scripts available. Install `npm`, then run `npm install` in the repository.
|
||||
Run `npm run build` to generate a Chrome extension.
|
||||
|
||||
Use `npm run build:firefox` to generate a Firefox extension.
|
||||
|
||||
The result is in `dist`. This can be loaded as an unpacked extension
|
||||
|
||||
## Developing with a clean profile
|
||||
|
||||
Run `npm run dev` to run the extension using a clean browser profile with hot reloading. Use `npm run dev:firefox` for Firefox. This uses [`web-ext run`](https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#commands).
|
||||
|
||||
## Packing
|
||||
|
||||
Run `npm run build` to generate a packed Chrome extension.
|
||||
|
||||
Use `npm run build:firefox` to generate a Firefox extension.
|
||||
|
||||
The result is in `dist`.
|
||||
|
||||
# Credit
|
||||
|
||||
The awesome [Invidious API](https://github.com/omarroth/invidious/wiki/API) previously was used.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "__MSG_fullName__",
|
||||
"short_name": "__MSG_Name__",
|
||||
"version": "1.2.16",
|
||||
"version": "1.2.22",
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_Description__",
|
||||
"content_scripts": [{
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
"message": "Click the button below when the sponsorship starts and ends to record and\nsubmit it to the database."
|
||||
},
|
||||
"popupHint": {
|
||||
"message": "Hint: Press the semicolon key while focused on a video report the start/end of a sponsor and quote to submit. (This can be changed in the options)"
|
||||
"message": "Hint: Press the semicolon key while focused on a video to report the start/end of a sponsor and quote to submit. (This can be changed in the options)"
|
||||
},
|
||||
"lastTimes": {
|
||||
"message": "Latest Sponsor Message Times Chosen"
|
||||
@@ -226,7 +226,7 @@
|
||||
"message": "Show Notice Again"
|
||||
},
|
||||
"longDescription": {
|
||||
"message": "SponsorBlock is an extension that will skip over sponsored segments of YouTube videos. SponsorBlock is a crowdsourced browser extension that let's anyone submit the start and end time's of sponsored segments of YouTube videos. Once one person submits this information, everyone else with this extension will skip right over the sponsored segment.",
|
||||
"message": "SponsorBlock is an extension that will skip over sponsored segments of YouTube videos. SponsorBlock is a crowdsourced browser extension that lets anyone submit the start and end times of sponsored segments of YouTube videos. Once one person submits this information, everyone else with this extension will skip right over the sponsored segment.",
|
||||
"description": "Full description of the extension on the store pages."
|
||||
},
|
||||
"website": {
|
||||
@@ -385,7 +385,7 @@
|
||||
"message": "Minimum duration (seconds):"
|
||||
},
|
||||
"minDurationDescription": {
|
||||
"message": "Sponsor segments shorter than the set value will not be skipeed or show in the player."
|
||||
"message": "Sponsor segments shorter than the set value will not be skipped or show in the player."
|
||||
},
|
||||
"shortCheck": {
|
||||
"message": "The following submission is shorter than your minimum duration option. This could mean that this is already submitted, and just being ignored due to this option. Are you sure you would like to submit?"
|
||||
@@ -426,6 +426,21 @@
|
||||
"mobileUpdateInfo": {
|
||||
"message": "m.youtube.com is now supported"
|
||||
},
|
||||
"exportOptions": {
|
||||
"message": "Import/Export All Options"
|
||||
},
|
||||
"whatExportOptions": {
|
||||
"message": "This is your entire configuration in JSON. This includes your userID, so be sure to share this wisely."
|
||||
},
|
||||
"setOptions": {
|
||||
"message": "Set Options"
|
||||
},
|
||||
"exportOptionsWarning": {
|
||||
"message": "Warning: Changing the options is permanent and can break your install. Are you sure you would like to do this? Make sure to backup your old one just in case."
|
||||
},
|
||||
"incorrectlyFormattedOptions": {
|
||||
"message": "This JSON is not formatted correctly. Your options have not been changed."
|
||||
},
|
||||
"confirmNoticeTitle" : {
|
||||
"message": "Submit Segment"
|
||||
},
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
"message": "Канал добавлен в белый список!"
|
||||
},
|
||||
"Sponsor": {
|
||||
"message": "Спонсор"
|
||||
"message": "спонсора"
|
||||
},
|
||||
"Sponsors": {
|
||||
"message": "Спонсоры"
|
||||
"message": "спонсоров"
|
||||
},
|
||||
"Segment": {
|
||||
"message": "спонсорская вставка"
|
||||
@@ -123,5 +123,299 @@
|
||||
},
|
||||
"submitCheck": {
|
||||
"message": "Вы уверены, что хотите отправить эту информацию?"
|
||||
},
|
||||
"whitelistChannel": {
|
||||
"message": "Добавить канал в белый список"
|
||||
},
|
||||
"removeFromWhitelist": {
|
||||
"message": "Удалить канал из белого списка"
|
||||
},
|
||||
"voteOnTime": {
|
||||
"message": "Проголосовать за время спонсорской вставки"
|
||||
},
|
||||
"recordTimes": {
|
||||
"message": "Записать время спонсорской вставки"
|
||||
},
|
||||
"soFarUHSubmited": {
|
||||
"message": "На данный момент Вы отправили"
|
||||
},
|
||||
"savedPeopleFrom": {
|
||||
"message": "Вы помогли людям сэкономить "
|
||||
},
|
||||
"viewLeaderboard": {
|
||||
"message": "Посмотреть доску почёта"
|
||||
},
|
||||
"here": {
|
||||
"message": "здесь"
|
||||
},
|
||||
"recordTimesDescription": {
|
||||
"message": "Нажмите кнопку ниже, когда спонсорская вставка начинается и заканчивается, чтобы записать\nи отправить её в базу данных."
|
||||
},
|
||||
"popupHint": {
|
||||
"message": "Подсказка: нажмите ;, чтобы сообщить начало/конец спонсорской вставки, и \", чтобы отправить. (Это можно изменить в настройках)"
|
||||
},
|
||||
"lastTimes": {
|
||||
"message": "Последнее выбранное время спонсорской вставки"
|
||||
},
|
||||
"clearTimesButton": {
|
||||
"message": "Очистить время"
|
||||
},
|
||||
"submitTimesButton": {
|
||||
"message": "Отправить время"
|
||||
},
|
||||
"publicStats": {
|
||||
"message": "Оно используется на публичной странице статистики, чтобы показать Ваш вклад. Её можно посмотреть "
|
||||
},
|
||||
"setUsername": {
|
||||
"message": "Установить имя пользователя"
|
||||
},
|
||||
"discordAdvert": {
|
||||
"message": "Присоединяйтесь к официальному серверу Discord, чтобы оставить предложения и обратную связь!"
|
||||
},
|
||||
"hideThis": {
|
||||
"message": "Скрыть это"
|
||||
},
|
||||
"Options": {
|
||||
"message": "Настройки"
|
||||
},
|
||||
"showButtons": {
|
||||
"message": "Показывать кнопки в плеере YouTube"
|
||||
},
|
||||
"hideButtons": {
|
||||
"message": "Скрыть кнопки в плеере YouTube"
|
||||
},
|
||||
"hideButtonsDescription": {
|
||||
"message": "Эта настройка скрывает кнопки для отправки спонсорских вставок, которые появляются в плеере YouTube. Они могут раздражать\n некоторых. Вместо кнопок для отправки спонсорских вставок можно использовать это всплывающее окно. Чтобы скрыть\nуведомление, нажмите кнопку \"Не показывать снова\" в уведомлении. Вы всегда сможете включить эти настройки обратно."
|
||||
},
|
||||
"showInfoButton": {
|
||||
"message": "Показывать кнопку информации в плеере YouTube"
|
||||
},
|
||||
"hideInfoButton": {
|
||||
"message": "Скрыть кнопку информации в плеере YouTube"
|
||||
},
|
||||
"whatInfoButton": {
|
||||
"message": "Эта кнопка открывает всплывающее окно на странице YouTube."
|
||||
},
|
||||
"hideDeleteButton": {
|
||||
"message": "Скрыть кнопку удаления в плеере YouTube"
|
||||
},
|
||||
"showDeleteButton": {
|
||||
"message": "Показывать кнопку удаления в плеере YouTube"
|
||||
},
|
||||
"whatDeleteButton": {
|
||||
"message": "Эта кнопка позволяет Вам очистить все спонсорские вставки в плеере YouTube."
|
||||
},
|
||||
"disableViewTracking": {
|
||||
"message": "Отключить отслеживание количества пропусков спонсорских вставок"
|
||||
},
|
||||
"enableViewTracking": {
|
||||
"message": "Включить отслеживание количества пропусков спонсорских вставок"
|
||||
},
|
||||
"whatViewTracking": {
|
||||
"message": "Эта возможность отслеживает, какие спонсорские вставки Вы пропустили, чтобы помочь пользователям узнать, насколько их\nвклад помог другим, и используется как метрика, чтобы убедиться, что спам не попадает в базу данных. Расширение отправляет\nсообщение на сервер каждый раз, когда Вы пропускаете спонсорскую вставку. Надеемся, большая часть пользователей не поменяет эту настройку, так что у нас будет точная статистика просмотров :)"
|
||||
},
|
||||
"showNotice": {
|
||||
"message": "Показывать уведомление снова"
|
||||
},
|
||||
"longDescription": {
|
||||
"message": "SponsorBlock — это расширение, которое пропускает спонсорские вставки в видео на YouTube. SponsorBlock — это краудсорсинговое расширение, которое позволяет каждому отправить время начала и конца спонсорских сегментов в видео на YouTube. После того, как кто-нибудь отправляет эту информацию, все остальные пользователи расширения будут автоматически пропускать спонсорские сегменты.",
|
||||
"description": "Полное описание расширения на страницах магазинов."
|
||||
},
|
||||
"website": {
|
||||
"message": "Сайт",
|
||||
"description": "Используется на странице магазина Firefox"
|
||||
},
|
||||
"sourceCode": {
|
||||
"message": "Исходный код",
|
||||
"description": "Используется на странице магазина Firefox"
|
||||
},
|
||||
"noticeUpdate": {
|
||||
"message": "Уведомление было обновлено!",
|
||||
"description": "The first line of the message displayed after the notice was upgraded."
|
||||
},
|
||||
"noticeUpdate2": {
|
||||
"message": "Если оно Вам всё равно не нравится, нажмите \"не показывать\".",
|
||||
"description": "The second line of the message displayed after the notice was upgraded."
|
||||
},
|
||||
"setStartSponsorShortcut": {
|
||||
"message": "Назначить горячую клавишу для начала спонсорской вставки"
|
||||
},
|
||||
"setSubmitKeybind": {
|
||||
"message": "Назначить горячую клавишу для отправки"
|
||||
},
|
||||
"keybindDescription": {
|
||||
"message": "Нажмите клавишу, чтобы выбрать её"
|
||||
},
|
||||
"keybindDescriptionComplete": {
|
||||
"message": "Клавиша назначена на: "
|
||||
},
|
||||
"0": {
|
||||
"message": "Таймаут подключения. Проверьте ваше соединение с интернетом. Если ваш интернет работает, сервер, скорее всего, перегружен или лежит."
|
||||
},
|
||||
"disableSkipping": {
|
||||
"message": "Отключить SponsorBlock"
|
||||
},
|
||||
"enableSkipping": {
|
||||
"message": "Включить SponsorBlock"
|
||||
},
|
||||
"yourWork": {
|
||||
"message": "Ваша работа",
|
||||
"description": "Used to describe the section that will show you the statistics from your submissions."
|
||||
},
|
||||
"502": {
|
||||
"message": "Похоже, сервер перегружен. Попробуйте ещё раз через несколько секунд."
|
||||
},
|
||||
"errorCode": {
|
||||
"message": "Код ошибки: "
|
||||
},
|
||||
"noticeTitleNotSkipped": {
|
||||
"message": "Пропустить спонсорскую вставку?"
|
||||
},
|
||||
"skip": {
|
||||
"message": "Пропустить"
|
||||
},
|
||||
"disableAutoSkip": {
|
||||
"message": "Отключить автоматический пропуск"
|
||||
},
|
||||
"enableAutoSkip": {
|
||||
"message": "Включить автоматический пропуск"
|
||||
},
|
||||
"autoSkipDescription": {
|
||||
"message": "Автоматический пропуск будет пропускать спонсорские вставки за Вас. Если выключено, будет показываться уведомление с предложением пропустить."
|
||||
},
|
||||
"youHaveSkipped": {
|
||||
"message": "Вы пропустили "
|
||||
},
|
||||
"youHaveSaved": {
|
||||
"message": "Вы сэкономили "
|
||||
},
|
||||
"minLower": {
|
||||
"message": "минуту"
|
||||
},
|
||||
"minsLower": {
|
||||
"message": "минут"
|
||||
},
|
||||
"hourLower": {
|
||||
"message": "час"
|
||||
},
|
||||
"hoursLower": {
|
||||
"message": "часов"
|
||||
},
|
||||
"youHaveSavedTime": {
|
||||
"message": "Вы сэкономили людям"
|
||||
},
|
||||
"youHaveSavedTimeEnd": {
|
||||
"message": " их жизней."
|
||||
},
|
||||
"guildlinesSummary": {
|
||||
"message": "- Убедитесь, что Ваш сегмент содержит только платную интеграцию, и больше ничего.\n- Убедитесь, что пропуск этого сегмента не пропустит никакой ценный контент\n- Если всё видео целиком спонсорское, пожалуйста, не сообщайте о нём. Система для сообщения о целых видео скоро выйдет.\n- Пожалуйста, не сообщайте об отказах от ответственности, которые могут показать предвзятость (если видео с обзором проплачено, не пропускайте, когда они это упоминают)."
|
||||
},
|
||||
"statusReminder": {
|
||||
"message": "Смотрите состояние сервера на status.sponsor.ajay.app."
|
||||
},
|
||||
"changeUserID": {
|
||||
"message": "Импортировать/экспортировать Ваш идентификатор пользователя"
|
||||
},
|
||||
"whatChangeUserID": {
|
||||
"message": "Это нужно держать в секрете. Это как пароль, не стоит им ни с кем делиться. Если он у кого-то есть, он сможет выдать себя за Вас."
|
||||
},
|
||||
"setUserID": {
|
||||
"message": "Установить идентификатор пользователя"
|
||||
},
|
||||
"userIDChangeWarning": {
|
||||
"message": "Внимание: изменение идентификатора пользователя необратимо. Вы действительно хотите это сделать? Сделайте резервную копию вашего старого на всякий случай."
|
||||
},
|
||||
"createdBy": {
|
||||
"message": "Создано"
|
||||
},
|
||||
"autoSkip": {
|
||||
"message": "Автоматический пропуск"
|
||||
},
|
||||
"showSkipNotice": {
|
||||
"message": "Показывать уведомление после пропуска спонсорской вставки"
|
||||
},
|
||||
"keybindCurrentlySet": {
|
||||
"message": ". Он сейчас назначен на:"
|
||||
},
|
||||
"supportInvidious": {
|
||||
"message": "Поддержка Invidious"
|
||||
},
|
||||
"supportInvidiousDescription": {
|
||||
"message": "Invidious (invidio.us) — это неофициальный клиент YouTube. Чтобы включить поддержку, Вам понадобится принять дополнительные разрешения. Это НЕ работает в приватном режиме в Chrome и других вариантах Chromium."
|
||||
},
|
||||
"optionsInfo": {
|
||||
"message": "Включить поддержку Invidious, выключить автоматический пропуск, скрыть кнопки и не только."
|
||||
},
|
||||
"addInvidiousInstance": {
|
||||
"message": "Добавить инстанс Invidious"
|
||||
},
|
||||
"addInvidiousInstanceDescription": {
|
||||
"message": "Добавить свой инстанс Invidious. Формат: ТОЛЬКО домен. Например, invidious.ajay.app"
|
||||
},
|
||||
"add": {
|
||||
"message": "Добавить"
|
||||
},
|
||||
"addInvidiousInstanceError": {
|
||||
"message": "Это неправильный домен. Введите ТОЛЬКО домен. Например, invidious.ajay.app"
|
||||
},
|
||||
"resetInvidiousInstance": {
|
||||
"message": "Сбросить список инстансов Invidious"
|
||||
},
|
||||
"resetInvidiousInstanceAlert": {
|
||||
"message": "Вы собираетесь сбросить список инстансов Invidious"
|
||||
},
|
||||
"currentInstances": {
|
||||
"message": "Текущие инстансы:"
|
||||
},
|
||||
"enableAutoUpvote": {
|
||||
"message": "Автоматически голосовать \"за\""
|
||||
},
|
||||
"whatAutoUpvote": {
|
||||
"message": "Если это включено, расширение будет голосовать \"за\" все предложения других пользователей, если Вы на них не пожалуетесь. Если уведомление отключено, это не будет происходить."
|
||||
},
|
||||
"minDuration": {
|
||||
"message": "Минимальная длительность (секунд):"
|
||||
},
|
||||
"minDurationDescription": {
|
||||
"message": "Спонсорские сегменты короче этого значения не будут пропускаться и не будут показаны в плеере."
|
||||
},
|
||||
"shortCheck": {
|
||||
"message": "Следующий диапазон времени короче, чем Ваша настройка минимальной длительности. Это может означать, что он уже был отправлен, и просто игнорируется из-за этой настройки. Вы действительно хотите отправить?"
|
||||
},
|
||||
"showUploadButton": {
|
||||
"message": "Показывать кнопку отправки"
|
||||
},
|
||||
"whatUploadButton": {
|
||||
"message": "Эта кнопка появляется в плеере YouTube после того, как Вы выбрали отметку времени и готовы к отправке."
|
||||
},
|
||||
"customServerAddress": {
|
||||
"message": "Адрес сервера SponsorBlock"
|
||||
},
|
||||
"customServerAddressDescription": {
|
||||
"message": "Адрес, по которому SponsorBlock обращается к серверу.\nМеняйте только если Вы подняли свой сервер."
|
||||
},
|
||||
"save": {
|
||||
"message": "Сохранить"
|
||||
},
|
||||
"reset": {
|
||||
"message": "Сбросить"
|
||||
},
|
||||
"customAddressError": {
|
||||
"message": "Этот адрес неправильного формата. Убедитесь, что он начинается с http:// или https://, и что на конце нет слэшей."
|
||||
},
|
||||
"areYouSureReset": {
|
||||
"message": "Вы действительно хотите это сбросить?"
|
||||
},
|
||||
"confirmPrivacy": {
|
||||
"message": "Было обнаружено, что это видео непубличное. Нажмите \"отмена\", если не хотите проверять его на спонсоров."
|
||||
},
|
||||
"unlistedCheck": {
|
||||
"message": "Игнорировать непубличные видео"
|
||||
},
|
||||
"whatUnlistedCheck": {
|
||||
"message": "Эта настройка значительно замедлит SponsorBlock. Поиск спонсоров требует отправки идентификатора видео на сервер. Если Вас беспокоит отправка идентификаторов непубличных видео по интернету, включите эту настройку."
|
||||
},
|
||||
"mobileUpdateInfo": {
|
||||
"message": "m.youtube.com теперь поддерживается"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,6 +308,32 @@
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div option-type="private-text-change" sync-option="*" confirm-message="exportOptionsWarning">
|
||||
<div class="option-button trigger-button">
|
||||
__MSG_exportOptions__
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="small-description">__MSG_whatExportOptions__</div>
|
||||
|
||||
<div class="option-hidden-section hidden">
|
||||
<br/>
|
||||
|
||||
<input class="option-text-box" type="text">
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div class="option-button text-change-set">
|
||||
__MSG_setOptions__
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div option-type="text-change" sync-option="serverAddress">
|
||||
<label class="text-label-container">
|
||||
<div>__MSG_customServerAddress__</div>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import * as Types from "./types";
|
||||
|
||||
import Config from "./config";
|
||||
// Make the config public for debugging purposes
|
||||
(<any> window).SB = Config;
|
||||
|
||||
import Utils from "./utils";
|
||||
var utils = new Utils({
|
||||
|
||||
@@ -84,13 +84,8 @@ class SBMap<T, U> extends Map {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return Array.from(this.entries());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var Config: SBObject = {
|
||||
/**
|
||||
* Callback function when an option is updated
|
||||
@@ -131,14 +126,14 @@ var Config: SBObject = {
|
||||
|
||||
/**
|
||||
* A SBMap cannot be stored in the chrome storage.
|
||||
* This data will be encoded into an array instead as specified by the toJSON function.
|
||||
* This data will be encoded into an array instead
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
function encodeStoredItem(data) {
|
||||
// if data is SBMap convert to json for storing
|
||||
if(!(data instanceof SBMap)) return data;
|
||||
return JSON.stringify(data);
|
||||
return Array.from(data.entries());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,18 +143,30 @@ function encodeStoredItem(data) {
|
||||
* @param {*} data
|
||||
*/
|
||||
function decodeStoredItem(id: string, data) {
|
||||
if(typeof data !== "string") return data;
|
||||
if (!Config.defaults[id]) return data;
|
||||
|
||||
if (Config.defaults[id] instanceof SBMap) {
|
||||
try {
|
||||
let str = JSON.parse(data);
|
||||
let jsonData: any = data;
|
||||
|
||||
if(!Array.isArray(str)) return data;
|
||||
return new SBMap(id, str);
|
||||
// Check if data is stored in the old format for SBMap (a JSON string)
|
||||
if (typeof data === "string") {
|
||||
try {
|
||||
jsonData = JSON.parse(data);
|
||||
} catch(e) {
|
||||
// Continue normally (out of this if statement)
|
||||
}
|
||||
}
|
||||
|
||||
if (!Array.isArray(jsonData)) return data;
|
||||
return new SBMap(id, jsonData);
|
||||
} catch(e) {
|
||||
console.error("Failed to parse SBMap: " + id);
|
||||
}
|
||||
}
|
||||
|
||||
// If all else fails, return the data
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
function configProxy(): any {
|
||||
|
||||
@@ -48,6 +48,14 @@ var lastPreviewBarUpdate;
|
||||
//whether the duration listener listening for the duration changes of the video has been setup yet
|
||||
var durationListenerSetUp = false;
|
||||
|
||||
// Is the video currently being switched
|
||||
var switchingVideos = null;
|
||||
|
||||
// Used by the play and playing listeners to make sure two aren't
|
||||
// called at the same time
|
||||
var lastCheckTime = 0;
|
||||
var lastCheckVideoTime = -1;
|
||||
|
||||
//the channel this video is about
|
||||
var channelURL;
|
||||
|
||||
@@ -246,6 +254,9 @@ document.onkeydown = function(e: KeyboardEvent){
|
||||
}
|
||||
|
||||
function resetValues() {
|
||||
lastCheckTime = 0;
|
||||
lastCheckVideoTime = -1;
|
||||
|
||||
//reset sponsor times
|
||||
sponsorTimes = null;
|
||||
UUIDs = [];
|
||||
@@ -258,6 +269,8 @@ function resetValues() {
|
||||
|
||||
//reset sponsor data found check
|
||||
sponsorDataFound = false;
|
||||
|
||||
switchingVideos = true;
|
||||
}
|
||||
|
||||
async function videoIDChange(id) {
|
||||
@@ -455,7 +468,7 @@ function startSponsorSchedule(currentTime?: number): void {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentTime === undefined) currentTime = video.currentTime;
|
||||
if (currentTime === undefined || currentTime === null) currentTime = video.currentTime;
|
||||
|
||||
let skipInfo = getNextSkipIndex(currentTime);
|
||||
|
||||
@@ -465,11 +478,19 @@ function startSponsorSchedule(currentTime?: number): void {
|
||||
let timeUntilSponsor = skipTime[0] - currentTime;
|
||||
|
||||
let skippingFunction = () => {
|
||||
let forcedSkipTime: number = null;
|
||||
|
||||
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
||||
|
||||
if (Config.config.disableAutoSkip) {
|
||||
forcedSkipTime = skipTime[0] + 0.001;
|
||||
} else {
|
||||
forcedSkipTime = skipTime[1];
|
||||
}
|
||||
}
|
||||
|
||||
startSponsorSchedule();
|
||||
startSponsorSchedule(forcedSkipTime);
|
||||
};
|
||||
|
||||
if (timeUntilSponsor <= 0) {
|
||||
@@ -497,8 +518,29 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
||||
if (!seekListenerSetUp && !Config.config.disableSkipping) {
|
||||
seekListenerSetUp = true;
|
||||
|
||||
video.addEventListener('seeked', () => startSponsorSchedule());
|
||||
video.addEventListener('play', () => startSponsorSchedule());
|
||||
video.addEventListener('play', () => {
|
||||
switchingVideos = false;
|
||||
|
||||
// Make sure it doesn't get double called with the playing event
|
||||
if (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000) {
|
||||
lastCheckTime = Date.now();
|
||||
lastCheckVideoTime = video.currentTime;
|
||||
|
||||
startSponsorSchedule();
|
||||
}
|
||||
});
|
||||
video.addEventListener('playing', () => {
|
||||
// Make sure it doesn't get double called with the play event
|
||||
if (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000) {
|
||||
lastCheckTime = Date.now();
|
||||
lastCheckVideoTime = video.currentTime;
|
||||
|
||||
startSponsorSchedule();
|
||||
}
|
||||
});
|
||||
video.addEventListener('seeked', () => {
|
||||
if (!video.paused) startSponsorSchedule();
|
||||
});
|
||||
video.addEventListener('ratechange', () => startSponsorSchedule());
|
||||
video.addEventListener('seeking', cancelSponsorSchedule);
|
||||
video.addEventListener('pause', cancelSponsorSchedule);
|
||||
@@ -573,11 +615,13 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!video.paused && !switchingVideos) {
|
||||
if (zeroSecondSponsor) {
|
||||
startSponsorSchedule(0);
|
||||
} else {
|
||||
startSponsorSchedule();
|
||||
}
|
||||
}
|
||||
|
||||
// Reset skip save
|
||||
sponsorSkipped = [];
|
||||
@@ -839,10 +883,9 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
|
||||
}
|
||||
|
||||
//send telemetry that a this sponsor was skipped
|
||||
if (Config.config.trackViewCount && !sponsorSkipped[index]) {
|
||||
if (Config.config.trackViewCount && !sponsorSkipped[index] && !Config.config.disableAutoSkip) {
|
||||
utils.sendRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
|
||||
|
||||
if (!Config.config.disableAutoSkip) {
|
||||
// Count this as a skip
|
||||
Config.config.minutesSaved = Config.config.minutesSaved + (sponsorTimes[index][1] - sponsorTimes[index][0]) / 60;
|
||||
Config.config.skipCount = Config.config.skipCount + 1;
|
||||
@@ -850,7 +893,6 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
|
||||
sponsorSkipped[index] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unskipSponsorTime(UUID) {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import Config from "./config";
|
||||
// Make the config public for debugging purposes
|
||||
(<any> window).SB = Config;
|
||||
|
||||
import Utils from "./utils";
|
||||
var utils = new Utils();
|
||||
@@ -72,7 +74,7 @@ async function init() {
|
||||
|
||||
textChangeInput.value = Config.config[textChangeOption];
|
||||
|
||||
textChangeSetButton.addEventListener("click", () => {
|
||||
textChangeSetButton.addEventListener("click", async () => {
|
||||
// See if anything extra must be done
|
||||
switch (textChangeOption) {
|
||||
case "serverAddress":
|
||||
@@ -84,6 +86,18 @@ async function init() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Permission needed on Firefox
|
||||
if (utils.isFirefox()) {
|
||||
let permissionSuccess = await new Promise((resolve, reject) => {
|
||||
chrome.permissions.request({
|
||||
origins: [textChangeInput.value + "/"],
|
||||
permissions: []
|
||||
}, resolve);
|
||||
});
|
||||
|
||||
if (!permissionSuccess) return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -259,6 +273,8 @@ function invidiousOnClick(checkbox: HTMLInputElement, option: string) {
|
||||
if (!granted) {
|
||||
Config.config[option] = false;
|
||||
checkbox.checked = false;
|
||||
} else {
|
||||
checkbox.checked = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -346,15 +362,50 @@ function activatePrivateTextChange(element: HTMLElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
textBox.value = Config.config[option];
|
||||
let result = Config.config[option];
|
||||
|
||||
// See if anything extra must be done
|
||||
switch (option) {
|
||||
case "*":
|
||||
result = JSON.stringify(Config.localConfig);
|
||||
break;
|
||||
}
|
||||
|
||||
textBox.value = result;
|
||||
|
||||
let setButton = element.querySelector(".text-change-set");
|
||||
setButton.addEventListener("click", () => {
|
||||
let confirmMessage = element.getAttribute("confirm-message");
|
||||
|
||||
if (confirmMessage === null || confirm(chrome.i18n.getMessage(confirmMessage))) {
|
||||
|
||||
// See if anything extra must be done
|
||||
switch (option) {
|
||||
case "*":
|
||||
try {
|
||||
let newConfig = JSON.parse(textBox.value);
|
||||
for (const key in newConfig) {
|
||||
Config.config[key] = newConfig[key];
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
if (newConfig.supportInvidious) {
|
||||
let checkbox = <HTMLInputElement> document.querySelector("#support-invidious > label > label > input");
|
||||
|
||||
checkbox.checked = true;
|
||||
invidiousOnClick(checkbox, "supportInvidious");
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
alert(chrome.i18n.getMessage("incorrectlyFormattedOptions"));
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
Config.config[option] = textBox.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
element.querySelector(".option-hidden-section").classList.remove("hidden");
|
||||
|
||||
Reference in New Issue
Block a user