input Package

input Package

Plugins for “input” task phase.

apple_trailers Module

class flexget.plugins.input.apple_trailers.AppleTrailers

Bases: flexget.plugins.input.rss.InputRSS

Adds support for Apple.com movie trailers.

Configuration: quality: Set the desired resolution - 480p or 720p. default ‘720p’ genres: List of genres used to filter the entries. If set, the trailer must match at least one listed genre to be accepted. Genres that can be used: Action and Adventure, Comedy, Documentary, Drama, Family, Fantasy, Foreign, Horror, Musical, Romance, Science Fiction, Thriller. default ‘’ (all)

apple_trailers:
quality: 720p genres: [‘Action and Adventure’]

Alternatively, a simpler configuration format can be used. This uses the default genre filter, all:

apple_trailers: 720p

This plugin adds the following fields to the entry:
movie_name, movie_year, genres, apple_trailers_name, movie_studio

movie_name: Name of the movie movie_year: Year the movie was/will be released genres: Comma-separated list of genres that apply to the movie apple_trailers_name: Contains the Apple-supplied name of the clip, such as ‘Clip 2’, ‘Trailer’, ‘Winter Olympic Preview’ movie_studio: Name of the studio that makes the movie

on_task_input(*args, **kwargs)
on_task_start(task, config)
qualities = [u'480p', u'720p']
rss_url = u'http://trailers.apple.com/trailers/home/rss/newtrailers.rss'
schema = {u'oneOf': [{u'additionalProperties': False, u'type': u'object', u'properties': {u'genres': {u'items': {u'type': u'string'}, u'type': u'array'}, u'quality': {u'default': u'720p', u'enum': [u'480p', u'720p'], u'type': u'string'}}}, {u'enum': [u'480p', u'720p'], u'type': u'string', u'title': u'justquality'}]}
flexget.plugins.input.apple_trailers.register_plugin()

backlog Module

class flexget.plugins.input.backlog.BacklogEntry(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

entry
expire
id
task
title
class flexget.plugins.input.backlog.InputBacklog

Bases: object

Keeps task history for given amount of time.

Example:

backlog: 4 days

Rarely useful for end users, mainly used by other plugins.

add_backlog(*args, **kwargs)
get_injections(*args, **kwargs)
learn_backlog(task, amount=u'')

Learn current entries into backlog. All task inputs must have been executed.

on_task_abort(task, config)

Remember all entries until next execution when task gets aborted.

on_task_input(task, config)
schema = {u'type': u'string', u'format': u'interval'}
flexget.plugins.input.backlog.register_plugin()

discover Module

class flexget.plugins.input.discover.Discover

Bases: object

Discover content based on other inputs material.

Example:

discover:
  what:
    - emit_series: yes
  from:
    - piratebay
  interval: [1 hours|days|weeks]
  ignore_estimations: [yes|no]
entry_complete(entry, query=None, search_results=None, **kwargs)
estimated(entries)
Returns:Entries that we have estimated to be available
execute_inputs(config, task)
Parameters:
  • config – Discover config
  • task – Current task
Returns:

List of pseudo entries created by inputs under what configuration

execute_searches(config, entries, task)
Parameters:
  • config – Discover plugin config
  • entries – List of pseudo entries to search
  • task – Task being run
Returns:

List of entries found from search engines listed under from configuration

interval_expired(config, task, entries)

Maintain some limit levels so that we don’t hammer search sites with unreasonable amount of queries.

Returns:Entries that are up for config['interval']
interval_total_seconds(interval)

Because python 2.6 doesn’t have total_seconds()

on_task_input(task, config)
schema = {u'additionalProperties': False, u'required': [u'what', u'from'], u'type': u'object', u'properties': {u'limit': {u'minimum': 1, u'type': u'integer'}, u'what': {u'items': {u'allOf': [{u'$ref': u'/schema/plugins?phase=input'}, {u'maxProperties': 1, u'minProperties': 1}]}, u'type': u'array'}, u'interval': {u'default': u'5 hours', u'type': u'string', u'format': u'interval'}, u'from': {u'items': {u'allOf': [{u'$ref': u'/schema/plugins?group=search'}, {u'maxProperties': 1, u'minProperties': 1}]}, u'type': u'array'}, u'ignore_estimations': {u'default': False, u'type': u'boolean'}}}
class flexget.plugins.input.discover.DiscoverEntry(title, task)

Bases: sqlalchemy.ext.declarative.api.Base

id
last_execution
task
title
flexget.plugins.input.discover.db_cleanup(manager, session)
flexget.plugins.input.discover.register_parser_arguments()
flexget.plugins.input.discover.register_plugin()

emit_movie_queue Module

class flexget.plugins.input.emit_movie_queue.EmitMovieQueue

Bases: object

Use your movie queue as an input by emitting the content of it

on_task_input(task, config)
prepare_config(config)
schema = {u'oneOf': [{u'type': u'boolean'}, {u'additionalProperties': False, u'type': u'object', u'properties': {u'quality': {u'type': u'boolean'}, u'year': {u'type': u'boolean'}}}]}
flexget.plugins.input.emit_movie_queue.register_plugin()

emit_series Module

class flexget.plugins.input.emit_series.EmitSeries

Bases: object

Emit next episode number from all series configured in this task.

Supports only ‘ep’ and ‘sequence’ mode series.

ep_identifiers(season, episode)
on_search_complete(entry, task=None, identified_by=None, **kwargs)

Decides whether we should look for next ep/season based on whether we found/accepted any episodes.

on_task_input(task, config)
schema = {u'oneOf': [{u'type': u'boolean'}, {u'additionalProperties': False, u'type': u'object', u'properties': {u'backfill': {u'default': False, u'type': u'boolean'}, u'from_start': {u'default': False, u'type': u'boolean'}}}]}
search_entry(series, season, episode, task, rerun=True)
sequence_identifiers(episode)
flexget.plugins.input.emit_series.register_plugin()

find Module

class flexget.plugins.input.find.InputFind

Bases: object

Uses local path content as an input, recurses through directories and creates entries for files that match mask.

You can specify either the mask key, in shell file matching format, (see python fnmatch module,) or regexp key.

Example:

find:
  path: /storage/movies/
  mask: *.avi

Example:

find:
  path:
    - /storage/movies/
    - /storage/tv/
  regexp: .*\.(avi|mkv)$
on_task_input(task, config)
prepare_config(config)
schema = {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'mask': {u'type': u'string'}, u'recursive': {u'type': u'boolean'}, u'regexp': {u'type': u'string', u'format': u'regex'}}}
flexget.plugins.input.find.register_plugin()

gen_series Module

class flexget.plugins.input.gen_series.GenSeries

Bases: object

Purely for debugging purposes. Not great quality :)

gen_series_data:

series: NUM seasons: NUM episodes: NUM qualities:

  • LIST

This will also auto configure series plugin for testing

on_task_exit(task, config)
on_task_input(task, config)
on_task_start(task, config)
schema = {u'type': u'object', u'minProperties': 1}
flexget.plugins.input.gen_series.register_plugin()

generate Module

class flexget.plugins.input.generate.Generate

Bases: object

Generates n number of random entries. Used for debugging purposes.

on_task_input(task, config)
schema = {u'type': u'integer'}
flexget.plugins.input.generate.register_plugin()

html Module

class flexget.plugins.input.html.InputHtml

Bases: object

Parses urls from html page. Usefull on sites which have direct download links of any type (mp3, jpg, torrent, ...).

Many anime-fansubbers do not provide RSS-feed, this works well in many cases.

Configuration expects url parameter.

Note: This returns ALL links on url so you need to configure filters to match only to desired content.

build_config(config)
create_entries(page_url, soup, config)
on_task_input(*args, **kwargs)
validator()
flexget.plugins.input.html.register_plugin()

imdb_list Module

class flexget.plugins.input.imdb_list.ImdbList

Bases: object

“Creates an entry for each movie in your imdb list.

on_task_input(*args, **kwargs)
schema = {u'error_anyOf': u'user_id is required if not using a custom list (lsXXXXXXXXX format)', u'type': u'object', u'required': [u'list'], u'additionalProperties': False, u'anyOf': [{u'required': [u'user_id']}, {u'properties': {u'list': {u'pattern': u'^ls\\d{7,10}$'}}}], u'properties': {u'list': {u'oneOf': [{u'enum': [u'watchlist', u'ratings', u'checkins']}, {u'pattern': u'^ls\\d{7,10}$'}], u'type': u'string', u'error_oneOf': u'list must be either watchlist, ratings, checkins, or a custom list name (lsXXXXXXXXX)'}, u'user_id': {u'pattern': u'^ur\\d{7,8}$', u'error_pattern': u'user_id must be in the form urXXXXXXX', u'type': u'string'}}}
flexget.plugins.input.imdb_list.register_plugin()

inject Module

input_csv Module

