(task_id)
| 1870 | |
| 1871 | @app.route('/api/scrape/download/<task_id>', methods=['GET']) |
| 1872 | def 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 --- |
| 1886 | CREDS_FILE = str(Path(__file__).resolve().parent / "credenziali_api.json") |
nothing calls this directly
no test coverage detected