Douyin Wallpaper: Turning the DSH Interface into a Video Background

Introduction

DSH’s default interface is clean, but sometimes we need a little background. Watching a video directly in a browser requires switching windows; using a standalone player breaks the integration with DSH’s layout. This plugin combines both: paste a Douyin link, and DSH’s minimal interface becomes its playback backdrop. The video fills the entire window, with the UI floating on top like frosted glass.

What It Is

This is a DSH plugin authored by yangyanlu06, categorized as a network tool. Its core value proposition: within DSH’s web interface, use Douyin videos or photo posts as a dynamic background, with the sidebar, messages, and input box rendered as frosted glass floating over the visuals.

Core Features

Video Background Playback

After pasting a Douyin video share link, the plugin fetches the direct video URL, downloads it locally, and plays it fullscreen. The video size limit is 240 MB. The first run takes approximately 15–25 seconds for the initial screen (spawning Edge + downloading). Loop playback and mute are supported.

Photo Post Background

For photo posts (/note/), a single image slowly zooms in; multiple images cross-fade every 7 seconds. Each image is capped at 16 MB, with a maximum of 35 images.

For multi-video carousels (/slides/), the plugin selects the first playable video from the browser.

Local Video

You can directly paste the absolute path of a local video file to use it as a wallpaper.

Control Panel

The panel provides the following controls:

  • Glass opacity: the panel’s opacity — the background receives only 0.62× its weight, so the video retains its own colors
  • Blur
  • Darkening
  • Brightness: default 130%
  • Scale
  • Mute / Loop toggles
  • Cover strip: switch between downloaded works
  • ✕: delete the current wallpaper
  • Toggle: temporarily turn the wallpaper off

Data Storage

The default data directory is ~/.dsh-douyin-wallpaper, changeable via the environment variable DSH_DWP_DATA_DIR. The directory structure is as follows:

  • state.json: enabled state, current wallpaper, appearance settings
  • lapian.json: two paths for the local stream-fetching script (optional)
  • media/<id>.mp4: downloaded video
  • media/<id>-<n>.<ext>: the nth image in a photo post

The entire directory can be deleted at any time.

Installation & Activation

In DSH, go to Plugins → Add Plugin and paste the repository URL, or run the following from the command line:

dsh plugin --profile web add github:yangyanlu06/dsh-douyin-wallpaper

After installation, refresh the page. A ▶ icon will appear at the bottom of the sidebar, to the left of the Settings button.

Typical Usage

  1. In Douyin, tap “Share → Copy Link” on a work to copy the full text (including the 【Author’s work】 portion);
  2. Click ▶ to open the panel, paste into the input field, and press Enter;
  3. The video will be resolved to a direct URL, downloaded locally, then played fullscreen.

On first use, defaults prioritize video clarity: brightness at maximum (130%), blur and darkening both at 0, glass opacity at the minimum (30%). If you find the text hard to read, increase blur to 6–10 and glass opacity to around 60.

Media Fetching Methods

Douyin’s official APIs are closed off to server-side consumers. The share page’s SSR returns videoInfoRes / noteInfoRes as null, and the web detail API uniformly returns 403. The plugin adopts the following strategies:

Preferentially calls the local douyin_lapian.py (Playwright drives system Edge; headless mode does not trigger CAPTCHA; extracts video.play_addr from the page’s own /aweme/v1/web/ JSON). The bridge script is located at tools/lapian_bridge.py.

Photo Posts

First tries DSH_DWP_PARSE_API_ALBUM, then falls back to fetching www.douyin.com/note/<id> with a Baiduspider UA (Douyin still server-side renders for crawlers).

Image Format

The actual image format is often WebP. The file extension is determined by file header before writing to disk.

Third-Party API

If no script is configured, it falls back to a third-party parsing API, defaulting to api.xingzhige.com, changeable via the environment variable DSH_DWP_PARSE_API.

Local Stream Script Configuration

// ~/.dsh-douyin-wallpaper/lapian.json
{ "script": "D:\\…\\douyin_lapian.py", "python": "D:\\…\\.venv\\Scripts\\python.exe" }

Or via environment variables DSH_DWP_LAPIAN / DSH_DWP_PYTHON. If only script is provided, the plugin looks for .venv\Scripts\python.exe next to it.

Note: Once a script is configured, a script failure results in a direct error — it will not silently fall back to the third-party API (corresponding to the “fail-fast, no retry” principle). To switch to the parsing API, simply move lapian.json out of the way.

Use Cases & Cautions

Use Cases

  • You want to play Douyin videos as a background within the DSH interface
  • You need a dynamic background to boost focus or ambiance
  • You need to quickly switch between different videos as wallpapers

Cautions

  • Douyin CDN direct links have an expiration (roughly one month), so the plugin downloads to disk before playing. Re-importing the same work is deduplicated by its canonical page URL — no redundant downloads.
  • The wallpaper only works in the dsh web and desktop web interface.
  • No Tool registration, no prompt injection, no session writing — zero token overhead for the model.
  • The stream-fetching methods (including empirical refutations and pitfalls) are documented in douyin-api-bypass. The bridge script is the same file on both sides.
  • Collections, live streams, and private works are not supported.

Pre-Installation Checklist

Before installing, review the source code and license. The plugin is licensed under MIT.

Summary

This plugin uses local stream fetching and a frosted-glass effect to transform DSH’s interface from a plain white background into a dynamic video backdrop. It does not rely on third-party services, incurs zero token overhead for the model, and is well-suited for developers who want a dynamic background within DSH.

  • Plugin directory: https://www.skillhub.cn/plugins/yangyanlu06/dsh-douyin-wallpaper
  • GitHub: https://github.com/yangyanlu06/dsh-douyin-wallpaper
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye