flexget.plugins.modify.path_by_space module#

class flexget.plugins.modify.path_by_space.DiskStats(path, free_bytes, used_bytes, total_bytes, free_percent, used_percent)[source]#

Bases: NamedTuple

Parameters:
classmethod _make(iterable)#

Make a new DiskStats object from a sequence or iterable

_asdict()#

Return a new dict which maps field names to their values.

_replace(**kwds)#

Return a new DiskStats object replacing specified fields with new values

_field_defaults = {}#
_fields = ('path', 'free_bytes', 'used_bytes', 'total_bytes', 'free_percent', 'used_percent')#
free_bytes: c_ulong | int#

Alias for field number 1

free_percent: float#

Alias for field number 4

path: str#

Alias for field number 0

total_bytes: c_ulong | int#

Alias for field number 3

used_bytes: c_ulong | int#

Alias for field number 2

used_percent: float#

Alias for field number 5

class flexget.plugins.modify.path_by_space.PluginPathBySpace[source]#

Bases: object

Allow setting a field to a folder based on it’s space.

Path will be selected at random if multiple paths match the within

Example:

path_by_space:
  select: most_free_percent # or most_free, most_used, most_used_percent, has_free
  within: 9000 # within in MB or percent.
  paths:
    - /drive1/
    - /drive2/
    - /drive3/
on_task_metainfo(task, config)[source]#
schema = {'additionalProperties': False, 'properties': {'paths': {'oneOf': [{'items': {'format': 'path', 'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'format': 'path', 'title': 'single value', 'type': 'string'}]}, 'select': {'enum': ['most_free', 'most_used', 'most_free_percent', 'most_used_percent'], 'type': 'string'}, 'to_field': {'default': 'path', 'type': 'string'}, 'within': {'oneOf': [{'format': 'size', 'type': 'string'}, {'format': 'percent', 'type': 'string'}]}}, 'required': ['paths', 'select'], 'type': 'object'}#
flexget.plugins.modify.path_by_space._path_selector(paths, within, stat_attr)[source]#
flexget.plugins.modify.path_by_space.disk_stats(folder)[source]#
flexget.plugins.modify.path_by_space.os_disk_stats(folder)[source]#

Return drive free, used and total bytes.

flexget.plugins.modify.path_by_space.register_plugin()[source]#
flexget.plugins.modify.path_by_space.select_most_free(paths, within)[source]#
flexget.plugins.modify.path_by_space.select_most_free_percent(paths, within)[source]#
flexget.plugins.modify.path_by_space.select_most_used(paths, within)[source]#
flexget.plugins.modify.path_by_space.select_most_used_percent(paths, within)[source]#