Giter VIP home page Giter VIP logo

deeplx's Introduction

GitHub Workflow Go Version Go Report Maintainability GitHub License Docker Pulls Releases

Related Projects

Link Description Maintainer
OwO-Network/PyDeepLX Python Package for DeepLX OwO-Network
OwO-Network/gdeeplx Golang Package for DeepLX OwO-Network
ifyour/deeplx JS Package for DeepLX (JavaScript) ifyour

Discussion Group

Telegram Group

Description

  • DeepLX is listening to 0.0.0.0:1188 by default. You can modify the listening port by yourself.
  • DeepLX is using DeepL Free API.
  • DeepLX is unlimited to the number of requests.

Usage

Request Parameters

  • text: string
  • source_lang: string
  • target_lang: string

Response

{
  "alternatives": [
    "no one else",
    "there is no other person (idiom); there is no one else",
    "there is no other person"
  ],
  "code": 200,
  "data": "there is no one else",
  "id": 8352115005,
  "source_lang": "ZH",
  "target_lang": "EN"
}

Specify the port (Optional)

Thanks to cijiugechu for his contribution to make this feature possible for this project!

./deeplx -p 3333
# or
./deeplx -port 3333

Set access password (Optional)

To prevent abuse of your public API, you can use a token to restrict translation requests.

./deeplx -token hellodeeplx
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

# dockerhub
docker run -itd -p 1188:1188 missuo/deeplx:latest

Run with Docker Compose

mkdir deeplx
cd deeplx
wget https://raw.githubusercontent.com/OwO-Network/DeepLX/main/docker-compose.yaml
# docker compose v1
docker-compose up -d
# or docker compose v2
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)

Homebrew has been fixed in the latest version and works perfectly.

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

  1. Download the latest release of DeepL X.
sudo mv deeplx_darwin_amd64 /usr/local/bin/deeplx
sudo chmod +x /usr/local/bin/deeplx
  1. 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
  1. 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

Setup on Bob App

  1. Install bob-plugin-deeplx on Bob.

  2. Setup the API. (If you use Brew to install locally you can skip this step) c5c19dd89df6fae1a256d

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.

  1. Install Latest immersive-translate on your browser.

  2. Click on Developer Settings in the bottom left corner. Enable Beta experimental features.

  3. Set the URL. (If you are not deploying locally, you need to change 127.0.0.1 to the IP of your server)

6a48ba28621f2465028f0

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.

License

FOSSA Status

deeplx's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.