mirror of
https://github.com/OwO-Network/DeepLX.git
synced 2024-11-16 04:12:20 +08:00
DeepL Free API (No TOKEN required)
.github | ||
.cross_compile.sh | ||
.gitignore | ||
compose.yaml | ||
deeplx.service | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
install.sh | ||
LICENSE | ||
main.go | ||
me.missuo.deeplx.plist | ||
README.md |
Related Projects
Link | Description | Maintainer |
---|---|---|
OwO-Network/PyDeepLX | Python Package for DeepLX | Vincent Yang |
OwO-Network/gdeeplx | Golang Package for DeepLX | Vincent Yang |
ifyour/deeplx | JS Package for DeepLX (JavaScript) | ifyour |
deeplx-serverless | Serverless Package for DeepLX | LegendLeo |
Discussion Group
Description
DeepLX
is listening to0.0.0.0:1188
by default. You can modify the listening port by yourself.DeepLX
is usingDeepL
Free API.DeepLX
is unlimited to the number of requests.
Usage
For Developer
Request Parameters
- text: string
- source_lang: string
- target_lang: string
Response
{
"alternatives": [
"Did you hear about this?",
"You've heard about this?",
"You've heard of this?"
],
"code": 200,
"data": "Have you heard about this?",
"id": 8356681003,
"method": "Free",
"source_lang": "ZH",
"target_lang": "EN"
}
Custom Options
The following settings are optional and not required.
-port
or-p
: Listening port. Default is1188
.-token
: Access token. If you have set it up, each request will need to include anAuthorization
header.-authkey
: DeepL OfficialAuthKey
. If you have set it up, after the 429 response, the official AuthKey will be used for the request. If multiple authKeys are used simultaneously, they need to be separated by commas.
Requesting a token-protected DeepLX API instance using the curl
curl -X POST http://localhost:1188/translate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_access_token" \
-d '{
"text": "Hello, world!",
"source_lang": "EN",
"target_lang": "DE"
}'
Run with Docker
# ghcr.io
docker run -itd -p 1188:1188 ghcr.io/owo-network/deeplx:latest
# custom environment variables
docker run -itd -p 1188:1188 -e "TOKEN=helloxxx" -e "AUTHKEY=xxxx:fx" ghcr.io/owo-network/deeplx:latest
# dockerhub
docker run -itd -p 1188:1188 missuo/deeplx:latest
# custom environment variables
docker run -itd -p 1188:1188 -e "TOKEN=helloxxx" -e "AUTHKEY=xxxx:fx" missuo/deeplx:latest
Run with Docker Compose
mkdir deeplx
cd deeplx
wget https://raw.githubusercontent.com/OwO-Network/DeepLX/main/compose.yaml
# modify environment variables
# environment:
# - TOKEN=helloxxx
# - AUTHKEY=xxxxxxx:fx
# docker compose
docker compose up -d
Run on Linux Server
bash <(curl -Ls https://raw.githubusercontent.com/OwO-Network/DeepLX/main/install.sh)
# or
bash <(curl -Ls https://qwq.mx/deeplx)
Run on Mac
Homebrew (Recommended)
brew tap owo-network/brew
brew install deeplx
brew services start owo-network/brew/deeplx
# Update to the latest version
brew update
brew upgrade deeplx
brew services restart owo-network/brew/deeplx
# View the currently installed version
brew list --versions deeplx
Manual
- Download the latest release of DeepL X.
sudo mv deeplx_darwin_amd64 /usr/local/bin/deeplx
sudo chmod +x /usr/local/bin/deeplx
- Download the
me.missuo.deeplx.plist
to~/Library/LaunchAgents
.
wget https://raw.githubusercontent.com/OwO-Network/DeepLX/main/me.missuo.deeplx.plist -O ~/Library/LaunchAgents/me.missuo.deeplx.plist
- Run following command.
launchctl load ~/Library/LaunchAgents/me.missuo.deeplx.plist
launchctl start ~/Library/LaunchAgents/me.missuo.deeplx.plist
Install from AUR
paru -S deeplx-bin
After installation, start the daemon with the following command.
systemctl daemon-reload
systemctl enable deeplx
Run on Sealos
Setup on Bob App
-
Install bob-plugin-deeplx on Bob.
-
Setup the API. (If you use Brew to install locally you can skip this step)
Setup on immersive-translate
It is not recommended, because the immersive-translate
will send many requests in a short time, which will cause the DeepL API
to block your IP.
-
Install Latest immersive-translate on your browser.
-
Click on Developer Settings in the bottom left corner. Enable Beta experimental features.
-
Set the URL. (If you are not deploying locally, you need to change 127.0.0.1 to the IP of your server)
Use in Python
import httpx, json
deeplx_api = "http://127.0.0.1:1188/translate"
data = {
"text": "Hello World",
"source_lang": "EN",
"target_lang": "ZH"
}
post_data = json.dumps(data)
r = httpx.post(url = deeplx_api, data = post_data).text
print(r)
Backup the Docker Image of zu1k
docker run -itd -p 1188:80 missuo/deeplx-bk
This docker image is not related to this project, as the original author deleted the image, it is only for backup.