flexget.components.archives.decompress module#
- class flexget.components.archives.decompress.Decompress[source]#
Bases:
objectExtract files from Zip or RAR archives.
By default this plugin will extract to the same directory as the source archive, preserving directory structure from the archive.
This plugin requires the rarfile Python module and unrar command line utility to extract RAR archives.
Configuration options
Option
Description
to
Destination path; supports Jinja2 templating on the input entry. Fields such as series_name must be populated prior to input into this plugin using metainfo_series or similar. If no path is specified, archive contents will be extracted in the same directory as the archive itself.
keep_dirs
[yes|no] (default: yes) Indicates whether to preserve the directory structure from within the archive in the destination path.
mask
Shell-style file mask; any matching files will be extracted. When used, this field will override regexp.
regexp
Regular expression pattern; any matching files will be extracted. Overridden by mask if specified.
unrar_tool
Specifies the path of the unrar tool. Only necessary if its location is not defined in the operating system’s PATH environment variable.
delete_archive
[yes|no] (default: no) Delete this archive after extraction is completed.
Example:
decompress: to: '/Volumes/External/TV/{{series_name}}/Season {{series_season}}/' keep_dirs: yes regexp: '.*s\d{1,2}e\d{1,2}.*\.mkv'
- static handle_entry(entry, config, test=False)[source]#
Extract matching files into the directory specified.
Optionally delete the original archive if config.delete_archive is True
- schema = {'anyOf': [{'type': 'boolean'}, {'additionalProperties': False, 'properties': {'delete_archive': {'type': 'boolean'}, 'keep_dirs': {'type': 'boolean'}, 'mask': {'type': 'string'}, 'regexp': {'format': 'regex', 'type': 'string'}, 'to': {'type': 'string'}, 'unrar_tool': {'type': 'string'}}, 'type': 'object'}]}#
- flexget.components.archives.decompress.extract_info(info, archive, to, keep_dirs, test=False)[source]#
Extract ArchiveInfo object.
- Parameters:
to (Path)
- flexget.components.archives.decompress.fail_entry_with_error(entry, error)[source]#
Log error message at error level and fail the entry.
- flexget.components.archives.decompress.get_destination_path(info, to, keep_dirs)[source]#
Generate the destination path for a given file.
- flexget.components.archives.decompress.get_output_path(to, entry)[source]#
Determine which path to output to.
- flexget.components.archives.decompress.is_match(info, pattern)[source]#
Return whether an info record matches the supplied regex.