- SSRF-safe fetcher: public IPs only, connects to the checked address, redirects re-validated, size/time limits, honest user agent - schema.org/Recipe JSON-LD extraction (graphs, HowToSections, ISO durations, yields, keywords, images) without extra dependencies; AI fallback on plain page text when no structured recipe exists - Instagram: one login-free request to the public embed page; when Instagram withholds the caption, the import page explains how to paste the text or import a screenshot instead - Suggested source photo can be downloaded and attached on save - Text import works without AI (text becomes the description) - Installable PWA with manifest, icons and Android share target - Offline tests for SSRF rules, parsers, Instagram and import views Co-Authored-By: Claude Opus 5.5 <[email protected]>
58 lines
2.5 KiB
HTML
58 lines
2.5 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Rezept importieren{% endblock %}
|
|
{% block content %}
|
|
<h1>Rezept importieren</h1>
|
|
<p class="muted">Das Ergebnis ist immer ein Entwurf, den du prüfst und erst dann speicherst.</p>
|
|
|
|
<section class="card">
|
|
<h2>🔗 Link</h2>
|
|
<form method="post" action="{% url 'recipes:import_link' %}" novalidate>
|
|
{% csrf_token %}
|
|
{% with form=link_form %}{% include "form_fields.html" %}{% endwith %}
|
|
<p class="muted small">Rezeptseiten werden direkt ausgelesen. Bei Instagram wird die Beschreibung des Beitrags übernommen{% if ai_enabled %} und per KI aufbereitet{% endif %}.</p>
|
|
<button type="submit" class="button" data-busy-text="Wird geladen …">Importieren</button>
|
|
</form>
|
|
</section>
|
|
|
|
{% if instagram_failed %}
|
|
<section class="card help-box">
|
|
<h2>So klappt es mit Instagram</h2>
|
|
<ol>
|
|
<li>Öffne den Beitrag in der Instagram-App und tippe auf „… mehr“, damit die ganze Beschreibung sichtbar ist.</li>
|
|
<li>Mach einen <strong>Screenshot</strong> und lade ihn unten bei „Foto oder Screenshot“ hoch{% if not ai_enabled %} (braucht die KI){% endif %}, <em>oder</em></li>
|
|
<li>öffne den Beitrag im Browser, markiere den Text, kopiere ihn und füge ihn unten bei „Text einfügen“ ein.</li>
|
|
</ol>
|
|
</section>
|
|
{% endif %}
|
|
|
|
<section class="card">
|
|
<h2>📷 Foto oder Screenshot</h2>
|
|
{% if ai_enabled %}
|
|
<form method="post" action="{% url 'recipes:import_photo' %}" enctype="multipart/form-data" novalidate>
|
|
{% csrf_token %}
|
|
{% with form=photo_form %}{% include "form_fields.html" %}{% endwith %}
|
|
<p class="muted small">Die Bilder werden zur Auswertung an OpenAI geschickt und nicht gespeichert.</p>
|
|
<button type="submit" class="button" data-busy-text="KI liest das Rezept …">Rezept erkennen</button>
|
|
</form>
|
|
{% else %}
|
|
{% include "recipes/_ai_disabled.html" %}
|
|
{% endif %}
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>📝 Text einfügen</h2>
|
|
<form method="post" action="{% url 'recipes:import_text' %}" novalidate>
|
|
{% csrf_token %}
|
|
{% with form=text_form %}{% include "form_fields.html" %}{% endwith %}
|
|
{% if ai_enabled %}
|
|
<button type="submit" class="button" data-busy-text="KI bereitet auf …">Mit KI aufbereiten</button>
|
|
{% else %}
|
|
<p class="muted small">Ohne KI wird der Text als Beschreibung übernommen und du teilst ihn selbst auf.</p>
|
|
<button type="submit" class="button">Als Entwurf übernehmen</button>
|
|
{% endif %}
|
|
</form>
|
|
</section>
|
|
|
|
<p><a href="{% url 'recipes:create' %}">Oder ganz von Hand eintragen →</a></p>
|
|
{% endblock %}
|