diff --git a/app/tasks/upload_with_rclone.py b/app/tasks/upload_with_rclone.py index 769d1e52..16108617 100644 --- a/app/tasks/upload_with_rclone.py +++ b/app/tasks/upload_with_rclone.py @@ -55,12 +55,12 @@ def upload_with_rclone(self, file_path: str, destination: str): try: # Ensure the remote path exists (create folders if needed) - mkdir_cmd = ["rclone", "mkdir", "--config", rclone_config_path, destination] + mkdir_cmd = ["rclone", "mkdir", "--config", rclone_config_path, "--", destination] subprocess.run(mkdir_cmd, check=True, capture_output=True) # noqa: S603 # Construct the upload command - upload_cmd = ["rclone", "copy", "--config", rclone_config_path, file_path, destination, "--progress"] + upload_cmd = ["rclone", "copy", "--config", rclone_config_path, "--progress", "--", file_path, destination] log_task_progress(task_id, "rclone_upload", "in_progress", f"Executing rclone copy to {destination}") @@ -71,7 +71,7 @@ def upload_with_rclone(self, file_path: str, destination: str): if result.returncode == 0: # Try to get a public link if possible try: - link_cmd = ["rclone", "link", "--config", rclone_config_path, f"{destination}/{filename}"] + link_cmd = ["rclone", "link", "--config", rclone_config_path, "--", f"{destination}/{filename}"] link_result = subprocess.run(link_cmd, capture_output=True, text=True, check=False) # noqa: S603 public_url = link_result.stdout.strip() if link_result.returncode == 0 else None except (subprocess.SubprocessError, OSError) as e: