InstagramToMealie
一个简单的小转换器,可以将Instagram链接导入到Mealie中
INSTAGRAM TO MEALIE
目录
---概述
使用InstagramToMealie,您只需输入Instagram帖子链接。该项目无缝集成Mealie API, 创建一个新的食谱,并附带相关的图片或视频资源。
快速开始
前提条件
- 确保你已在 Mealie 中配置了 OpenAI / Ollama,方法是在你的 Mealie 实例中访问
/admin/debug/openai。该项目不直接集成 OpenAI / Ollama,但需要在 Mealie 中配置它才能正常工作。我个人使用 Ollama 模型qwen2.5:7b得到了最佳效果。 - 生成一个 Mealie API 密钥(
/user/profile/api-tokens)。Mealie 文档 - 生成一个 Instagram 会话文件(这是最棘手的步骤)。本仓库提供了一个辅助脚本!它只是从Instaloader 文档复制过来的。
- 下载脚本:https://raw.githubusercontent.com/JoTec2002/InstagramToMealie/refs/heads/main/helpers/instaloader_login_helper.py
- 在 Firefox 中登录 Instagram
- 执行命令:
python ./instaloader_login_helper.py - 将脚本生成的文件复制到已知位置。此文件稍后会挂载到 Docker 容器中。它可以在另一台系统上生成,然后复制到目标系统。
安装
使用以下方法之一安装 InstagramToMealie:
从源码构建:
- 克隆 InstagramToMealie 仓库:
❯ git clone https://github.com/JoTec2002/InstagramToMealie- 进入项目目录:
❯ cd InstagramToMealie- 安装项目依赖:
❯ pip install -r requirements.txt- 启动服务器:
❯ python -u main.py使用提供的 Docker 镜像 jotec2002/instagramtomealie
通过 Docker Compose 与您的 Mealie 安装一起部署
使用会话文件进行身份验证的示例 compose.yaml 文件:
services:
mealie:
image: ghcr.io/mealie-recipes/mealie:v2.1.0
container_name: mealie
#Look up in the Mealie Docs for how to use Mealie
InstagramToMealie:
image: jotec2002/instagramtomealie
ports:
- 9001:9001
environment:
INSTA_USER: "instagram username"
MEALIE_API_KEY: "MEALIE API KEY"
MEALIE_URL: "YOU LOCAL MEALIE INSTALLATION" # e.g http://mealie:9000
MEALIE_OPENAI_REQUEST_TIMEOUT: 60 # Optional, default: 60
volumes:
- ./session-file:/app/session-file # The Instagram session file you created in the Prerequisites
depends_on:
mealie:
condition: service_healthy使用用户名和密码环境变量进行身份验证的示例 compose.yaml 文件:
[!IMPORTANT]
为了使此方法有效,必须在账户上禁用两因素认证(TFA/TOTP)。
您可能需要多次尝试才能成功。请在其他系统/IP上同时登录,以避免触发Instagram的机器人检测。
这不是设置InstagramToMealie的推荐方式。
services:
mealie:
image: ghcr.io/mealie-recipes/mealie:v2.1.0
container_name: mealie
#Look up in the Mealie Docs for how to use Mealie
InstagramToMealie:
image: jotec2002/instagramtomealie
ports:
- 9001:9001
environment:
INSTA_USER: "instagram username"
INSTA_PWD: "Cleartext Instagram password"
MEALIE_API_KEY: "MEALIE API KEY"
MEALIE_URL: "YOU LOCAL MEALIE INSTALLATION" # e.g http://mealie:9000
MEALIE_OPENAI_REQUEST_TIMEOUT: 60 # Optional, default: 60
MEALIE_USE_INSTAGRAM_TAGS: true自行构建 Docker 镜像
配置方法与使用提供的 Docker 镜像时相同,但在 compose.yaml 中替换为以下内容:
services:
mealie:
image: ghcr.io/mealie-recipes/mealie:v2.1.0
container_name: mealie
#Look up in the Mealie Docs for how to use Mealie
InstagramToMealie:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ image: instagramtomealie:latest
ports:
- 9001:9001
使用方法
- 在网页浏览器中打开(例如
http://instagramtomealie.my-server.com),然后将 Instagram URL 导入文本框中 - 从自动化工具调用(例如 iOS 快捷指令)URL
http://instagramtomealie.my-server.com?url= - 如果需要一个返回导入结果的 API,使用
POST http://instagramtomealie.my-server.com/api,将 URL 作为请求体中的 JSON 格式发送(推荐,{"url": ")或作为查询参数发送(见上一条)。API 返回的 JSON 格式为:"}
{
"recipe_slug": ,
"error": ,
"url":
} 配置
MEALIE_URL: # Full URL of your Mealie instance (e.g http://mealie:9000, http://192.168.1.2:9000, http://my-mealie.com), required.
MEALIE_API_KEY: # API key used to authenticate with the Mealie REST API, required.
MEALIE_OPENAI_REQUEST_TIMEOUT: 60 # The timeout in seconds for OpenAI / Ollama requests, optional, default 60.
MEALIE_USE_INSTAGRAM_TAGS: true # Embeds tags provided on the Instagram post as tags in Mealie, optional, default true.
INSTA_USER: # Instagram username (e.g mob_kitchen), required.
INSTA_PWD: # Instagram password in plaintext, optional (if using a session file).
INSTA_TOTP_SECRET: # Secret key used for 2FA authentication, optional, not recommended.
HTTP_PORT: # Port to use for the Flask HTTP server, optional, default 9001贡献
许可证
本项目受 MIT 许可证保护。更多详情请参阅 LICENSE 文件。
致谢
------ Tranlated By Open Ai Tx | Last indexed: 2026-04-25 ---