INNER CODE UNIT · Python

api_samples

darama22/Malware-Research-Hub · app/server.py:105

def api_samples():
    samples = load_json("samples_index.json")
    if not samples:
        return jsonify({"total": 0, "entries": []})

    q = request.args.get("q", "").strip().lower()
    category = request.args.get("category", "").strip()
    collection = request.args.get("collection", "").strip()
    kind = request.args.get("kind", "").strip()
    only_unmatched = request.args.get("unmatched", "") == "1"

    entries = samples["entries"]
    if q:
        entries = [e for e in entries if q in e["name"].lower()]
    if category:
        entries = [e for e in entries if e["category"] == category]
    if collection:
        entries = [e for e in entries if e["collection_id"] == collection]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…