dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
909 stars 115 forks source link

Need command line option to set file naming based on OS #122

Closed FrankenLab closed 8 years ago

FrankenLab commented 8 years ago

I use TVnamer in a script on my NAS to name files that I view from Windows. I'm getting file names with invalid characters (example title with time 12:53). The colon causes the file to appear like H46UDG~1.mp4. TVnamer thinks the file name is valid since its running on Linux.

FrankenLab commented 8 years ago

Please disregard, I discovered the option in the configuration file! My mistake. Thanks for the great app!

shalak commented 1 year ago

Since I landed here when I had the same issue, allow me to post a fix:

In ~/.config/tvnamer/tvnamer.json enter:

{
    "windows_safe_filenames": true,
    "output_filename_replacements": [
        {"is_regex": false,
        "match": ":",
        "replacement": " -"}
    ]
}

The windows_safe_filenames will take care of all windows-illegal characters and replace them with _.

The output_filename_replacements will treat the : differently, replacing it with - instead (thanks to this, titles like Chapter 1: Title, will be changed to Chapter 1 - Title