Skip to content

NextWeb4/deepseek-translation-studio

Repository files navigation

English | 简体中文 | 日本語

DeepSeek Translation Studio

A Windows PySide6 workspace for DeepSeek API/Web translation, long SRT continuation, visible-answer capture, history, export, and distributable desktop packaging.

Last commit Repository size GitHub stars Python 3.12 or newer

DeepSeek Translation Studio main window

The repository also builds DeepSeek Conversation Capture, a stripped standalone edition for everyday DeepSeek Web prompts and visible-answer capture.

DeepSeek Conversation Capture standalone window

Two Desktop Applications

DeepSeek Translation Studio

  • PySide6 workspace with source editor, prompt templates, editable prefix/suffix, final-prompt preview, result view, history, logs, and dark-mode support.
  • Defaults to DeepSeek Web and can switch between Web and OpenAI-compatible API modes.
  • Supports translation/SRT automation and general conversation capture task modes.
  • Stores prompt templates, history, and Web capture versions in SQLite.
  • Exports TXT, Markdown, and SRT; SRT export writes translated text with UTF-8 BOM.
  • API mode can list models and test credentials through {API Base URL}/models without making a chat-completion request.

DeepSeek Conversation Capture

  • Starts from conversation_main.py and fixes requests to engine = web and task_mode = general_capture.
  • Keeps prompt sending, visible Web answer capture, stop/cleanup, automatic continuation after truncation, account-profile switching, history, and TXT/Markdown export.
  • Omits API settings, task-mode selection, SRT export, and subtitle completion controls.
  • Uses a separate %LOCALAPPDATA%\DeepSeekConversationCapture data directory so it does not mix state with the full studio.

Requirements and Setup

  • Windows desktop environment.
  • Python 3.12 or newer.
  • PySide6, Playwright, Loguru, pytest, and PyInstaller as listed in requirements.txt.
  • Playwright Chromium for Web mode. Installing it downloads a browser runtime.
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m playwright install chromium

The repository also provides:

python scripts\install_playwright.py

Run

python main.py
python conversation_main.py

For first-time Web use, sign in manually when DeepSeek opens. Automatic login, CAPTCHA bypass, and access-control circumvention are outside the project scope.

Web Mode

Web mode uses a Playwright persistent context and captures only text already visible in the page DOM. It does not rely on the clipboard or hidden API responses.

  • The full studio stores its browser profile under %LOCALAPPDATA%\DeepSeekTranslationStudio\browser_profile.
  • “Switch Web account” moves the current profile into browser_profile_backups and creates a fresh profile. It is disabled while a task is running.
  • Visible mutations and snapshots are recorded in web_capture_versions; successful continuation clicks update history.continue_click_count.
  • The engine recognizes visible 继续生成, 继续, Continue, and Continue generating controls only after a safe truncation state. It does not click login, registration, payment, deletion, or unrelated “continue” controls.
  • General capture treats even SRT-looking input as ordinary conversation and never enables SRT cleanup or completion logic.

If DeepSeek reports that the server is busy and shows a continuation control, the engine waits approximately 180 seconds between retries and clicks only “continue generation”. It does not select fast mode or disable the user's deep-thinking quality setting.

SRT Workflow

For translation/SRT tasks, the service tracks coverage by subtitle identity and timecode rather than text length.

  • It captures visible SRT-like DOM blocks, discards incomplete number/timecode fragments, and prefers newer complete captures for the same subtitle.
  • Source-copy protection rejects unchanged nontrivial source subtitles. Short Chinese numbers/names and punctuation or symbols such as and ... may remain unchanged when that is a valid translation.
  • Completion requires all source subtitles with no internal gap; the UI displays covered/total.
  • A truncated tail continues in the current conversation first. Large internal gaps restart from the first missing region; small gaps are requested explicitly after the tail is complete.
  • When the current conversation reaches its continuation limit, the service recalculates actual coverage before opening a new page for missing subtitles only.
  • Refusals, reasoning text, requirement analysis, controls, and DeepSeek footer text are excluded from the final SRT. An incomplete result is saved with warning status rather than presented as complete.
  • Closing the browser cancels the task while retaining valid text already captured. Pressing Stop asks the page to stop and then organizes the current partial result.

API Mode

Configure API Key, Base URL, and model in the UI, or set defaults before launching the full studio:

$env:DEEPSEEK_API_KEY="your-key"
$env:DEEPSEEK_API_BASE="https://api.deepseek.com"
$env:DEEPSEEK_MODEL="deepseek-chat"
python main.py

The API key is not written to history or logs. Model listing and connection testing run off the PySide6 main thread and use only the /models endpoint.

Prompts and Data

Prompt templates are seeded from src/resources/default_prompts.json and stored in SQLite. An editable template must contain:

{{TEXT}}

Default full-studio data directory:

%LOCALAPPDATA%\DeepSeekTranslationStudio

It contains studio.sqlite3, browser_profile/, and logs/studio.log. Override it with DST_APP_DATA_DIR. Override the stripped edition with DCC_APP_DATA_DIR.

$env:DST_APP_DATA_DIR="D:\runtime\translation-studio"
$env:DCC_APP_DATA_DIR="D:\runtime\conversation-capture"

Do not commit API keys, Authorization headers, cookies, SQLite databases, logs, browser profiles, or downloaded build tools.

Test

pytest

The repository has focused tests for UI/service behavior, capture filtering, browser profiles, API requests, export, prompt/history services, cancellation, and extensive SRT continuation/merge edge cases. No lint or format command was found.

Entrypoint smoke modes also exist:

python main.py --smoke-test
python main.py --playwright-smoke-test
python conversation_main.py --smoke-test

Build and Release

python scripts\build_exe.py
python scripts\build_conversation_exe.py

Expected application folders:

dist\DeepSeek Translation Studio\DeepSeek Translation Studio.exe
dist\DeepSeek Conversation Capture\DeepSeek Conversation Capture.exe

Keep the entire folder. Web mode needs the bundled _internal\playwright\...\.local-browsers\chromium-* runtime; copying only the EXE will not work.

Expected packages:

dist\packages\DeepSeek Translation Studio-0.1.0.msi
dist\packages\DeepSeek Translation Studio-0.1.0-portable.zip
dist\packages\DeepSeek Conversation Capture-0.1.0.msi
dist\packages\DeepSeek Conversation Capture-0.1.0-portable.zip

The portable launchers point DST_APP_DATA_DIR or DCC_APP_DATA_DIR at a sibling data\ directory. PyInstaller creates the Windows applications; WiX Toolset 3.14 is downloaded to .build_tools when needed for MSI creation. Release packages include the main Chromium build, not chromium_headless_shell-*, to avoid Windows path-length failures.

Publish the four packages with:

powershell -NoProfile -ExecutionPolicy Bypass -File scripts\publish_github_release.ps1

The script targets NextWeb4/deepseek-translation-studio and tag v0.1.0; credentials are read at runtime and are not stored in the repository, remote, or logs.

Project Structure

Path Responsibility
main.py, conversation_main.py Full and stripped application entry points
src/ui/ PySide6 windows, widgets, and theme
src/services/ Translation orchestration, capture, SRT merging, profiles, prompts, history, and export
src/engines/ DeepSeek API and Playwright Web engines
src/database/ SQLite schema, initialization, migration, and repositories
src/models/ Prompt, history, and task models
src/config/ Constants and runtime settings
tests/ pytest regression suites
scripts/ Browser setup, application packaging, and GitHub release publication

Not Implemented

OCR, PDF translation, DOCX batch translation, translation memory, multiple model providers, a complex theme system, and a plugin system are not implemented.

License

No LICENSE file was found in the audited repository. Dependency distribution obligations still apply: PySide6 licensing must be evaluated for distribution; Playwright is Apache-2.0; PyInstaller uses GPL-2.0-or-later with its bootloader exception; WiX 3.14 uses the Microsoft Reciprocal License.

About

Windows Python/PySide6 translation studio for DeepSeek Web/API workflows, SRT continuation, capture, and packaging.

Topics

Resources

Security policy

Stars

30 stars

Watchers

2 watching

Forks

Packages

 
 
 

Contributors