← 返回 Skills 市场
likely7

doubaoimg

作者 Likely7 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
208
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install doubaoimages
功能描述
Generate images with Doubao web chat, extract the final generated image URL from the page, save the image locally, and return the saved local path. Use when...
使用说明 (SKILL.md)

Doubao Local Image Saver

Use this skill when the user wants to:

  • use 豆包网页生图
  • save the final generated image to local disk
  • get back the saved local file path

Inputs

Collect or infer:

  • prompt: image prompt for 豆包
  • output_path: local save path

If the user does not specify an output path, default to a timestamped file name in:

  • C:\Users\Administrator\.openclaw\workspace mp\

Use this naming pattern:

  • doubao-YYYYMMDD-HHMMSS.png

Example:

  • C:\Users\Administrator\.openclaw\workspace mp\doubao-20260318-131500.png

Workflow

1) Open Doubao

Open:

  • https://www.doubao.com/chat/

Assume the user may already be logged in. Do not force re-login unless the page clearly requires it.

2) Submit the prompt

Preferred path:

  1. Focus the chat textbox
  2. Enter the prompt
  3. Send it
  4. Wait for generation to complete

If normal browser click/type fails on the textbox, use browser evaluate fallback.

Use this pattern when needed:

() => {
  const ta = document.querySelector('textarea');
  if (!ta) return { ok: false, reason: 'no textarea' };
  const text = 'PROMPT_HERE';
  const setter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set;
  setter.call(ta, text);
  ta.dispatchEvent(new Event('input', { bubbles: true }));
  ta.dispatchEvent(new Event('change', { bubbles: true }));
  return { ok: true, valueLength: ta.value.length };
}

If Enter does not submit, click the likely send button near the lower-right side of the input area.

3) Extract the highest-quality image URL

Do not assume the first visible image URL is the original file. Visible Doubao images often use display URLs containing clues like:

  • downsize
  • watermark

Those are usually preview assets, not the best download source.

Use this priority order:

Priority A: use Doubao's native download flow

After generation completes:

  1. click the chosen generated image to open preview/lightbox
  2. look for a button whose text or label suggests 下载
  3. click that button if present
  4. if the browser exposes a direct URL, prefer that asset over page image URLs

Priority B: inspect preview-state DOM images

If preview opens but no explicit download button is found, inspect images again while the large preview is open. Prefer the image candidate with the largest natural dimensions.

Use this pattern:

() => {
  return [...document.images]
    .map((img, i) => ({
      i,
      src: img.src,
      width: img.naturalWidth,
      height: img.naturalHeight,
      alt: img.alt || ''
    }))
    .filter(x => x.width > 100 && x.height > 100)
    .filter(x => !x.src.startsWith('data:image/svg+xml'))
    .sort((a, b) => (b.width * b.height) - (a.width * a.height));
}

Priority C: inspect page images and rank quality

If no preview/download path works, inspect normal page images and rank them. Use this pattern:

() => {
  return [...document.images]
    .map((img, i) => ({
      i,
      src: img.src,
      width: img.naturalWidth,
      height: img.naturalHeight,
      alt: img.alt || '',
      score: (img.naturalWidth * img.naturalHeight)
    }))
    .filter(x => x.width > 100 && x.height > 100)
    .filter(x => !x.src.startsWith('data:image/svg+xml'))
    .sort((a, b) => b.score - a.score);
}

Pick the best result by this order:

  1. native download result
  2. largest preview-state image URL
  3. largest page image URL without downsize / watermark
  4. if all page URLs are processed previews, use the largest one as fallback

When comparing URLs, prefer the one that:

  • has the largest dimensions
  • comes from preview/download state rather than the base chat card
  • does not contain downsize
  • if available, prefer image_pre or original image-generation asset URLs over tiny chat thumbnails
  • only accept watermark variants when they are still the highest-quality accessible preview
  • looks like an original CDN asset rather than a transformed display asset

4) Save the image locally

Download the chosen URL directly to a local file.

If the user did not provide output_path, generate one with a timestamp first.

Use this pattern:

@'
from datetime import datetime
import pathlib
base = pathlib.Path(r'C:\Users\Administrator\.openclaw\workspace	mp')
base.mkdir(parents=True, exist_ok=True)
out = base / f"doubao-{datetime.now().strftime('%Y%m%d-%H%M%S')}.png"
print(out)
'@ | python -

Then download to that path:

@'
import urllib.request
url = 'IMAGE_URL_HERE'
out = r'OUTPUT_PATH_HERE'
urllib.request.urlretrieve(url, out)
print(out)
'@ | python -

5) Return the local path

