-1

I have a set of videos I'm trying to download but they often have large quantities of whitespace in the video title. However, I want to have the titles named correctly in the downloaded filename (just without the additional whitespace).

I think this can be achieved with a postprocessor but I'm not sure how to implement it.

I had this command written down somewhere from a while back but it doesn't work now. Not sure if it ever did;

yt-dlp.exe "url" --postprocessor "re_replace: '\s+', ' ', 'title'" -o D:\download\%(upload_date)s_%(title)s.%(ext)s

But I get the error;

yt-dlp.exe: error: no such option: --postprocessor "re_replace: '\s+', ' ', 'title'"
Joe.S
  • 5
  • 2

1 Answers1

0

The switch --postprocessor does not exists.
It's --postprocessor-args

EDIT:
After your clarifying comment, there is no way to obtain that directly from yt-dlp. You have to write separate code, maybe using the --exec switch and piping the filename to a robust utility like rename on Linux, or the Powershell Rename-Item on Windows

pierpy
  • 897
  • 3
  • 14
  • 18
  • I still couldn't get that to work so I just wrapped the command in a python function and renamed the files after. Would still be glad to see a solution though! – Joe.S Aug 02 '23 at 10:10
  • @Joe.S I've updated my answer – pierpy Aug 06 '23 at 05:25