Illegal characters in path when moving files with brackets?

I’m using Sonarr and SABnzbd to download anime. When Sonarr tries to move completed files into another folder, I get the following error:

Couldn't import episode D:\sabnzbd complete\tv\[HorribleSubs].Akame.ga.Kill!-24.[1080p]\[HorribleSubs] Akame ga Kill! - 24 [1080p].mkv: Illegal characters in path.

…with the following exception:

System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.IO.Path.Combine(String path1, String path2)
   at NzbDrone.Core.Organizer.FileNameBuilder.BuildFilePath(Series series, Int32 seasonNumber, String fileName, String extension) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:line 163
   at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:line 64
   at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode, Boolean copyOnly) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\UpgradeMediaFileService.cs:line 64
   at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import(List`1 decisions, Boolean newDownload, DownloadClientItem downloadClientItem) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:line 89

I’d like to be able to put the subtitle group name in the filename with brackets. Interestingly, I’m also unable to include brackets in the episode renamer. Doing so displays the following message:

Produces invalid file names

Any fixes for these would be greatly appreciated!

Brackets are allowed in filenames.

What is your renaming pattern?

Not currently at home so I can’t get the exact pattern, but I know it’s the default with {Release Group} at the front. When I try to put brackets around release group, [{Release Group}], I get the error.

Any idea why I’m getting errors when trying to move files with brackets in them?

Offhand no, knowing the renaming pattern as well as the series folder its attempting to move to should help though.

The renaming pattern is:

|{Release Group}| {Series Title} - S{season:00}E{episode:00} - {Absolute:000} - {Episode Title} {Quality Full}

I’m using pipes for now since brackets aren’t working.

The folder it is attempting to move the series to is Akame ga Kill, though it gives me an error for another show as well, the folder being titled Happy Cooking Graffiti.

Whats the full path for those series?

The full paths are: D:\Anime\Akame ga Kill and D:\Anime\Happy Cooking Graffiti.

I made a topic on this a few days earlier but it seems to have fallen into the woodwork. It’s still an issue I’m having, so here it is again:

I’m using Sonarr and SABnzbd to download anime. When Sonarr tries to move completed files into another folder, I get the following error:

Couldn’t import episode D:\sabnzbd complete\tv[HorribleSubs].Akame.ga.Kill!-24.[1080p][HorribleSubs] Akame ga Kill! - 24 [1080p].mkv: Illegal characters in path.

…with the following exception:

15-2-26 17:56:27.5|Warn|ImportApprovedEpisodes|Couldn’t import episode D:\sabnzbd complete\tv\ [HorribleSubs].Akame.ga.Kill!-24.[1080p]\ [HorribleSubs] Akame ga Kill! - 24 [1080p].mkv

System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.Combine(String path1, String path2)
at NzbDrone.Core.Organizer.FileNameBuilder.BuildFilePath(Series series, Int32 seasonNumber, String fileName, String extension) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Organizer\FileNameBuilder.cs:line 163
at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\EpisodeFileMovingService.cs:line 64
at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode, Boolean copyOnly) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\UpgradeMediaFileService.cs:line 64
at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import(List`1 decisions, Boolean newDownload, DownloadClientItem downloadClientItem) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:line 89

All anime downloaded through Sonarr has this issue.

Interestingly, I’m also unable to include brackets in the episode renamer. Doing so displays the following message:

Produces invalid file names

My current naming convention is:

|{Release Group}| {Series Title} - S{season:00}E{episode:00} - {Absolute:000} - {Episode Title} {Quality Full}

Any fixes for these would be greatly appreciated!

I’ve move this post, but please update your existing thread instead of making a new one.

I have taken a look at the naming issue and found a fix, which will be in the next release.

I am unable to reproduce your file renaming issue and it seems to be something with your system or the D:\ drive on your computer.

[ and ] ae valid characters in filenames in Windows and I can create that entire path you provide on my own system (Windows 8.1 with NTFS partition for D:\.

Thanks for the update - I apologize for making a new thread, and thank you for taking a look into the naming issue.

Tried a different hard drive and I’m still getting the issue. If you can’t reproduce it, it must be a problem locally. Thanks for taking the time to check it out.

Cheers.