dbr / tvnamer

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

Illegal naming on show #96

Closed carlneuhaus closed 10 years ago

carlneuhaus commented 10 years ago

Love this script but I have found that with the show "Cosmos: A Spacetime Odyssey" it is causing problems with the ":" as most devices don't support this character in the filename. Is there someway to have an exception for this show or do a quick check when it fetches the show name for illegal symbols?

carlneuhaus commented 10 years ago

Turns out it is already doing a check but on my device it was still playing up. Anyone who is having a similar issue you need to add a ":" to the blacklist in utils.py. elif sysname in ['Linux', 'FreeBSD']: blacklist = r"/:"

dbr commented 10 years ago

You can do this with the config, something along the lines of:

{"custom_filename_character_blacklist": ":"}

Or use the custom-replacements config option to replace : with -

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