filter Package

filter Package

Plugins for “filter” task phase, and non-modifying download filters.

accept_all Module

class flexget.plugins.filter.accept_all.FilterAcceptAll

Bases: object

Just accepts all entries.

Example:

accept_all: true
on_task_filter(task, config)
schema = {u'type': u'boolean'}
flexget.plugins.filter.accept_all.register_plugin()

all_series Module

class flexget.plugins.filter.all_series.FilterAllSeries

Bases: flexget.plugins.filter.series.FilterSeriesBase

Grabs all entries that appear to be series episodes in a task.

This plugin just configures the series plugin dynamically with all series from the task. It can take any of the options of the series plugin.

Example::
all_series: yes
::
all_series:
quality: hdtv+ propers: no
on_task_metainfo(task, config)
schema
flexget.plugins.filter.all_series.register_plugin()

content_filter Module

class flexget.plugins.filter.content_filter.FilterContentFilter

Bases: object

Rejects entries based on the filenames in the content. Torrent files only right now.

Example:

content_filter:
  require:
    - '*.avi'
    - '*.mkv'
on_task_modify(task, config)
prepare_config(config)
process_entry(task, entry, config)

Process an entry and reject it if it doesn’t pass filter.

Parameters:
  • task – Task entry belongs to.
  • entry – Entry to process
Returns:

True, if entry was rejected.

schema = {u'additionalProperties': False, u'type': u'object', u'properties': {u'require_mainfile': {u'default': False, u'type': u'boolean'}, u'require': {u'oneOf': [{u'minItems': 1, u'items': {u'type': u'string', u'title': u'single value'}, u'type': u'array', u'title': u'multiple values'}, {u'type': u'string', u'title': u'single value'}]}, u'strict': {u'default': False, u'type': u'boolean'}, u'require_all': {u'oneOf': [{u'minItems': 1, u'items': {u'type': u'string', u'title': u'single value'}, u'type': u'array', u'title': u'multiple values'}, {u'type': u'string', u'title': u'single value'}]}, u'reject': {u'oneOf': [{u'minItems': 1, u'items': {u'type': u'string', u'title': u'single value'}, u'type': u'array', u'title': u'multiple values'}, {u'type': u'string', u'title': u'single value'}]}}}
flexget.plugins.filter.content_filter.register_plugin()

content_size Module

class flexget.plugins.filter.content_size.FilterContentSize

Bases: object

on_task_filter(task, config)
on_task_modify(task, config)
process_entry(task, entry, config, remember=True)

Rejects this entry if it does not pass content_size requirements. Returns true if the entry was rejected.

schema = {u'additionalProperties': False, u'type': u'object', u'properties': {u'max': {u'type': u'number'}, u'strict': {u'default': True, u'type': u'boolean'}, u'min': {u'type': u'number'}}}
flexget.plugins.filter.content_size.register_plugin()

crossmatch Module

class flexget.plugins.filter.crossmatch.CrossMatch

Bases: object

Perform action based on item on current task and other inputs.

Example:

crossmatch:
  from:
    - rss: http://example.com/
  fields:
    - title
  action: reject
entry_intersects(e1, e2, fields=None)
Parameters:
Returns:

List of field names in common

on_task_filter(task, config)
schema = {u'additionalProperties': False, u'required': [u'fields', u'action', u'from'], u'type': u'object', u'properties': {u'action': {u'enum': [u'accept', u'reject']}, u'fields': {u'items': {u'type': u'string'}, u'type': u'array'}, u'from': {u'items': {u'$ref': u'/schema/plugins?phase=input'}, u'type': u'array'}}}
flexget.plugins.filter.crossmatch.register_plugin()

delay Module

