Update app.py
Browse files20 unmodified lines2122232424252627272829303031313233343520 unmodified lines save_path = os.path.join(save_dir, filename) print(f"[DEBUG] Try download: url={url} save_path={save_path}") try: resp = requests.get(url, timeout=30) resp = requests.get(url, timeout=30) print(f"[DEBUG] HTTP {resp.status_code} for {url}") resp.raise_for_status() if resp.headers.get('content-type', '').startswith('text/html'): if resp.headers.get('content-type', '').startswith('text/html'): print(f"Warning: Received HTML response, file might not exist: {filename}") return None with open(save_path, "wb") as f: with open(save_path, "wb") as f: f.write(resp.content) print(f"Downloaded attachment for task {task_id} -> {save_path}") return save_pathapp.py+5-4