Skip to main content

🎨 Google Flow Downloader

批量下载 Google Flow 生成的 AI 图片

PyPI version Python Version License: MIT Downloads

安装 • 快速开始 • 功能特性 • 文档


📖 简介

Google Flow Downloader 是一个强大的命令行工具,用于批量下载 Google Flow 生成的 AI 图片。

为什么选择这个工具?

  • 🚀 自动去重 - 智能检测已下载图片,避免重复
  • 📦 增量下载 - 支持多次运行,只下载新图片
  • 🎯 多项目支持 - 轻松管理多个 Google Flow 项目
  • 💻 macOS 优化 - 一键复制脚本到剪贴板
  • 📊 进度显示 - 实时显示下载进度和状态
  • 🔒 隐私安全 - 不存储任何凭据信息

🚀 安装

pipx install google-flow-downloader

要求: Python 3.8+


⚡ 快速开始

方式 1:浏览器脚本(推荐)

最简单、最可靠的方式,无需管理 token:

# 步骤 1: 复制脚本到剪贴板 (macOS)
gflow script -c

# 步骤 2: 在浏览器中
# 1. 打开你的 Google Flow 项目页面
# 2. 按 F12 → Console 标签
# 3. Cmd+V 粘贴脚本,回车运行
# 4. 等待自动滚动完成(会下载 JSON 文件)

# 步骤 3: 批量下载图片
gflow from-json ~/Downloads/google_flow_complete_XXX.json

方式 2:API 直接下载

适合自动化场景:

# 使用完整 Cookie
gflow download \
  --cookie "你的完整cookie字符串" \
  --url "https://labs.google/fx/tools/flow/project/YOUR_PROJECT_ID"

# 或使用 Token
gflow download \
  --token "你的session-token" \
  --project-id "你的项目ID"

✨ 功能特性

🎯 智能去重

自动检测已下载图片,避免重复下载,节省时间和带宽。

📦 增量更新

支持多次运行,每次只下载新增的图片。

🔄 多项目支持

轻松管理多个 Google Flow 项目,不硬编码项目 ID。

💻 macOS 优化

一键复制脚本到剪贴板,提升使用体验。


📚 命令详解

gflow script

显示或复制浏览器提取脚本

gflow script        # 显示脚本
gflow script -c     # 复制到剪贴板 (macOS)

gflow from-json

从浏览器导出的 JSON 文件下载图片

gflow from-json ~/Downloads/google_flow_complete_242.json

# 自定义输出目录
gflow from-json ~/Downloads/xxx.json -o ~/Pictures/google_flow

gflow download

从 API 直接下载图片

# 使用完整 Cookie + URL
gflow download --cookie "完整cookie" --url "项目URL"

# 使用 Token + Project ID
gflow download --token "token" --project-id "项目ID"

# 使用环境变量
export GFLOW_COOKIE="完整cookie"
export GFLOW_PROJECT_ID="项目ID"
gflow download

gflow status

查看下载状态

gflow status                    # 查看默认目录
gflow status -o ~/Pictures/     # 查看指定目录

🔧 配置

默认输出目录

~/Code/GenAI/google_flow_images/

环境变量

export GFLOW_COOKIE="完整cookie字符串"
export GFLOW_SESSION_TOKEN="session token"
export GFLOW_PROJECT_ID="项目ID"

💡 常见问题

如何获取 Cookie?

方法 1: 从 curl 命令(推荐)

  1. 打开 Google Flow 项目页面
  2. 按 F12 → Network 标签
  3. 刷新页面或滚动
  4. 找到 searchProjectWorkflows 请求
  5. 右键 → Copy → Copy as cURL
  6. 从 curl 命令中复制 -b 后面的 Cookie 字符串

方法 2: 从 Application 标签

  1. F12 → Application → Cookies → https://labs.google
  2. 手动复制所有 Cookie 拼接成字符串
如何获取 Project ID?

从项目 URL 中提取:

https://labs.google/fx/tools/flow/project/23497835-f05d-41bd-a0dc-4188c378f521
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                          这就是 Project ID

或使用 --url 参数自动提取。

Token 过期怎么办?

Session token 会定期过期,有两种解决方案:

  1. 使用浏览器脚本(推荐)- 不需要管理 token
  2. 重新获取 token - 从浏览器复制新的 Cookie
支持多个项目吗?

支持!每个项目使用不同的输出目录:

gflow download --project-id "项目A" -o ~/flow_project_a
gflow download --project-id "项目B" -o ~/flow_project_b

🛠️ 工作原理

浏览器脚本方式

graph LR
    A[浏览器运行 JS] --> B[自动滚动页面]
    B --> C[拦截网络请求]
    C --> D[提取图片 URL]
    D --> E[导出 JSON]
    E --> F[Python 批量下载]

API 方式

graph LR
    A[提供 Cookie/Token] --> B[调用 Google Flow API]
    B --> C[获取图片列表]
    C --> D[批量下载]

📖 文档


🧪 测试

cd google-flow-downloader
python3 tests/test_all.py

所有测试通过 ✅


🤝 贡献

欢迎提交 Issue 和 Pull Request!

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启 Pull Request

📄 许可证

本项目采用 MIT 许可证 - 查看 LICENSE.txt 了解详情


🙏 致谢


📊 统计

GitHub stars GitHub forks GitHub issues GitHub last commit


如果这个项目对你有帮助,请给个 ⭐️ Star!

Made with ❤️ by neosun100

Metadata

Release files for google-flow-downloader 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-flow-downloader 1.1.0
File Size Uploaded Provenance Actions
google_flow_downloader-1.1.0.tar.gz 14.5 kB Without provenance Details for google_flow_downloader-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for google-flow-downloader 1.1.0
File Interpreter ABI Platform Actions
google_flow_downloader-1.1.0-py3-none-any.whl Python 3 none any Details for google_flow_downloader-1.1.0-py3-none-any.whl

Total release size: 25.3 kB

Release files / google_flow_downloader-1.1.0.tar.gz

Download URL google_flow_downloader-1.1.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a14ec636a4db892069f43c116513b8ac63b22f84fccb769f22111f1a0534ef3b
BLAKE2b-256 checksum
How to use checksums
fb6287074eb0bbd2dbf1f0194fb6eaa21d2c3715672f4c81daeab143cee9aaeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release files / google_flow_downloader-1.1.0-py3-none-any.whl

Download URL google_flow_downloader-1.1.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad8e32966cd3c8083959467089ce5e2145da8f79e2909f13eda885c95c5bf061
BLAKE2b-256 checksum
How to use checksums
5c6ba8bbe7b5cd600710b1e872c2b71bde603652408fbf4ec757654f0771ba92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Security for google-flow-downloader 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page