dallopen / deeplx

DeepL Pro to free API

Home Page:https://deeplx.2077000.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI Docker Image

deeplx

Rust封装的DeepL Free API服务

Features

  • 仅支持DeepL Pro
  • 支持池化
  • 支持代理池
  • 支持高并发
  • 无文本限制

安装

  • Ubuntu(Other Linux)

GitHub Releases 中有预编译的二进制文件,以Ubuntu为例:

wget https://github.com/gngpp/deeplx/releases/download/v0.1.2/deeplx-0.1.2-x86_64-unknown-linux-musl.tar.gz
tar -xf deeplx-0.1.2-x86_64-unknown-linux-musl.tar.gz
mv ./deeplx /bin/deeplx

# 前台运行进程
deeplx run

# 后台运行进程
deeplx start

# 停止后台进程
deeplx stop

# 重启后台进程
deeplx restart

# 查看后台进程状态
deeplx ps

# 查看后台进程日志
deeplx log
  • Docker

镜像源支持gngpp/deeplx:latest / ghcr.io/gngpp/deeplx:latest

你可以使用 docker pull 命令来从这些源获取镜像,例如:

docker pull gngpp/deeplx:latest

或者:

docker pull ghcr.io/gngpp/deeplx:latest

然后,你可以使用 docker run 命令来运行这个镜像,例如:

docker run -d --name deeplx -p 8000:8000 -t gngpp/deeplx:latest run

或者:

docker run -d --name deeplx -p 8000:8000 -t ghcr.io/gngpp/deeplx:latest run

这两个命令会运行你刚刚拉取的镜像。你可以在 docker run -d 命令后面添加你的程序的命令和参数,例如:

docker run -d --name deeplx -p 8000:8000 -t gngpp/deeplx:latest run --debug --bind 0.0.0.0:8000 --api-key your_api_key --dl-session your_dl_session --proxies your_proxies

或者:

docker run -d --name deeplx -p 8000:8000 -t ghcr.io/gngpp/deeplx:latest run --debug --bind 0.0.0.0:8000 --api-key your_api_key --dl-session your_dl_session --proxies your_proxies

在这些命令中,你需要将 your_api_keyyour_dl_sessionyour_proxies 替换为你的实际值。

使用

  1. 启动参数说明
  • -d, --debug 日志开启DEBUG模式
  • -b, --bind 服务监听Socket地址,默认0.0.0.0:8000
  • tls-cert Https证书路径
  • tls-key Https私钥路径
  • -A, --api-key deeplx的翻译接口鉴权密钥
  • -D --dl-session 可选的dl_sessioncookie值,多个dl_session使用,分隔
  • -x, --proxies 代理,支持协议http/https/socks5/socks5h,多个代理使用,分隔
  1. 启动

第一次启动可以不设置--dl-session,那么就需要在浏览器打开: http://localhost:8000/pool,进行手动提交到dl_session池中。

  1. 命令参考
> deeplx -h
DeepL Free API

Usage: deeplx
       deeplx <COMMAND>

Commands:
  run      Run server
  start    Start server daemon
  restart  Restart server daemon
  stop     Stop server daemon
  log      Show the server daemon log
  ps       Show the server daemon process
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version


> deeplx run -h
Run server

Usage: deeplx run [OPTIONS]

Options:
  -d, --debug                    Debug mode
  -b, --bind <BIND>              Bind address [default: 0.0.0.0:8000]
      --tls-cert <TLS_CERT>      TLS certificate file
      --tls-key <TLS_KEY>        TLS private key file
  -A, --api-key <API_KEY>        API key
  -D, --dl-session <DL_SESSION>  Deepl `dl_session`
  -x, --proxies <PROXIES>        Deepl client proxy [env: PROXIES=]
  -h, --help                     Print help

编译

Linux编译,Ubuntu机器为例:

apt install build-essential
apt install cmake
apt install libclang-dev

git clone https://github.com/gngpp/deeplx.git && cd deeplx
cargo build --release

About

DeepL Pro to free API

https://deeplx.2077000.xyz

License:MIT License


Languages

Language:Rust 86.9%Language:Shell 9.6%Language:Dockerfile 3.5%