After saving, confirm the file exists and return:

  • the final local save path
  • optionally the original image URL if useful

Token-saving rules

To reduce token waste:

  • do not repeatedly snapshot the full page unless the state is unclear
  • after submit, wait briefly, then inspect DOM images directly
  • prefer preview/download-state DOM inspection over repeated screenshots
  • use direct download instead of screenshot cropping whenever possible
  • only fall back to screenshot capture if no usable real image URL is available

Failure handling

Doubao not logged in

Ask the user to log in on the opened page, then continue.

No textarea found

Refresh once and retry. If still missing, inspect for iframe or layout change.

Only low-resolution preview URLs found

Try this sequence:

  1. click one generated image to open preview
  2. look for 下载 button or download-style control
  3. inspect preview-state DOM images and choose the largest candidate
  4. only if all URLs still contain transformed preview hints like downsize/watermark, use the largest fallback URL

No final image URL found

Wait once more, inspect DOM again, then fall back to screenshot-based capture only if absolutely necessary.

安全使用建议
This skill appears to do what it says (find the best Doubao image URL and save it locally) but has practical/incoherence issues you should review before installing: - OS mismatch: SKILL.md hardcodes a Windows Administrator path and uses PowerShell pipe to python. If your agent runs on Linux/macOS or under a non-Administrator account, the provided commands will fail or attempt to write into an inappropriate path. Ask the skill author to make output_path configurable and provide cross-platform examples. - Local write + command execution: The skill will download arbitrary URLs and run Python via PowerShell. Ensure the agent runs in a trusted/sandboxed environment and that you are comfortable with files being written to the specified directory. Consider changing the default path to a user-owned workspace. - Source trust: There's no homepage or known source owner. That increases risk; consider testing in an isolated environment first. - Operational notes: The skill expects the user to be optionally logged into doubao.com and will execute JS in the page context. Avoid sending secrets inside prompts. If you want to use it, request the author add cross-platform examples, parameterize output_path, and document required runtime capabilities (browser automation, Python availability, file write permissions).
功能分析
Type: OpenClaw Skill Name: doubaoimages Version: 1.0.0 The skill uses PowerShell to execute Python scripts for file system operations and network downloads, which are high-risk capabilities. It is vulnerable to Python code injection in SKILL.md because it uses simple string interpolation to insert the 'IMAGE_URL_HERE' and 'OUTPUT_PATH_HERE' variables into a script executed by the host. Additionally, it hardcodes a specific local path for the 'Administrator' user (C:\Users\Administrator\.openclaw\workspace\tmp\), which is a poor security practice and assumes high-privilege environment access.
能力评估
Purpose & Capability
The skill's name/description (save Doubao-generated images locally) align with the runtime instructions (open doubao web chat, extract image URL, download to disk). However the SKILL.md hardcodes Windows-specific paths (C:\Users\Administrator\.openclaw\workspace\tmp) and PowerShell usage while the registry metadata lists no OS restriction; this is disproportionate and likely to fail or behave unexpectedly on non-Windows hosts.
Instruction Scope
Instructions remain within the stated purpose: open the web page, input a prompt, inspect DOM/preview and pick a large image URL, then download it. They do instruct executing JS evaluate snippets in the page context and running local python download commands. Those are expected for browser automation + local saving, but they give the agent permission to write arbitrary files to the host filesystem and to run Python via PowerShell which may be unexpected on non-Windows hosts.
Install Mechanism
Instruction-only skill with no install spec and no packages to install; this minimizes supply-chain risk. There are no downloads or external install URLs.
Credentials
The skill requests no environment variables or credentials, which is appropriate. But it implicitly assumes the agent has permission to write to a specific local directory and to run PowerShell/python. The hardcoded Administrator path and Windows-specific command form are disproportionate to the stated, cross-platform intent and should be parameterized.
Persistence & Privilege
The skill is not always-enabled and does not request persistent system-wide privileges. It does perform local file writes (its intended function) but does not attempt to modify other skills or agent configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install doubaoimages
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /doubaoimages 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Use doubao to generate images and save them locally
元数据
Slug doubaoimages
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

doubaoimg 是什么?

Generate images with Doubao web chat, extract the final generated image URL from the page, save the image locally, and return the saved local path. Use when... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 208 次。

如何安装 doubaoimg?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install doubaoimages」即可一键安装,无需额外配置。

doubaoimg 是免费的吗?

是的,doubaoimg 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

doubaoimg 支持哪些平台?

doubaoimg 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 doubaoimg?

由 Likely7(@likely7)开发并维护,当前版本 v1.0.0。

💬 留言讨论