Compare commits

...

3 Commits

5 changed files with 85 additions and 11 deletions
+76
View File
@@ -25,6 +25,8 @@ from werkzeug.routing import BuildError
from jinja2 import TemplateNotFound
import os
import sys
from bs4 import BeautifulSoup
import requests
# Ensure imports work regardless of whether gunicorn starts in /app or /app/Web.
_CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -9539,6 +9541,79 @@ def _fetch_from_open_library(clean_isbn):
print(f"OpenLibrary Search error: {e}")
return None
def _fetch_from_isbn_de(clean_isbn):
"""
Source 4: isbn.de (Web Scraping für deutsche Schulbücher)
Sehr gute Trefferquote für Klett, Cornelsen, Westermann etc.
"""
try:
# Die URL leitet meist automatisch auf den richtigen Buch-Slug weiter
url = f"https://www.isbn.de/buch/{clean_isbn}"
# Ein User-Agent ist wichtig, da Webseiten simple Python-Scripte oft blockieren
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
response = requests.get(url, headers=headers, timeout=5)
if response.status_code != 200:
return None
soup = BeautifulSoup(response.text, 'html.parser')
# Prüfen, ob wirklich ein Buch gefunden wurde
# (isbn.de wirft manchmal keinen 404, sondern zeigt eine Suchseite ohne Treffer)
title_elem = soup.find('h1')
if not title_elem or "nicht gefunden" in title_elem.text.lower() or "Suche" in title_elem.text:
return None
title = title_elem.text.strip()
# isbn.de nutzt oft Schema.org Tags (itemprop), was das Auslesen sehr sicher macht
authors = "Unknown Author"
author_elem = soup.find(itemprop="author")
if author_elem:
authors = author_elem.text.strip()
publisher = "Unknown Publisher"
publisher_elem = soup.find(itemprop="publisher")
if publisher_elem:
publisher = publisher_elem.text.strip()
pub_date = "Unknown Date"
date_elem = soup.find(itemprop="datePublished")
if date_elem:
pub_date = date_elem.text.strip()
description = "Keine Beschreibung verfügbar"
desc_elem = soup.find(itemprop="description")
if desc_elem:
description = desc_elem.text.strip()
thumbnail = ""
img_elem = soup.find('img', itemprop="image")
if img_elem and 'src' in img_elem.attrs:
thumbnail = img_elem['src']
# Falls der Link relativ ist (z.B. /cover/...)
if thumbnail.startswith('/'):
thumbnail = "https://www.isbn.de" + thumbnail
return {
"title": title,
"authors": authors,
"publisher": publisher,
"publishedDate": pub_date,
"description": description,
"pageCount": "Unknown", # Seitenanzahl ist oft nicht standardisiert hinterlegt
"price": None,
"thumbnail": thumbnail,
"source": "isbn-de"
}
except Exception as e:
print(f"isbn.de Scraping error: {e}")
return None
@app.route('/fetch_book_info/<isbn>')
def fetch_book_info(isbn):
"""
@@ -9562,6 +9637,7 @@ def fetch_book_info(isbn):
providers = [
_fetch_from_google_books,
_fetch_from_lobid_germany,
_fetch_from_isbn_de,
_fetch_from_open_library
]
+1
View File
@@ -15,3 +15,4 @@ openpyxl
cryptography>=42.0.0
pywebpush
py-vapid>=1.9.0
beautifulsoup4
+6 -10
View File
@@ -28,11 +28,10 @@
<li class="nav-item" role="presentation">
<button class="nav-link" id="tab-legal" data-bs-toggle="tab" data-bs-target="#pane-legal"
type="button" role="tab">Rechtsgrundlage</button>
</li>
</ul>
<!-- ── NOTICE ────────────────────────────────────────────────────── -->
<div class="tab-pane fade" id="pane-notice" role="tabpanel">
<div class="tab-pane" id="pane-notice" role="tabpanel">
<div class="license-content">
<h2>NOTICE Urheberrechtliche Hinweise</h2>
<p><strong>Invario Modul Suite</strong><br>Copyright © 2026 Invario UG</p>
@@ -59,14 +58,14 @@
<h4>Frontend / Laufzeit-Assets</h4>
<ul>
<li>html5-qrcode (MIT) © 2020-2025 Manoj Brahmbhatt (mebjas)</li>
<li>quagga2 (MIT) © 2014 Christoph Oberhofer, © 2019 Eric Blade and contributors</li>
</ul>
<hr>
</div>
</div><!-- /#pane-notice -->
<!-- ── DATENSCHUTZ ───────────────────────────────────────────────── -->
<div class="tab-pane fade" id="pane-privacy" role="tabpanel">
<div class="tab-pane" id="pane-privacy" role="tabpanel">
<div class="license-content">
<h2>Datenschutzerklärung (Privacy Policy)</h2>
@@ -108,7 +107,7 @@
</div><!-- /#pane-privacy -->
<!-- ── SICHERHEIT ────────────────────────────────────────────────── -->
<div class="tab-pane fade" id="pane-security" role="tabpanel">
<div class="tab-pane" id="pane-security" role="tabpanel">
<div class="license-content">
<h2>Sicherheitsrichtlinie (Security Policy)</h2>
@@ -129,7 +128,7 @@
</div><!-- /#pane-security -->
<!-- ── DATENVERARBEITUNG ─────────────────────────────────────────── -->
<div class="tab-pane fade" id="pane-data" role="tabpanel">
<div class="tab-pane" id="pane-data" role="tabpanel">
<div class="license-content">
<h2>Dokumentation der Datenverarbeitung (VVT)</h2>
@@ -157,7 +156,7 @@
</div><!-- /#pane-data -->
<!-- ── RECHTSGRUNDLAGE ───────────────────────────────────────────── -->
<div class="tab-pane fade" id="pane-legal" role="tabpanel">
<div class="tab-pane" id="pane-legal" role="tabpanel">
<div class="license-content">
<h2>Rechtsgrundlage der Nutzung</h2>
<p>Um das Inventarsystem DSGVO-konform zu betreiben, muss der Betreiber eine der folgenden Grundlagen festlegen:</p>
@@ -170,9 +169,6 @@
Einwilligung vorliegen (Art. 6 Abs. 1 lit. a DSGVO).</li>
</ol>
</div>
</div><!-- /#pane-legal -->
</div><!-- /.tab-content -->
</div>
</div>
+1 -1
View File
@@ -43,7 +43,7 @@
<div class="card border-0 shadow-lg rounded-4 h-100">
<div class="card-body p-4 p-md-5">
<p class="text-uppercase text-muted fw-semibold mb-2">Terminplaner</p>
<h1 class="h3 fw-bold mb-3">Termin buchen</h1>
<h1 class="h3 fw-bold mb-3">Termin buchen - {{ available.title }}</h1>
<p class="text-muted mb-4">Wählen Sie im Kalender einen freien Slot aus. Den gewählten Termin können Sie danach direkt wie in einem Kalender-Block verschieben.</p>
<div class="p-3 rounded-3 bg-light mb-3">
+1
View File
@@ -15,3 +15,4 @@ openpyxl
cryptography>=42.0.0
pywebpush
py-vapid>=1.9.0
beautifulsoup4