class flexget.plugins.input.input_csv.InputCSV

Bases: object

Adds support for CSV format. Configuration may seem a bit complex, but this has advantage of being universal solution regardless of CSV and internal entry fields.

Configuration format:

csv:

url: <url> values:

<field>: <number>

Example DB-fansubs:

csv:

url: http://www.dattebayo.com/t/dump values:

title: 3 # title is in 3th field url: 1 # download url is in 1st field

Fields title and url are mandatory. First field is 1. List of other common (optional) fields can be found from wiki.

on_task_input(*args, **kwargs)
schema = {u'additionalProperties': False, u'required': [u'url', u'values'], u'type': u'object', u'properties': {u'url': {u'type': u'string', u'format': u'url'}, u'values': {u'additionalProperties': {u'type': u'integer'}, u'required': [u'title', u'url'], u'type': u'object'}}}
flexget.plugins.input.input_csv.register_plugin()

inputs Module

class flexget.plugins.input.inputs.PluginInputs

Bases: object

Allows the same input plugin to be configured multiple times in a task.

Example:

inputs:
  - rss: http://feeda.com
  - rss: http://feedb.com
on_task_input(task, config)
schema = {u'items': {u'allOf': [{u'$ref': u'/schema/plugins?phase=input'}, {u'maxProperties': 1, u'error_maxProperties': u'Plugin options within inputs plugin must be indented 2 more spaces than the first letter of the plugin name.', u'minProperties': 1}]}, u'type': u'array'}
flexget.plugins.input.inputs.register_plugin()

listdir Module

Plugin for filesystem tasks.

class flexget.plugins.input.listdir.Listdir

Bases: object

Uses local path content as an input.

Example:

