Skip to content

Commit

Permalink
some edits after of #33
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyhalight committed Jul 26, 2024
1 parent e18cdc1 commit c5ac229
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 46 deletions.
56 changes: 35 additions & 21 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,72 @@
A small script that allows you to download an audio translation from Yandex via the terminal.

## 📖 Using

### Usage examples:
- `vot-cli [options] [args] <link> [link2] [link3] ...` — general example
- `vot-cli <link>` — get the audio translation from the link
- `vot-cli --help` — show help by commands
- `vot-cli --version` — show script version
- `vot-cli --output=<path> <link>` — get the audio translation from the link and save it to the specified path
- `vot-cli --output=<path> --reslang=en <link>` — get the audio translation into English and save it in the specified path
- `vot-cli --subs --output=<path> --lang=en <link>` — get English subtitles for the video and save them in the specified path
- `vot-cli --output="." "https://www.youtube.com/watch?v=X98VPQCE_WI" "https://www.youtube.com/watch?v=djr8j-4fS3A&t=900s"` - example with real data

- `vot-cli [options] [args] <link> [link2] [link3] ...` — general example
- `vot-cli <link>` — get the audio translation from the link
- `vot-cli --help` — show help by commands
- `vot-cli --version` — show script version
- `vot-cli --output=<path> <link>` — get the audio translation from the link and save it to the specified path
- `vot-cli --output=<path> --reslang=en <link>` — get the audio translation into English and save it in the specified path
- `vot-cli --subs --output=<path> --lang=en <link>` — get English subtitles for the video and save them in the specified path
- `vot-cli --output="." "https://www.youtube.com/watch?v=X98VPQCE_WI" "https://www.youtube.com/watch?v=djr8j-4fS3A&t=900s"` - example with real data