class flexget.plugins.filter.delay.DelayedEntry(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

entry
expire
id
task
title
class flexget.plugins.filter.delay.FilterDelay

Bases: object

Add delay to a task. This is useful for de-prioritizing expensive / bad-quality tasks.

Format: n [minutes|hours|days|weeks]

Example:

delay: 2 hours
get_delay(config)
on_task_input(task, config)

Captures the current input then replaces it with entries that have passed the delay.

schema = {u'type': u'string', u'format': u'interval'}
flexget.plugins.filter.delay.register_plugin()

exists Module

class flexget.plugins.filter.exists.FilterExists

Bases: object

Reject entries that already exist in given path.

Example:

exists: /storage/movies/
on_task_filter(task, config)
prepare_config(config)
schema = {u'oneOf': [{u'minItems': 1, u'items': {u'title': u'single value', u'type': u'string', u'format': u'path'}, u'type': u'array', u'title': u'multiple values'}, {u'title': u'single value', u'type': u'string', u'format': u'path'}]}
flexget.plugins.filter.exists.register_plugin()

exists_movie Module

class flexget.plugins.filter.exists_movie.FilterExistsMovie

Bases: object

Reject existing movies.

Syntax:

exists_movie:
path: /path/to/movies [type: {dirs|files}] [allow_different_qualities: {better|yes|no}] [lookup: {imdb|no}]
dir_pattern = <_sre.SRE_Pattern object>
file_pattern = <_sre.SRE_Pattern object>
on_task_filter(task, config)
prepare_config(config)
schema = {u'anyOf': [{u'oneOf': [{u'minItems': 1, u'items': {u'title': u'single value', u'type': u'string', u'format': u'path'}, u'type': u'array', u'title': u'multiple values'}, {u'title': u'single value', u'type': u'string', u'format': u'path'}]}, {u'additionalProperties': False, u'required': [u'path'], u'type': u'object', u'properties': {u'path': {u'oneOf': [{u'minItems': 1, u'items': {u'title': u'single value', u'type': u'string', u'format': u'path'}, u'type': u'array', u'title': u'multiple values'}, {u'title': u'single value', u'type': u'string', u'format': u'path'}]}, u'lookup': {u'default': False, u'enum': [u'imdb', False]}, u'type': {u'default': u'dirs', u'enum': [u'files', u'dirs']}, u'allow_different_qualities': {u'default': False, u'enum': [u'better', True, False]}}}]}
flexget.plugins.filter.exists_movie.register_plugin()

exists_series Module

class flexget.plugins.filter.exists_series.FilterExistsSeries

Bases: object

Intelligent series aware exists rejecting.

Example:

exists_series: /storage/series/
on_task_filter(task, config)
prepare_config(config)
schema = {u'anyOf': [{u'oneOf': [{u'minItems': 1, u'items': {u'title': u'single value', u'type': u'string', u'format': u'path'}, u'type': u'array', u'title': u'multiple values'}, {u'title': u'single value', u'type': u'string', u'format': u'path'}]}, {u'additionalProperties': False, u'required': [u'path'], u'type': u'object', u'properties': {u'path': {u'oneOf': [{u'minItems': 1, u'items': {u'title': u'single value', u'type': u'string', u'format': u'path'}, u'type': u'array', u'title': u'multiple values'}, {u'title': u'single value', u'type': u'string', u'format': u'path'}]}, u'allow_different_qualities': {u'default': False, u'enum': [u'better', True, False]}}}]}
flexget.plugins.filter.exists_series.register_plugin()

if_condition Module

class flexget.plugins.filter.if_condition.FilterIf

Bases: object

Can run actions on entries that satisfy a given condition.

Actions include accept, reject, and fail, as well as the ability to run other filter plugins on the entries.

check_condition(condition, entry)

Checks if a given entry passes condition

schema = {u'items': {u'additionalProperties': {u'anyOf': [{u'$ref': u'/schema/plugins'}, {u'enum': [u'accept', u'reject', u'fail']}]}, u'type': u'object'}, u'type': u'array'}
flexget.plugins.filter.if_condition.register_plugin()
flexget.plugins.filter.if_condition.safer_eval(statement, locals)

A safer eval function. Does not allow __ or try statements, only includes certain ‘safe’ builtins.

imdb Module

class flexget.plugins.filter.imdb.FilterImdb

Bases: object

This plugin allows filtering based on IMDB score, votes and genres etc.

Note: All parameters are optional. Some are mutually exclusive.

Configuration:

min_score: <num>
min_votes: <num>
min_year: <num>
max_year: <num>

# accept movies with any of these genres
accept_genres:
  - genre1
  - genre2

# reject if genre contains any of these
reject_genres:
  - genre1
  - genre2

# reject if language contain any of these
reject_languages:
  - language1

# accept only these primary languages
accept_languages:
  - language1

# accept movies with any of these actors
accept_actors:
  - nm0004695
  - nm0004754

# reject movie if it has any of these actors
reject_actors:
  - nm0001191
  - nm0002071

# accept all movies by these directors
accept_directors:
  - nm0000318

# reject movies by these directors
reject_directors:
  - nm0093051

# reject movies/TV shows with any of these ratings
reject_mpaa_ratings:
  - PG_13
  - R
  - X

# accept movies/TV shows with only these ratings
accept_mpaa_ratings:
  - PG
  - G
  - TV_Y
on_task_filter(task, config)
schema = {u'additionalProperties': False, u'type': u'object', u'properties': {u'min_votes': {u'type': u'integer'}, u'reject_languages': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_directors': {u'items': {u'type': u'string'}, u'type': u'array'}, u'reject_actors': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_mpaa_ratings': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_genres': {u'items': {u'type': u'string'}, u'type': u'array'}, u'reject_mpaa_ratings': {u'items': {u'type': u'string'}, u'type': u'array'}, u'min_score': {u'type': u'number'}, u'accept_languages': {u'items': {u'type': u'string'}, u'type': u'array'}, u'reject_directors': {u'items': {u'type': u'string'}, u'type': u'array'}, u'min_year': {u'type': u'integer'}, u'accept_actors': {u'items': {u'type': u'string'}, u'type': u'array'}, u'max_year': {u'type': u'integer'}, u'reject_genres': {u'items': {u'type': u'string'}, u'type': u'array'}}}
flexget.plugins.filter.imdb.register_plugin()

imdb_rated Module

imdb_required Module

class flexget.plugins.filter.imdb_required.FilterImdbRequired

Bases: object

Rejects entries without imdb_url or imdb_id. Makes imdb lookup / search if necessary.

Example:

imdb_required: yes
on_task_filter(task, config)
schema = {u'type': u'boolean'}
flexget.plugins.filter.imdb_required.register_plugin()

limit_new Module

class flexget.plugins.filter.limit_new.FilterLimitNew

Bases: object

Limit number of new items.

Example:

limit_new: 1

This would allow only one new item to pass trough per execution. Useful for passing torrents slowly into download.

Note that since this is per execution, actual rate depends how often FlexGet is executed.

on_task_filter(task, config)
schema = {u'minimum': 1, u'type': u'integer'}
flexget.plugins.filter.limit_new.register_plugin()

movie_queue Module

class flexget.plugins.filter.movie_queue.MovieQueue

Bases: flexget.plugins.filter.queue_base.FilterQueueBase

matches(task, config, entry)
on_task_output(task, config)
schema = {u'oneOf': [{u'enum': [u'accept', u'add', u'remove', u'forget'], u'type': u'string'}, {u'additionalProperties': False, u'required': [u'action'], u'type': u'object', u'properties': {u'action': {u'enum': [u'accept', u'add', u'remove', u'forget'], u'type': u'string'}, u'quality': {u'type': u'string', u'format': u'quality_requirements'}}}]}
exception flexget.plugins.filter.movie_queue.QueueError(message, errno=0)

Bases: exceptions.Exception

Exception raised if there is an error with a queue operation

class flexget.plugins.filter.movie_queue.QueuedMovie(**kwargs)

Bases: flexget.plugins.filter.queue_base.QueuedItem

added
discriminator
downloaded
entry_original_url
entry_title
entry_url
id
imdb_id
quality
title
tmdb_id
flexget.plugins.filter.movie_queue.migrate_imdb_queue(manager)

If imdb_queue table is found, migrate the data to movie_queue

flexget.plugins.filter.movie_queue.register_plugin()

only_new Module

class flexget.plugins.filter.only_new.FilterOnlyNew

Bases: object

Causes input plugins to only emit entries that haven’t been seen on previous runs.

on_task_learn(task, config)

Reject all entries so remember_rejected will reject them next time

on_task_start(task, config)

Make sure the remember_rejected plugin is available

schema = {u'type': u'boolean'}
flexget.plugins.filter.only_new.register_plugin()

private_torrents Module

class flexget.plugins.filter.private_torrents.FilterPrivateTorrents

Bases: object

How to handle private torrents.

private_torrents: yes|no

Example:

private_torrents: no

This would reject all torrent entries with private flag.

Example:

private_torrents: yes

This would reject all public torrents.

Non-torrent content is not interviened.

on_task_modify(task, config)
schema = {u'type': u'boolean'}
flexget.plugins.filter.private_torrents.register_plugin()

proper_movies Module

class flexget.plugins.filter.proper_movies.FilterProperMovies

Bases: object

Automatically download proper movies.

Configuration:

proper_movies: n <minutes|hours|days|weeks>

or permanently:

proper_movies: yes

Value no will disable plugin.

on_task_filter(task, config)
on_task_learn(task, config)

Add downloaded movies to the database

schema = {u'oneOf': [{u'type': u'boolean'}, {u'type': u'string', u'format': u'interval'}]}
class flexget.plugins.filter.proper_movies.ProperMovie

Bases: sqlalchemy.ext.declarative.api.Base

added
id
imdb_id
proper_count
quality
task
title
flexget.plugins.filter.proper_movies.register_plugin()

quality Module

class flexget.plugins.filter.quality.FilterQuality

Bases: object

Rejects all entries that don’t have one of the specified qualities

Example:

quality:
  - hdtv
on_task_filter(task, config)
schema = {u'oneOf': [{u'minItems': 1, u'items': {u'title': u'single value', u'type': u'string', u'format': u'quality_requirements'}, u'type': u'array', u'title': u'multiple values'}, {u'title': u'single value', u'type': u'string', u'format': u'quality_requirements'}]}
flexget.plugins.filter.quality.register_plugin()

queue_base Module

class flexget.plugins.filter.queue_base.FilterQueueBase

Bases: object

Base class to handle general tasks of keeping a queue of wanted items.

matches(task, config, entry)

This should return the QueueItem object for the match, if this entry is in the queue.

on_task_filter(task, config)
on_task_learn(task, config)
on_task_start(task, config)
schema = {u'type': u'boolean'}
class flexget.plugins.filter.queue_base.QueuedItem(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

added
discriminator
downloaded
entry_original_url
entry_title
entry_url
id
title

regexp Module

class flexget.plugins.filter.regexp.FilterRegexp

Bases: object

All possible forms.

regexp:
[operation]: # operation to perform on matches
  • [regexp] # simple regexp

  • [regexp]: <path> # override path

  • [regexp]:

    [path]: <path> # override path [not]: <regexp> # not match [from]: <field> # search from given entry field

  • [regexp]:

    [path]: <path> # override path [not]: # list of not match regexps

    • <regexp>
    [from]: # search only from these fields
    • <field>
[operation]:
  • <regexp>

[rest]: <operation> # non matching entries are [from]: # search only from these fields for all regexps

  • <field>

Possible operations: accept, reject, accept_excluding, reject_excluding

filter(task, operation, regexps)
Parameters:
  • task – Task instance
  • operation – one of ‘accept’ ‘reject’ ‘accept_excluding’ and ‘reject_excluding’ accept and reject will be called on the entry if any of the regxps match *_excluding operations will be called if any of the regexps don’t match
  • regexps – list of {compiled_regexp: options} dictionaries
Returns:

Return list of entries that didn’t match regexps

matches(entry, regexp, find_from=None, not_regexps=None)

Check if :entry: has any string fields or strings in a list field that match :regexp:

Parameters:
  • entry – Entry instance
  • regexp – Compiled regexp
  • find_from – None or a list of fields to search from
  • not_regexps – None or list of regexps that can NOT match
Returns:

Field matching

on_task_filter(task, config)
prepare_config(config)

Returns the config in standard format.

All regexps are turned into dictionaries in the form of {compiled regexp: options}

Parameters:config – Dict that can optionally contain the following keys path: will be attached to entries that match set: a dict of values to be attached to entries that match via set plugin from: a list of fields in entry for the regexps to match against not: a list of compiled regexps that if matching, will disqualify the main match
Returns:New config dictionary
schema = {u'additionalProperties': False, u'definitions': {u'regex_list': {u'items': {u'oneOf': [{u'type': u'string', u'format': u'regex'}, {u'additionalProperties': {u'oneOf': [{u'type': u'string', u'format': u'path'}, {u'additionalProperties': False, u'type': u'object', u'properties': {u'not': {u'oneOf': [{u'minItems': 1, u'items': {u'title': u'single value', u'type': u'string', u'format': u'regex'}, u'type': u'array', u'title': u'multiple values'}, {u'title': u'single value', u'type': u'string', u'format': u'regex'}]}, u'path': {u'type': u'string', u'format': u'path'}, u'set': {u'type': u'object'}, u'from': {u'oneOf': [{u'minItems': 1, u'items': {u'type': u'string', u'title': u'single value'}, u'type': u'array', u'title': u'multiple values'}, {u'type': u'string', u'title': u'single value'}]}}}]}, u'type': u'object'}]}, u'type': u'array'}}, u'type': u'object', u'properties': {u'from': {u'oneOf': [{u'minItems': 1, u'items': {u'type': u'string', u'title': u'single value'}, u'type': u'array', u'title': u'multiple values'}, {u'type': u'string', u'title': u'single value'}]}, u'rest': {u'enum': [u'accept', u'reject'], u'type': u'string'}, u'reject_excluding': {u'$ref': u'#/definitions/regex_list'}, u'accept': {u'$ref': u'#/definitions/regex_list'}, u'reject': {u'$ref': u'#/definitions/regex_list'}, u'accept_excluding': {u'$ref': u'#/definitions/regex_list'}}}
flexget.plugins.filter.regexp.register_plugin()

retry_failed Module

class flexget.plugins.filter.retry_failed.FailedEntry(title, url, reason=None)

Bases: sqlalchemy.ext.declarative.api.Base

count
id
reason
retry_time
title
tof
url
class flexget.plugins.filter.retry_failed.PluginFailed

Bases: object

Records entry failures and stores them for trying again after a certain interval. Rejects them after they have failed too many times.

add_failed(entry, reason=None, config=None, **kwargs)

Adds entry to internal failed list, displayed with –failed

on_task_filter(task, config)
on_task_input(task, config)
prepare_config(config)
retry_time(fail_count, config)

Return the timedelta an entry that has failed fail_count times before should wait before being retried.

schema = {u'oneOf': [{u'type': u'boolean'}, {u'additionalProperties': False, u'type': u'object', u'properties': {u'retry_time': {u'default': u'1 hour', u'type': u'string', u'format': u'interval'}, u'max_retries': {u'default': 3, u'minimum': 0, u'type': u'integer'}, u'retry_time_multiplier': {u'default': 1.5, u'oneOf': [{u'minimum': 0, u'type': u'number'}, {u'type': u'boolean'}]}}}]}
flexget.plugins.filter.retry_failed.clear_failed(manager)
flexget.plugins.filter.retry_failed.do_cli(manager, options)
flexget.plugins.filter.retry_failed.list_failed()
flexget.plugins.filter.retry_failed.register_parser_arguments()
flexget.plugins.filter.retry_failed.register_plugin()

remember_rejected Module

class flexget.plugins.filter.remember_rejected.FilterRememberRejected

Bases: object

Internal. Rejects entries which have been rejected in the past.

This is enabled when item is rejected with remember=True flag.

Example::
entry.reject(‘message’, remember=True)
on_entry_reject(entry, remember=None, remember_time=None, **kwargs)
on_task_filter(task, config)

Reject any remembered entries from previous runs

on_task_input(task, config)
on_task_learn(task, config)
on_task_start(task, config)

Purge remembered entries if the config has changed.

class flexget.plugins.filter.remember_rejected.RememberEntry(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

added
expires
id
reason
rejected_by
task_id
title
url
class flexget.plugins.filter.remember_rejected.RememberTask(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

entries
id
name
flexget.plugins.filter.remember_rejected.clear_rejected(manager)
flexget.plugins.filter.remember_rejected.db_cleanup(manager, session)
flexget.plugins.filter.remember_rejected.do_cli(manager, options)
flexget.plugins.filter.remember_rejected.list_rejected()
flexget.plugins.filter.remember_rejected.register_parser_arguments()
flexget.plugins.filter.remember_rejected.register_plugin()

require_field Module

class flexget.plugins.filter.require_field.FilterRequireField

Bases: object

Rejects entries without defined field.

Example:

require_field: imdb_url
on_task_filter(task, config)
schema = {u'oneOf': [{u'minItems': 1, u'items': {u'type': u'string', u'title': u'single value'}, u'type': u'array', u'title': u'multiple values'}, {u'type': u'string', u'title': u'single value'}]}
flexget.plugins.filter.require_field.register_plugin()

seen Module

Listens events:

forget (string)

Given string can be task name, remembered field (url, imdb_url) or a title. If given value is a task name then everything in that task will be forgotten. With title all learned fields from it and the title will be forgotten. With field value only that particular field is forgotten.
class flexget.plugins.filter.seen.FilterSeen

Bases: object

Remembers previously downloaded content and rejects them in subsequent executions. Without this plugin FlexGet would download all matching content on every execution.

This plugin is enabled on all tasks by default. See wiki for more information.

forget(task, title)

Forget SeenEntry with :title:. Return True if forgotten.

learn(task, entry, fields=None, reason=None, local=False)

Marks entry as seen

on_task_filter(task, config, remember_rejected=False)

Filter entries already accepted on previous runs.

on_task_learn(task, config)

Remember succeeded entries

schema = {u'oneOf': [{u'type': u'boolean'}, {u'enum': [u'global', u'local'], u'type': u'string'}]}
class flexget.plugins.filter.seen.SeenEntry(title, task, reason=None, local=False)

Bases: sqlalchemy.ext.declarative.api.Base

added
fields
id
local
reason
task
title
class flexget.plugins.filter.seen.SeenField(field, value)

Bases: sqlalchemy.ext.declarative.api.Base

added
field
id
seen_entry_id
value
flexget.plugins.filter.seen.db_cleanup(manager, session)
flexget.plugins.filter.seen.do_cli(manager, options)
flexget.plugins.filter.seen.forget(value)

See module docstring :param string value: Can be task name, entry title or field value :return: count, field_count where count is number of entries removed and field_count number of fields

flexget.plugins.filter.seen.register_parser_arguments()
flexget.plugins.filter.seen.register_plugin()
flexget.plugins.filter.seen.seen_add(options)
flexget.plugins.filter.seen.seen_forget(manager, options)

seen_info_hash Module

class flexget.plugins.filter.seen_info_hash.FilterSeenInfoHash

Bases: flexget.plugins.filter.seen.FilterSeen

Prevents the same torrent from being downloaded twice by remembering the infohash of all downloaded torrents.

on_task_filter(task, config)
on_task_modify(task, config)
schema = {u'oneOf': [{u'type': u'boolean'}, {u'enum': [u'global', u'local'], u'type': u'string'}]}
flexget.plugins.filter.seen_info_hash.register_plugin()

seen_movies Module

class flexget.plugins.filter.seen_movies.FilterSeenMovies

Bases: flexget.plugins.filter.seen.FilterSeen

Prevents movies being downloaded twice. Works only on entries which have imdb url available.

How duplicate movie detection works: 1) Remember all imdb urls from downloaded entries. 2) If stored imdb url appears again, entry is rejected.

on_task_filter(task, config)
schema = {u'oneOf': [{u'enum': [u'strict', u'loose'], u'type': u'string'}, {u'additionalProperties': False, u'type': u'object', u'properties': {u'scope': {u'enum': [u'global', u'local'], u'type': u'string'}, u'matching': {u'enum': [u'strict', u'loose'], u'type': u'string'}}}]}
flexget.plugins.filter.seen_movies.register_plugin()

series Module

class flexget.plugins.filter.series.AlternateNames(name)

Bases: sqlalchemy.ext.declarative.api.Base

Similar to Series. Name is handled case insensitively transparently.

alt_name
id
name_comparator()
name_getter()
name_setter(value)
series_id
class flexget.plugins.filter.series.Episode(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

age
Returns:Pretty string representing age of episode. eg “23d 12h” or “No releases seen”
downloaded_releases
first_seen = <sqlalchemy.sql.elements.Label object>
id
identified_by
identifier
is_premiere
number
releases
season
series_id
class flexget.plugins.filter.series.FilterSeries

Bases: flexget.plugins.filter.series.FilterSeriesBase

Intelligent filter for tv-series.

http://flexget.com/wiki/Plugins/series

auto_exact(config)

Automatically enable exact naming option for series that look like a problem

on_task_filter(task, config)

Filter series

on_task_learn(task, config)

Learn succeeded episodes

on_task_metainfo(task, config)
parse_series(entries, series_name, config)

Search for series_name and populate all series_* fields in entries when successfully parsed

Parameters:
  • session – SQLAlchemy session
  • entries – List of entries to process
  • series_name – Series name which is being processed
  • config – Series config being processed
process_episode_tracking(episode, entries, grace, backfill=False)

Rejects all episodes that are too old or new, return True when this happens.

Parameters:
  • episode – Episode model
  • entries (list) – List of entries for given episode.
  • grace (int) – Number of episodes before or after latest download that are allowed.
  • backfill (bool) – If this is True, previous episodes will be allowed, but forward advancement will still be restricted.
process_propers(config, episode, entries)

Accepts needed propers. Nukes episodes from which there exists proper.

Returns:A list of episodes to continue processing.
process_qualities(config, entries, downloaded)

Handles all modes that can accept more than one quality per episode. (qualities, upgrade)

Returns:True - if at least one wanted quality has been downloaded or accepted. False - if no wanted qualities have been accepted
process_quality(config, entries)

Filters eps that do not fall between within our defined quality standards.

Returns:A list of eps that are in the acceptable range
process_series(task, series_entries, config)

Accept or Reject episode from available releases, or postpone choosing.

Parameters:
  • task – Current Task
  • series_entries – dict mapping Episodes to entries for that episode
  • config – Series configuration
process_timeframe(task, config, episode, entries)

Runs the timeframe logic to determine if we should wait for a better quality. Saves current best to backlog if timeframe has not expired.

Returns:True - if we should keep the quality (or qualities) restriction False - if the quality restriction should be released, due to timeframe expiring
process_timeframe_target(config, entries, downloaded=None)

Accepts first episode matching the quality configured for the series.

Returns:True if accepted something
schema
class flexget.plugins.filter.series.FilterSeriesBase

Bases: object

Class that contains helper methods for both filter.series as well as plugins that configure it, such as all_series, series_premiere and configure_series.

apply_group_options(config)

Applies group settings to each item in series group and removes settings dict.

combine_series_lists(*series_lists, **kwargs)

Combines the series from multiple lists, making sure there are no doubles.

If keyword argument log_once is set to True, an error message will be printed if a series is listed more than once, otherwise log_once will be used.

make_grouped_config(config)

Turns a simple series list into grouped format with a empty settings dict

merge_config(task, config)

Merges another series config dict in with the current one.

prepare_config(config)

Generate a list of unique series from configuration. This way we don’t need to handle two different configuration formats in the logic. Applies group settings with advanced form.

settings_schema
class flexget.plugins.filter.series.NormalizedComparator(expression)

Bases: sqlalchemy.ext.hybrid.Comparator

operate(op, other)
class flexget.plugins.filter.series.Release

Bases: sqlalchemy.ext.declarative.api.Base

downloaded
episode_id
first_seen
id
proper
proper_count
quality
title
class flexget.plugins.filter.series.Series(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

Name is handled case insensitively transparently

alternate_names
begin
begin_episode_id
episodes
id
identified_by
in_tasks
name
name_comparator()
name_getter()
name_setter(value)
class flexget.plugins.filter.series.SeriesDBManager

Bases: flexget.plugins.filter.series.FilterSeriesBase

Update in the database with series info from the config

on_task_start(task, config)
class flexget.plugins.filter.series.SeriesTask(name)

Bases: sqlalchemy.ext.declarative.api.Base

id
name
series_id
flexget.plugins.filter.series.auto_identified_by(series)

Determine if series name should be considered identified by episode or id format

Returns ‘ep’, ‘sequence’, ‘date’ or ‘id’ if enough history is present to identify the series’ id type. Returns ‘auto’ if there is not enough history to determine the format yet

flexget.plugins.filter.series.clean_series(manager)
flexget.plugins.filter.series.db_cleanup(manager, session)
flexget.plugins.filter.series.forget_series(name)

Remove a whole series name from database.

flexget.plugins.filter.series.forget_series_episode(name, identifier)

Remove all episodes by identifier from series name from database.

flexget.plugins.filter.series.get_latest_episode(series)

Return latest known identifier in dict (season, episode, name) for series name

flexget.plugins.filter.series.get_latest_release(series, downloaded=True, season=None)
Parameters:
  • series (Series) – SQLAlchemy session
  • Downloaded – find only downloaded releases
  • Season – season to find newest release for
Returns:

Instance of Episode or None if not found.

flexget.plugins.filter.series.new_eps_after(since_ep)
Parameters:since_ep – Episode instance
Returns:Number of episodes since then
flexget.plugins.filter.series.normalize_series_name(name)

Returns a normalized version of the series name.

flexget.plugins.filter.series.populate_entry_fields(entry, parser, config)

Populates all series_fields for given entry based on parser.

Parameters:parser – A valid result from a series parser used to populate the fields.
Config dict:If supplied, will use ‘path’ and ‘set’ options to populate specified fields.
flexget.plugins.filter.series.register_parser_arguments()
flexget.plugins.filter.series.register_plugin()
flexget.plugins.filter.series.repair(manager)
flexget.plugins.filter.series.set_series_begin(series, ep_id)

Set beginning for series

Parameters:
  • series (Series) – Series instance
  • ep_id – Integer for sequence mode, SxxEyy for episodic and yyyy-mm-dd for date.
Raises ValueError:
 

If malformed ep_id or series in different mode

flexget.plugins.filter.series.store_parser(session, parser, series=None, quality=None)

Push series information into database. Returns added/existing release.

Parameters:
  • session – Database session to use
  • parser – parser for release that should be added to database
  • series – Series in database to add release to. Will be looked up if not provided.
  • quality – If supplied, this will override the quality from the series parser
Returns:

List of Releases

series_premiere Module

class flexget.plugins.filter.series_premiere.FilterSeriesPremiere

Bases: flexget.plugins.filter.series.FilterSeriesBase

Accept an entry that appears to be the first episode of any series.

Can be configured with any of the options of series plugin Examples:

series_premiere: yes

series_premiere:
path: ~/Media/TV/_NEW_/. quality: 720p timeframe: 12 hours

NOTE: this plugin only looks in the entry title and expects the title format to start with the series name followed by the episode info. Use the manipulate plugin to modify the entry title to match this format, if necessary.

TODO:
  • integrate thetvdb to allow refining by genres, etc.
on_task_metainfo(task, config)
schema
flexget.plugins.filter.series_premiere.register_plugin()

thetvdb Module

class flexget.plugins.filter.thetvdb.FilterTvdb

Bases: object

This plugin allows filtering based on thetvdb series rating, episode rating, status, genres, runtime, content-rating, languages, directors, writers, network, guest stars, episode rating, and actors

Configuration:

Note: All parameters are optional. Some are mutually exclusive.

min_series_rating: <num> min_episode_rating: <num> min_episode_air_year: <num> max_episode_air_year: <num> min_episode_runtime: <num> max_episode_runtime: <num>

# reject if genre contains any of these reject_content_rating:

  • TV-MA

# accept only this content rating accept_content_rating:

  • TV-PG

# accept only these networks accept_network:

  • NBC

# reject if this network reject_network:

  • ABC

# reject if genre contains any of these reject_genres:

  • drama
  • romance

# reject if status contains any of these reject_status:

  • Ended

# reject if language contain any of these reject_languages:

  • fr

# accept only this language accept_languages:

  • en

# Actors below take into account series actors, and guest stars # accept episode with any of these actors accept_actors:

  • Heidi Klum
  • Bruce Willis

# reject episode if it has any of these actors reject_actors:

  • Cher
  • Tamala Jones

# accept all episodes by these writers accept_writers:

  • Andrew W. Marlowe

# reject episodes by these writers reject_writers:

  • Barry Schindel

# accept all episodes by these directors accept_directors:

  • Rob Bowman

# reject movies by these directors reject_directors:

  • John Terlesky
is_in_set(config, configkey, entryitem)

this takes the config object, config key (to a list), and entry item so it can return True if the object matches, (be that a subset of the list, or if the entry item is contained within the config object list) or false if it does not.

on_task_filter(task, config)
schema = {u'additionalProperties': False, u'type': u'object', u'properties': {u'reject_languages': {u'items': {u'type': u'string'}, u'type': u'array'}, u'reject_actors': {u'items': {u'type': u'string'}, u'type': u'array'}, u'min_episode_runtime': {u'type': u'number'}, u'max_episode_runtime': {u'type': u'number'}, u'reject_status': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_languages': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_writers': {u'items': {u'type': u'string'}, u'type': u'array'}, u'min_episode_rating': {u'type': u'number'}, u'min_episode_air_year': {u'type': u'integer'}, u'reject_writers': {u'items': {u'type': u'string'}, u'type': u'array'}, u'reject_genres': {u'items': {u'type': u'string'}, u'type': u'array'}, u'reject_network': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_directors': {u'items': {u'type': u'string'}, u'type': u'array'}, u'max_episode_air_year': {u'type': u'integer'}, u'reject_content_rating': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_content_rating': {u'items': {u'type': u'string'}, u'type': u'array'}, u'accept_network': {u'items': {u'type': u'string'}, u'type': u'array'}, u'reject_directors': {u'items': {u'type': u'string'}, u'type': u'array'}, u'min_series_rating': {u'type': u'number'}, u'accept_actors': {u'items': {u'type': u'string'}, u'type': u'array'}}}
flexget.plugins.filter.thetvdb.register_plugin()

torrent_alive Module

class flexget.plugins.filter.torrent_alive.TorrentAlive

Bases: object

on_task_filter(task, config)
on_task_output(task, config)
prepare_config(config)
schema = {u'oneOf': [{u'type': u'boolean'}, {u'type': u'integer'}, {u'additionalProperties': False, u'type': u'object', u'properties': {u'min_seeds': {u'type': u'integer'}, u'reject_for': {u'type': u'string', u'format': u'interval'}}}]}
class flexget.plugins.filter.torrent_alive.TorrentAliveThread(tracker, info_hash)

Bases: threading.Thread

run()
flexget.plugins.filter.torrent_alive.get_http_seeds(url, info_hash)
flexget.plugins.filter.torrent_alive.get_scrape_url(tracker_url, info_hash)
flexget.plugins.filter.torrent_alive.get_tracker_seeds(url, info_hash)
flexget.plugins.filter.torrent_alive.get_udp_seeds(url, info_hash)
flexget.plugins.filter.torrent_alive.max_seeds_from_threads(threads)

Joins the threads and returns the maximum seeds found from any of them.

Parameters:threads – A list of started TorrentAliveThread
Returns:Maximum seeds found from any of the threads
flexget.plugins.filter.torrent_alive.register_plugin()