flexget.utils.pathscrub module#

flexget.utils.pathscrub.pathscrub(dirty_path, os=None, filename=False)[source]#

Strip illegal characters for a given os from a path.

Parameters:
  • dirty_path (str) – Path to be scrubbed.

  • os (str | None) – Defines which os mode should be used, can be ‘windows’, ‘mac’, ‘linux’, or None to auto-detect

  • filename (bool) – If this is True, path separators will be replaced with ‘-’

Returns:

A valid path.

Return type:

str