Skip to content
/ vot.js Public

An unofficial library for interacting with the Yandex VOT API, which supports working with JavaScript, TypeScript, and also has built-in types for Typebox.

License

Notifications You must be signed in to change notification settings

FOSWLY/vot.js

Repository files navigation

vot.js

GitHub Actions npm ru en

An unofficial library for interacting with the Yandex VOT API, which supports working with JavaScript, TypeScript, and also has built-in parted types for Typebox.

The library supports working with worker servers, to do this, you need to create a VOTWorkerClient client and specify the domain of the worker server, for example vot-worker.toil.cc.

Installation

Installation for Bun:

bun add vot.js

Installation for NPM:

npm install vot.js

Getting started

To start working with the API, you need to create a VOT Client. This can be done using the line provided below.

Standard Client:

const client = new VOTClient();

const videoData = await client.getVideoData("https://youtu.be/LK6nLR1bzpI");

const result = await client.translateVideo({ videoData });

Proxying via vot-worker:

const client = new VOTWorkerClient({
  host: "vot.toil.cc",
});

You can see more code examples here

Limitations

  1. The library can't translate videos longer than 4 hours
  2. To translate udemy, coursera, coursehunter and other sites that have authorization, you must create your own handlers

Build

To build, you must have:

  • Bun
  • Protoc (if you are building with the update of the .proto file)

Don't forget to install the dependencies:

bun install

Build without updating .proto

This build option should be used in most cases if your changes do not affect the .proto file.

bun build:bun

Build with an update .proto

If you want to build the library by updating the proto files, then you need to install protoc 3+ and add it to the Path.

Building from Linux (maybe on MacOS it will work too):

bun rebuild:linux

Building from Windows:

bun rebuild:win

Building TypeScript types

You can use this build option if you only want to build types for TypeScript:

bun build:declaration

Building a TypeBox of Types

You can use this build option if you only want to build types for TypeBox:

bun build:typebox

Building only .proto file

You can use this build option if you only want to convert the .proto file to .ts (this will not update the file in the /dist folder):

Building from Linux (maybe on MacOS it will work too):

bun build:proto-linux

Building from Windows:

bun build:proto-win

Tests

The library has minimal test coverage to check its performance.

Run the tests:

bun test

About

An unofficial library for interacting with the Yandex VOT API, which supports working with JavaScript, TypeScript, and also has built-in types for Typebox.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published