### Arguments:
- `--output` — set the path to save the audio translation file
- `--output-file` — set the file name to download (requires specifying a dir to download in "--output" argument)
- `--lang` — set the source video language (look [wiki](https://github.com/FOSWLY/vot-cli/wiki/%5BEN%5D-Supported-langs), to find out which languages are supported)
- `--reslang` — set the language of the received audio file (look [wiki](https://github.com/FOSWLY/vot-cli/wiki/%5BEN%5D-Supported-langs), to find out which languages are supported)
- `--proxy` — set HTTP or HTTPS proxy in the format `[<PROTOCOL>://]<USERNAME>:<PASSWORD>@<HOST>[:<port>]`

- `--output` — set the path to save the audio translation file
- `--output-file` — set the file name to download (requires specifying a dir to download in "--output" argument)
- `--lang` — set the source video language (look [wiki](https://github.com/FOSWLY/vot-cli/wiki/%5BEN%5D-Supported-langs), to find out which languages are supported)
- `--reslang` — set the language of the received audio file (look [wiki](https://github.com/FOSWLY/vot-cli/wiki/%5BEN%5D-Supported-langs), to find out which languages are supported)
- `--proxy` — set HTTP or HTTPS proxy in the format `[<PROTOCOL>://]<USERNAME>:<PASSWORD>@<HOST>[:<port>]`

### Options:
- `-h`, `--help` — Show help
- `-v`, `--version` — Show script version
- `--subs`, `--subtitles` — Get video subtitles instead of audio (the subtitle language for saving is taken from `--reslang`)

- `-h`, `--help` — Show help
- `-v`, `--version` — Show script version
- `--subs`, `--subtitles` — Get video subtitles instead of audio (the subtitle language for saving is taken from `--reslang`)
- `--subs-srt`, `--subtitles-srt` — Get video subtitles in `.srt` format instead of audio

## 💻 Installation

1. Install NodeJS 18+
2. Install vot-cli globally:

```bash
npm install -g vot-cli
```

## ⚙️ Installation for development

1. Install NodeJS 18+
2. Download and unpack the archive from vot-cli
3. Install dependencies:

```bash
npm i
```

4. After successful installation of the modules, run the command

```bash
npm link
```

5. That's it, now you can use vot-cli in your terminal

## 📁 Useful links

1. Browser version: [Link](https://github.com/ilyhalight/voice-over-translation)
2. Script for downloading videos with built-in translation (add-on over vot-cli):
| OS | Shell | Author | Link |
| --- | --- | --- | --- |
| Windows | PowerShell | Dragoy | [Link](https://github.com/FOSWLY/vot-cli/tree/main/scripts)
| Unix | Fish | Musickiller | [Link](https://gitlab.com/musickiller/fishy-voice-over/)
| Linux | Bash | s-n-alexeyev | [Ссылка](https://github.com/s-n-alexeyev/yvt)
| OS | Shell | Author | Link |
| --- | --- | --- | --- |
| Windows | PowerShell | Dragoy | [Link](https://github.com/FOSWLY/vot-cli/tree/main/scripts)
| Unix | Fish | Musickiller | [Link](https://gitlab.com/musickiller/fishy-voice-over/)
| Linux | Bash | s-n-alexeyev | [Ссылка](https://github.com/s-n-alexeyev/yvt)

## ❗ Note

1. Wrap links in quotation marks in order to avoid errors
2. To write to the system partition (for example, to "Disk C" in Windows), administrator rights are required

Expand Down
56 changes: 35 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,72 @@ English version: [Link](https://github.com/FOSWLY/vot-cli/blob/main/README-EN.md
Небольшой скрипт, позволяющий скачать перевод аудио перевод от Яндекса через терминал.

## 📖 Использование

### Примеры использования:
- `vot-cli [options] [args] <link> [link2] [link3] ...` — общий пример
- `vot-cli <link>` — получить перевод аудио по ссылке
- `vot-cli --help` — показать помощь по командам
- `vot-cli --version` — показать версию скрипта
- `vot-cli --output=<path> <link>` — получить перевод аудио по ссылке и сохранить его по указаному пути
- `vot-cli --output=<path> --reslang=en <link>` — получить перевод аудио на английский и сохранить его по указаному пути
- `vot-cli --subs --output=<path> --lang=en <link>` — получить английские субтитры к видео и сохранить их по указанному пути
- `vot-cli --output="." "https://www.youtube.com/watch?v=X98VPQCE_WI" "https://www.youtube.com/watch?v=djr8j-4fS3A&t=900s"` - пример с реальными данными

- `vot-cli [options] [args] <link> [link2] [link3] ...` — общий пример
- `vot-cli <link>` — получить перевод аудио по ссылке
- `vot-cli --help` — показать помощь по командам
- `vot-cli --version` — показать версию скрипта
- `vot-cli --output=<path> <link>` — получить перевод аудио по ссылке и сохранить его по указаному пути
- `vot-cli --output=<path> --reslang=en <link>` — получить перевод аудио на английский и сохранить его по указаному пути
- `vot-cli --subs --output=<path> --lang=en <link>` — получить английские субтитры к видео и сохранить их по указанному пути
- `vot-cli --output="." "https://www.youtube.com/watch?v=X98VPQCE_WI" "https://www.youtube.com/watch?v=djr8j-4fS3A&t=900s"` - пример с реальными данными

### Аргументы:
- `--output` — установить путь сохранения аудио файла перевода
- `--output-file` — установить имя файла для сохранения (требует указания пути сохранения аудио файла перевода в аргументе "--output")
- `--lang` — установить язык исходного видео (см. [вики](https://github.com/FOSWLY/vot-cli/wiki/%5BRU%5D-Supported-langs), чтобы узнать какие языки поддерживаются)
- `--reslang` — установить язык полученного аудио файла (см. [вики](https://github.com/FOSWLY/vot-cli/wiki/%5BRU%5D-Supported-langs), чтобы узнать какие языки поддерживаются)
- `--proxy` — установить HTTP или HTTPS прокси в формате `[<PROTOCOL>://]<USERNAME>:<PASSWORD>@<HOST>[:<port>]`

- `--output` — установить путь сохранения аудио файла перевода
- `--output-file` — установить имя файла для сохранения (требует указания пути сохранения аудио файла перевода в аргументе "--output")
- `--lang` — установить язык исходного видео (см. [вики](https://github.com/FOSWLY/vot-cli/wiki/%5BRU%5D-Supported-langs), чтобы узнать какие языки поддерживаются)
- `--reslang` — установить язык полученного аудио файла (см. [вики](https://github.com/FOSWLY/vot-cli/wiki/%5BRU%5D-Supported-langs), чтобы узнать какие языки поддерживаются)
- `--proxy` — установить HTTP или HTTPS прокси в формате `[<PROTOCOL>://]<USERNAME>:<PASSWORD>@<HOST>[:<port>]`

### Опции:
- `-h`, `--help` — показать помощь по использованию
- `-v`, `--version` — показать версию скрипта
- `--subs`, `--subtitles` — получить субтитры к видео заместо аудио (язык субтитров для сохранения берется из `--reslang`)

- `-h`, `--help` — показать помощь по использованию
- `-v`, `--version` — показать версию скрипта
- `--subs`, `--subtitles` — получить субтитры к видео вместо аудио (язык субтитров для сохранения берется из `--reslang`)
- `--subs-srt`, `--subtitles-srt` — получить субтитры в формате `.srt` к видео вместо аудио

## 💻 Установка

1. Установите NodeJS 18+
2. Установите vot-cli глобально:

```bash
npm install -g vot-cli
```

## ⚙️ Установка для разработки

1. Установите NodeJS 18+
2. Скачайте и распакуйте архив с vot-cli
3. Установите зависимости:

```bash
npm i
```

4. После успешной установки модулей выполнить команду

```bash
npm link
```

5. Готово, теперь, вы можете использовать vot-cli в вашем терминале

## 📁 Полезные ссылки

1. Версия для браузера: [Ссылка](https://github.com/ilyhalight/voice-over-translation)
2. Скрипт для скачивания видео с встроенным переводом (надстройка над vot-cli):
| OS | Оболочка | Автор | Ссылка |
| --- | --- | --- | --- |
| Windows | PowerShell | Dragoy | [Ссылка](https://github.com/FOSWLY/vot-cli/tree/main/scripts)
| Unix | Fish | Musickiller | [Ссылка](https://gitlab.com/musickiller/fishy-voice-over/)
| Linux | Bash | s-n-alexeyev | [Ссылка](https://github.com/s-n-alexeyev/yvt)
| OS | Оболочка | Автор | Ссылка |
| --- | --- | --- | --- |
| Windows | PowerShell | Dragoy | [Ссылка](https://github.com/FOSWLY/vot-cli/tree/main/scripts)
| Unix | Fish | Musickiller | [Ссылка](https://gitlab.com/musickiller/fishy-voice-over/)
| Linux | Bash | s-n-alexeyev | [Ссылка](https://github.com/s-n-alexeyev/yvt)

## ❗ Примечание

1. Оборачивайте ссылки в кавычки, дабы избежать ошибок
2. Для записи в системный раздел (например на "Диск C" в Windows) необходимы права администратора

Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils/utils.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { jsonToSrt } from "../../src/utils/utils.js";

describe("utils", () => {
it("conver YandexSubtitles json to srt", () => {
it("convert YandexSubtitles json to srt", () => {
const jsonYS = [
{ text: "Привет", startMs: 2222.0, durationMs: 3610.0 },
{ text: "мир", startMs: 26050.0, durationMs: 970.0 },
Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.4.3

- Добавлена поддержка загрузки субтитров в `.srt` (#33)

# 1.4.2

- Добавлена поддержка /live/ для YouTube (#32)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vot-cli",
"version": "1.4.2",
"version": "1.4.3",
"description": "A small script that allows you to download an audio translation from Yandex via the terminal.",
"type": "module",
"main": "./src/index.js",
Expand Down

0 comments on commit c5ac229

Please sign in to comment.