affaan-m/ECC · error · ValueError
Invalid concat file entry
Error message
Invalid concat file entry
What it means
read_concat parses an ffmpeg-style concat file where each non-comment line must be exactly 'file <path>'. Any 'file' line with a different number of shell-split fields (extra tokens, unquoted spaces, missing path) is rejected. This prevents silently building a clip list from malformed manifests.
Solutions
- Quote paths containing spaces in the concat file: file "my video.mp4"
- Remove any extra tokens so each 'file' line has exactly two fields
- Check for invisible characters or trailing whitespace creating phantom fields (run `cat -A concat.txt`)
- Regenerate the concat file programmatically with shlex.quote around each path
Example fix
// before (concat.txt) file my video.mp4 // after (concat.txt) file "my video.mp4"
Defensive patterns
Strategy: validation
Validate before calling
import shlex
def concat_lines_ok(path):
for i, line in enumerate(Path(path).read_text().splitlines(), 1):
fields = shlex.split(line, comments=True)
if fields and fields[0] == 'file' and len(fields) != 2:
raise ValueError(f'concat line {i} must be: file <single path>') Try / catch
try:
files = read_concat('concat.txt')
except ValueError as e:
print(f'Fix concat manifest: {e}')
sys.exit(2) Prevention
- Generate concat files programmatically with shlex.quote(path)
- Quote any path containing spaces in the manifest
- Validate the manifest with shlex before feeding it to the tool
- Avoid hand-editing concat files; use sed-like tools that preserve quoting
When it happens
Trigger: A concat file line like `file my video.mp4` (unquoted space yields 3 fields), `file` with no path, or `file a.mp4 extra.txt`; also using a field count other than 2 on any 'file' line.
Common situations: Hand-written concat manifests with unquoted filenames containing spaces; files exported by tools that append metadata columns; copy-pasting lines with trailing arguments; paths not quoted per shlex conventions.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- application bundle differs from its bound evidence
- At least one video is required
- AuraUntrusted
- bad timecode
- Cannot read JSON object
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/f6316737a67b86aa.
Report an issue: GitHub.
Appendix: source
Thrown at skills/taste-application/scripts/tasteforge/media/capcut.py:39
"-of",
"csv=p=0",
str(path),
],
check=True,
capture_output=True,
text=True,
)
return float(result.stdout.strip())
def read_concat(path):
path = Path(path).resolve()
files = []
for line in path.read_text().splitlines():
fields = shlex.split(line, comments=True)
if fields and fields[0] == "file":
if len(fields) != 2:
raise ValueError("Invalid concat file entry")
files.append((path.parent / fields[1]).resolve())
return files
def export_draft(
files,
drafts,
name,
width=1920,
height=1080,
fps=30,
overwrite=False,
cc=None,
probe=duration_of,
):
geometry(width, height, fps)
if overwrite:
raise ValueError("CapCut draft replacement is unsafe; choose a new name")View on GitHub (pinned to 8321021c54)