MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / scrape_download

Function scrape_download

IntelOSINT.py:1872–1883  ·  view source on GitHub ↗
(task_id)

Source from the content-addressed store, hash-verified

1870
1871@app.route('/api/scrape/download/<task_id>', methods=['GET'])
1872def scrape_download(task_id):
1873 denied = require_authenticated_download("scrape_download", limit=30, window=60)
1874 if denied:
1875 return denied
1876 if task_id not in scrape_manager.tasks:
1877 return "Task non trovato", 404
1878 task = scrape_manager.tasks[task_id]
1879 if task['status'] != 'completed' or not task['result_file']:
1880 return "File non ancora pronto", 400
1881 if not os.path.exists(task['result_file']):
1882 return "File rimosso o inesistente", 404
1883 return send_file(task['result_file'], as_attachment=True)
1884
1885# --- CONFIG ---
1886CREDS_FILE = str(Path(__file__).resolve().parent / "credenziali_api.json")

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected