Skip to content

JoTec2002/InstagramToMealie

Repository files navigation

InstagramToMealie

A simple little converter, that imports an instagram URL into mealie

INSTAGRAM TO MEALIE

license last-commit repo-top-language repo-language-count


Table of Contents


Overview

With InstagramToMealie, you can simply input an Instagram post URL. The project seamlessly integrates with Mealie API to create a new recipe with associated image or video assets.


Getting Started

Prerequisites

  1. Make Sure you have OpenAI/ Ollama configured in Mealie. This Project doesn't integrate directly with OpenAI/ Ollama, but need it to be configured in Mealie to work Properly. I personally got the best results with qwen2.5:7b as the Ollama Model.
  2. Generate a Mealie API Key. Mealie Docs
  3. Generate a Instagram Session File (!thats the most tricky step). A Helper Script is provided https://github.com/JoTec2002/InstagramToMealie/blob/main/helpers/instaloader_login_helper.py ! It's just copied from the Instaloader Docs.
    1. Download the script: https://raw.githubusercontent.com/JoTec2002/InstagramToMealie/refs/heads/main/helpers/instaloader_login_helper.py
    2. Login to Instagram in Firefox
    3. Execute the snippet, e.g. with python instaloader_login_helper.py
    4. Copy the File that was generated by the Script to a known location. (this file will later be mounted to the docker container. It can be generated on a different System and than copied to the target System)

Installation

Install InstagramToMealie using one of the following methods:

Build from source:

  1. Clone the InstagramToMealie repository:
❯ git clone https://github.com/JoTec2002/InstagramToMealie
  1. Navigate to the project directory:
cd InstagramToMealie
  1. Install the project dependencies:

Use the Provided Docker Image: https://hub.docker.com/repository/docker/jotec2002/instagramtomealie/general

Deploy it via docker-compose allongside your mealie installation

Docker compose example (With Instagram Session File):

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
    expose:
      - "9001"
    environment:
      INSTA_USER: "instagram username"
      MEALIE_API_KEY: "MEALIE API KEY"
      MEALIE_URL: "YOU LOCAL MEALIE INSTALLATION"
      MEALIE_OPENAI_REQUEST_TIMEOUT: 60           #optional default 60
    volumes:
      - "./session-file:/app/session-file"        #The instagram session file you created in the prerequisits
    depends_on:
      mealie:
        condition: service_healthy

Docker compose example (With Instagram username and password)
!!! On the Instagram Account 2FA MUST be disabled. You Probably need multiple attempts to get ths working. Login on other Systems parallel to not trip the instagram bot detector. This is not Recommended!

services:
  InstagramToMealie:
    build:
      context: .
      dockerfile: Dockerfile
    image: instagramtomealie:latest
    ports:
      - "9001:9001"
    environment:
      INSTA_USER: "instagram username"
      MEALIE_API_KEY: "MEALIE API KEY"
      MEALIE_URL: "YOU LOCAL MEALIE INSTALLATION"
      MEALIE_OPENAI_REQUEST_TIMEOUT: 60 #optional default 60
      INSTA_PWD: "Cleartext Instagram Password"

Usage

  1. Open in Webbrowser (e.g. instagramtomealie.my-server.com) and just import the Instagram URL into the Textfield
  2. Call from an Automation (e.g. IOS shortcut) the url instagramtomealie.my-server.com?url=

Contributing

Contributor Graph


License

This project is protected under the MIT License. For more details, refer to the LICENSE file.


Acknowledgments