listdir: /storage/movies/
on_task_input(task, 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.input.listdir.register_plugin()

mock Module

Plugin for mocking task data.

class flexget.plugins.input.mock.Mock

Bases: object

Allows adding mock input entries.

Example:

mock:
  - {title: foobar, url: http://some.com }
  - {title: mock, url: http://another.com }

If url is not given a random url pointing to localhost will be generated.

on_task_input(task, config)
schema = {u'items': {u'required': [u'title'], u'type': u'object', u'properties': {u'url': {u'type': u'string'}, u'title': {u'type': u'string'}}}, u'type': u'array'}
flexget.plugins.input.mock.register_plugin()

rlslog Module

class flexget.plugins.input.rlslog.RlsLog

Bases: object

Adds support for rlslog.net as a feed.

on_task_input(*args, **kwargs)
parse_rlslog(rlslog_url, task)
Parameters:
  • rlslog_url – Url to parse from
  • task – Task instance
Returns:

List of release dictionaries

schema = {u'type': u'string', u'format': u'url'}
flexget.plugins.input.rlslog.register_plugin()

rss Module

class flexget.plugins.input.rss.InputRSS

Bases: object

Parses RSS feed.

Hazzlefree configuration for public rss feeds:

rss: <url>

Configuration with basic http authentication:

rss:
  url: <url>
  username: <name>
  password: <password>

Advanced usages:

You may wish to clean up the entry by stripping out all non-ascii characters. This can be done by setting ascii value to yes.

Example:

rss:
  url: <url>
  ascii: yes

In case RSS-feed uses some nonstandard field for urls and automatic detection fails you can configure plugin to use url from any feedparser entry attribute.

Example:

rss:
  url: <url>
  link: guid

If you want to keep information in another rss field attached to the flexget entry, you can use the other_fields option.

Example:

rss:
  url: <url>
  other_fields: [date]

You can disable few possibly annoying warnings by setting silent value to yes on feeds where there are frequently invalid items.

Example:

rss:
  url: <url>
  silent: yes

You can group all the links of an item, to make the download plugin tolerant to broken urls: it will try to download each url until one works. Links are enclosures plus item fields given by the link value, in that order. The value to set is “group_links”.

Example:

rss:
  url: <url>
  group_links: yes
add_enclosure_info(entry, enclosure, filename=True, multiple=False)

Stores information from an rss enclosure into an Entry.

build_config(config)

Set default values to config

on_task_input(*args, **kwargs)
process_invalid_content(task, data, url)

If feedparser reports error, save the received data and log error.

schema = {u'additionalProperties': False, u'anyOf': [{u'format': u'url'}, {u'format': u'file'}], u'required': [u'url'], u'type': [u'string', u'object'], u'properties': {u'username': {u'type': u'string'}, u'link': {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'other_fields': {u'items': {u'additionalProperties': {u'type': u'string'}, u'type': [u'string', u'object']}, u'type': u'array'}, u'password': {u'type': u'string'}, u'group_links': {u'default': False, u'type': u'boolean'}, u'silent': {u'default': False, u'type': u'boolean'}, u'title': {u'type': u'string'}, u'url': {u'anyOf': [{u'format': u'url'}, {u'format': u'file'}], u'type': u'string'}, u'ascii': {u'default': False, u'type': u'boolean'}, u'filename': {u'type': u'boolean'}, u'all_entries': {u'default': True, u'type': u'boolean'}}}
flexget.plugins.input.rss.fp_field_name(name)

Translates literal field name to the sanitized one feedparser will use.

flexget.plugins.input.rss.register_plugin()

scenereleases Module

tail Module

class flexget.plugins.input.tail.InputTail

Bases: object

Parse any text for entries using regular expression.

file: <file>
entry:
  <field>: <regexp to match value>
format:
  <field>: <python string formatting>

Note: each entry must have at least two fields, title and url

You may wish to specify encoding used by file so file can be properly decoded. List of encodings at http://docs.python.org/library/codecs.html#standard-encodings.

Example:

tail:
  file: ~/irclogs/some/log
  entry:
    title: 'TITLE: (.*) URL:'
    url: 'URL: (.*)'
  encoding: utf8
format_entry(entry, d)
on_task_input(task, config)
schema = {u'additionalProperties': False, u'required': [u'file', u'entry'], u'type': u'object', u'properties': {u'entry': {u'required': [u'url', u'title'], u'type': u'object', u'properties': {u'url': {u'type': u'string', u'format': u'regex'}, u'title': {u'type': u'string', u'format': u'regex'}}}, u'format': {u'additionalProperties': {u'type': u'string'}, u'type': u'object'}, u'file': {u'type': u'string', u'format': u'file'}, u'encoding': {u'type': u'string'}}}
class flexget.plugins.input.tail.TailPosition(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Base

filename
id
position
task
flexget.plugins.input.tail.register_parser_arguments()
flexget.plugins.input.tail.register_plugin()

text Module

Plugin for text file or URL feeds via regex.

class flexget.plugins.input.text.Text

Bases: object

Parse any text for entries using regular expression.

Example:

url: <url>
entry:
  <field>: <regexp to match value>
format:
  <field>: <python string formatting>

Note: each entry must have atleast two fields, title and url

Example:

text:
  url: http://www.nbc.com/Heroes/js/novels.js
  entry:
    title: novelTitle = "(.*)"
    url: novelPrint = "(.*)"
  format:
    url: http://www.nbc.com%(url)s
format_entry(entry, d)
on_task_input(*args, **kwargs)
schema = {u'required': [u'entry', u'url'], u'type': u'object', u'properties': {u'url': {u'oneOf': [{u'type': u'string', u'format': u'url'}, {u'type': u'string', u'format': u'file'}]}, u'entry': {u'additionalProperties': {u'type': u'string', u'format': u'regex'}, u'required': [u'url', u'title'], u'type': u'object', u'properties': {u'url': {u'type': u'string', u'format': u'regex'}, u'title': {u'type': u'string', u'format': u'regex'}}}, u'format': {u'additionalProperties': {u'type': u'string'}, u'type': u'object'}}, u'additonalProperties': False}
flexget.plugins.input.text.register_plugin()

thetvdb_favorites Module

trakt_list Module

class flexget.plugins.input.trakt_list.TraktList

Bases: object

Creates an entry for each item in your trakt list.

Syntax:

trakt_list:
username: <value> password: <value> type: <shows|movies|episodes> list: <collection|watchlist|watched|custom list name> strip_dates: <yes|no>

Options username, type and list are required. password is required for private lists.

on_task_input(*args, **kwargs)
schema = {u'required': [u'username', u'type', u'list'], u'error_not': u'`collection` and `watched` lists do not support `episodes` type', u'not': {u'properties': {u'list': {u'enum': [u'collection', u'watched']}, u'type': {u'enum': [u'episodes']}}}, u'additionalProperties': False, u'type': u'object', u'properties': {u'username': {u'type': u'string'}, u'list': {u'type': u'string'}, u'password': {u'type': u'string'}, u'type': {u'enum': [u'shows', u'movies', u'episodes'], u'type': u'string'}, u'strip_dates': {u'default': False, u'type': u'boolean'}}}
flexget.plugins.input.trakt_list.register_plugin()

tvtorrents Module