0
I've been using youtube-dl to download an entire youtuber's channel for archival purposes. I had been using the default naming pattern for naming the videos which uses the video's title, then a hyphen, the 11 character video id and finally, the file's extension.
e.g.
title of the video - (an example)-oHg5SJYRHA0.mp4
For future downloads, I've removed the hyphen and placed the video id within square brackets. The problem is that I've already got hundreds of videos following the old naming scheme that I don't want to waste bandwidth on re-downloading just to get the new naming scheme.
How can I rename files of varying length so that a "]" is placed before the ".mp4" and they hyphen, 11 spaces/characters before the "].mp4" is replaced with a "["?
e.g.
title of the video - (an example)[oHg5SJYRHA0].mp4
[EDIT] I forgot to specify that I'd prefer a solution that'll work on Linux and/or FreeNAS/BSD.
What system are you using? Do you have Perl, or Bash, or PowerShell available? – user1686 – 2019-10-18T05:02:51.243
I split my time between Linux, FreeNAS/BSD and Windows, so I'm not really limited much in regards to what OS or language I'll use but I'd prefer something FOSS or OS agnostic. – Hollis Hurlbut – 2019-10-18T18:13:27.757