feat/player-parsers: add README

This commit is contained in:
Kentai Radiquum 2025-05-30 01:15:37 +05:00
parent 8486e9eb82
commit a55a6c93dc
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
2 changed files with 230 additions and 0 deletions

115
player-parsers/README.RU.md Normal file
View file

@ -0,0 +1,115 @@
# AniX - Player Parsers
Данный под-проект позволяет получить прямые ссылки на видеофайлы с источников Sibnet, Kodik, Libria
Он может использоваться как для основного проекта AniX, так и как отдельный сервис.
В основном проекте, парсеры используются для работы своего плеере, если вам не важна данная функция, вы можете не развёртывать данный суб-сервис.
Лицензия: [MIT](../LICENSE)
## Использование
В строке веб-браузера необходимо ввести:
`<http|https>://<ip|domain><:port>/?url=<VIDEO_URL>&player=<PLAYER_SOURCE>`
где:
- http|https - схема по которой будет осуществляться подключение к сервису
- ip|domain - IP адрес или домен на котором находится сервис
- :port - порт сервиса, опционально
- VIDEO_URL - ссылка на видео от источника
- PLAYER_SOURCE - источник, один из: kodik, sibnet, libria
Ответ:
- 500|400: произошла ошибка, подробнее в строке `message` в теле ответа
- 200: запрос прошёл успешно
## Развёртывание
> В связи с спецификой источников, рекомендуется использовать виртуальный сервер в россии или нидерландах, т.к. они могут быть недоступны из других стран.
>
> Из-за данной специфики, парсеры невозможно развернуть на edge сервисах, таких как CloudFlare Workers или Deno, а только на отдельном сервере.
<details>
<summary>С помощью docker</summary>
Требования:
- [docker](https://docs.docker.com/engine/install/)
### Пре-билд
1. выполните комманду:
`docker run -d --name anix-player -p 7000:7000 ghcr.io/radiquum/anix-player-parser:29-05-2025`
### Ручной билд
Доп. Требования:
- [git](https://git-scm.com/)
1. Клонируйте репозиторий `git clone https://github.com/Radiquum/AniX`
2. Переместитесь в директорию репозитория `cd AniX`
3. Переместитесь в директорию парсеров `cd player-parsers`
4. Выполните команду `docker build -t anix-player-parser .`
5. После окончания, выполните команду: `docker run -d --restart always --name anix-player -p 7000:7000 anix-player-parser`
### Обозначения
- -d - запустить контейнер в фоне
- --restart always - всегда запускать после перезагрузки сервера
- --name - название контейнера
- -p - порт контейнера который будет доступен из вне. ПОРТ:7000
### После развёртывания
Сервис будет доступен по адресу: `http://<ВАШ IP><:ВАШ ПОРТ>/`
### Примечание
Для использования своего домена и поддержки протокола https, вы можете использовать traefik или другой reverse-proxy, с сертификатом SSL.
Полезные ссылки:
- [Конвертер из команды docker run в синтакс для docker compose](https://it-tools.tech/docker-run-to-docker-compose-converter)
- [Как настроить traefik + свой домен + SSL](https://letmegooglethat.com/?q=how+to+setup+traefik+with+custom+domain+and+ssl+certificate+from+lets+encrypt%3F)
</details>
<details>
<summary>С помощью pm2</summary>
Требования:
- [git](https://git-scm.com/)
- [nodejs 23+ с npm](http://nodejs.org/)
- [pm2](https://pm2.keymetrics.io/)
Инструкция:
1. Клонируйте репозиторий `git clone https://github.com/Radiquum/AniX`
2. Переместитесь в директорию репозитория `cd AniX`
3. Переместитесь в директорию парсеров `cd player-parsers`
4. Выполните команду `pm2 start index.ts -n anix-player-parser`
### Обозначения
- -n - название сервиса в pm2
### После развёртывания
Сервис будет доступен по адресу: `http://<ВАШ IP>:7000/`
### Примечание
Для автоматического запуска приложения, рекомендуется настроить pm2 на автозапуск, с помощью команды: `pm2 startup`
Полезные ссылки:
- [PM2: подходим к вопросу процесс-менеджмента с умом @ Habr](https://habr.com/ru/articles/480670/)
</details>

115
player-parsers/README.md Normal file
View file

@ -0,0 +1,115 @@
# AniX - Player Parsers
This sub-project allows obtaining direct video file links from sources Sibnet, Kodik, Libria
It can be used both for the main AniX project and as a standalone service.
In the main project, the parsers are used to operate the internal player. If this function is not important to you, you may choose not to deploy this sub-service.
License: [MIT](../LICENSE)
## Usage
In the web browser address bar, enter:
`<http|https>://<ip|domain><:port>/?url=<VIDEO_URL>&player=<PLAYER_SOURCE>`
where:
- http|https - the scheme used to connect to the service
- ip|domain - IP address or domain where the service is hosted
- :port - service port, optional
- VIDEO_URL - the link to the video from the source
- PLAYER_SOURCE - the source, one of: kodik, sibnet, libria
Response:
- 500|400: an error occurred, see the `message` field in the response body for details
- 200: request was successful
## Deployment
> Due to the nature of the sources, it is recommended to use a virtual server in Russia or the Netherlands, as they may be inaccessible from other countries.
>
> Because of this specificity, the parsers cannot be deployed on edge services like CloudFlare Workers or Deno, only on a dedicated server.
<details>
<summary>Using docker</summary>
Requirements:
- [docker](https://docs.docker.com/engine/install/)
### Pre-built
1. Run the command:
`docker run -d --name anix-player -p 7000:7000 ghcr.io/radiquum/anix-player-parser:29-05-2025`
### Manual build
Additional Requirements:
- [git](https://git-scm.com/)
1. Clone the repository `git clone https://github.com/Radiquum/AniX`
2. Navigate to the repository directory `cd AniX`
3. Navigate to the parsers directory `cd player-parsers`
4. Run the command `docker build -t anix-player-parser .`
5. Once finished, run the command: `docker run -d --restart always --name anix-player -p 7000:7000 anix-player-parser`
### Legend
- -d - run the container in background
- --restart always - always restart after server reboot
- --name - container name
- -p - container port accessible externally. PORT:7000
### After deployment
The service will be available at: `http://<YOUR IP><:YOUR PORT>/`
### Note
To use your own domain and support the https protocol, you can use traefik or another reverse-proxy with an SSL certificate.
Useful links:
- [Docker run to docker compose syntax converter](https://it-tools.tech/docker-run-to-docker-compose-converter)
- [How to setup traefik + custom domain + SSL](https://letmegooglethat.com/?q=how+to+setup+traefik+with+custom+domain+and+ssl+certificate+from+lets+encrypt%3F)
</details>
<details>
<summary>Using pm2</summary>
Requirements:
- [git](https://git-scm.com/)
- [nodejs 23+ with npm](http://nodejs.org/)
- [pm2](https://pm2.keymetrics.io/)
Instructions:
1. Clone the repository `git clone https://github.com/Radiquum/AniX`
2. Navigate to the repository directory `cd AniX`
3. Navigate to the parsers directory `cd player-parsers`
4. Run the command `pm2 start index.ts -n anix-player-parser`
### Legend
- -n - service name in pm2
### After deployment
The service will be available at: `http://<YOUR IP>:7000/`
### Note
To enable automatic application start, it is recommended to configure pm2 to start on boot with the command: `pm2 startup`
Useful links:
- [PM2: smart approach to process management @ Habr](https://habr.com/ru/articles/480670/)
</details>