下载双子座图像

人工智能 社区

技能解读

当前原文的自动摘译,尚未人工审校。

概述

从用户登录的 Chrome 会话中下载 Gemini 对话图像。与缩略图/页面预览资源相比,更喜欢灯箱图像,因为 Gemini 通常仅在用户打开预览后才会暴露更大的 blob: 图像。

工作流程

使用 Chrome 插件,而不是新的未经身份验证的浏览器,因为 Gemini 对话通常需要用户现有的 Google 会话。根据 Chrome 技能引导 Chrome,声明已经打开的 Gemini 选项卡(如果存在),或者在 Chrome 中打开用户提供的 Gemini URL。在 browser 可用后,从 node_repl JS 调用导入并运行 scripts/download_gemini_images.mjs。用scripts/package_images.sh打包输出目录。

主要脚本

解析相对于此技能目录的脚本路径,然后将其导入到用于 Chrome 自动化的同一 Node REPL 会话中:仅当用户给出特定计数时才设置 expectedCount。省略它即可下载每个可见的Show the uploaded image in a lightbox按钮。

包装

主脚本返回outputDir后,运行: 打包脚本创建ZIP,运行zip -T,并验证存档包含与目录相同的有序图像文件。

回退

如果灯箱自动化失败但页面已明显加载,请使用选项卡pageAssets功能:这通常捕获 512px 预览 JPEG,而不是较大的灯箱文件。告诉用户何时使用此后备。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
人工智能
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@daymade · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
macOS · Linux · Windows
运行环境要求
Node.js
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Download Gemini Images

## Overview

Download Gemini conversation images from the user's logged-in Chrome session. Prefer the lightbox image over thumbnail/page-preview assets because Gemini often exposes a larger `blob:` image only after the user opens a preview.

## Workflow

1. Use the Chrome plugin, not a fresh unauthenticated browser, because Gemini conversations usually require the user's existing Google session.
2. Bootstrap Chrome per the Chrome skill, claim the already-open Gemini tab if it exists, or open the user-provided Gemini URL in Chrome.
3. Import and run `scripts/download_gemini_images.mjs` from a `node_repl` JS call after `browser` is available.
4. Package the output directory with `scripts/package_images.sh`.
5. Report the ZIP path, image count, and any lower-resolution fallback.
6. Finalize Chrome control after downloads are complete, keeping the user's original Gemini tab open when appropriate.

## Main Script

Resolve the script path relative to this skill directory, then import it in the same Node REPL session used for Chrome automation:

```js
var { downloadGeminiImagesFromChrome } = await import("/absolute/path/to/download-gemini-images/scripts/download_gemini_images.mjs");
var result = await downloadGeminiImagesFromChrome({
  browser,
  tabUrlIncludes: "gemini.google.com/app",
  expectedCount: 20,
  outputDir: `${nodeRepl.homeDir}/Downloads/gemini_conversation_images_${new Date().toISOString().slice(0, 10).replaceAll("-", "")}`
});
nodeRepl.write(JSON.stringify(result, null, 2));
```

Set `expectedCount` only when the user gave a specific count. Omit it to download every visible `Show the uploaded image in a lightbox` button.

## Packaging

After the main script returns `outputDir`, run:

```bash
/absolute/path/to/download-gemini-images/scripts/package_images.sh "$outputDir" "$HOME/Downloads/gemini_conversation_images.zip"
```

The packaging script creates the ZIP, runs `zip -T`, and verifies that the archive contains the same ordered image files as the directory.

## Fallback

If lightbox automation fails but the page is visibly loaded, use the tab `pageAssets` capability:

```js
var pageAssets = await tab.capabilities.get("pageAssets");
var inventory = await pageAssets.list();
var uploaded = inventory.assets.filter(a => a.kind === "image" && a.url.includes("lh3.googleusercontent.com/gg/"));
var bundle = await pageAssets.bundle({ inventoryId: inventory.id, assetIds: uploaded.map(a => a.id) });
nodeRepl.write(JSON.stringify(bundle, null, 2));
```

This usually captures 512px preview JPEGs, not the larger lightbox files. Tell the user when this fallback is used.

## Notes

- Do not inspect browser cookies, local storage, passwords, or session stores.
- Downloading files is an inbound transfer and does not require confirmation by itself.
- If Gemini asks the user to log in, pause and ask the user to complete login in Chrome.
- If the user wants the images in the same order as the thread, use the script's ordered names: `image_01.jpg`, `image_02.jpg`, etc.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。