input Package¶
input
Package¶
Plugins for “input” task phase.
apple_trailers
Module¶
- class flexget.plugins.input.apple_trailers.AppleTrailers¶
Bases:
object
Adds support for Apple.com movie trailers.
Configuration: quality: Set the desired resolution - 480p, 720p or 1080p. 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
- broken(error_message)¶
- movie_data_url = 'http://trailers.apple.com/trailers/feeds/data/'¶
- on_task_input(**kwargs)¶
- qualities = {'1080p': 'hd1080', '480p': 'sd', '720p': 'hd720'}¶
- rss_url = 'http://trailers.apple.com/trailers/home/rss/newtrailers.rss'¶
- schema = {'oneOf': [{'additionalProperties': False, 'properties': {'genres': {'items': {'type': 'string'}, 'type': 'array'}, 'quality': {'default': '720p', 'enum': ['480p', '720p', '1080p'], 'type': 'string'}}, 'type': 'object'}, {'enum': ['480p', '720p', '1080p'], 'title': 'justquality', 'type': 'string'}]}¶
- flexget.plugins.input.apple_trailers.register_plugin()¶
backlog
Module¶
discover
Module¶
- class flexget.plugins.input.discover.Discover¶
Bases:
object
Discover content based on other inputs material.
Example:
discover: what: - next_series_episodes: yes from: - piratebay interval: [1 hours|days|weeks] release_estimations: [strict|loose|ignore]
- entry_complete(entry, query=None, search_results=None, **kwargs)¶
Callback for Entry
- estimated(entries, estimation_mode)¶
- Parameters:
estimation_mode (dict) – mode -> loose, strict, ignore
- Returns:
Entries that we have estimated to be available
- 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']
- on_task_input(task, config)¶
- schema = {'additionalProperties': False, 'properties': {'from': {'items': {'allOf': [{'$ref': '/schema/plugins?interface=search'}, {'maxProperties': 1, 'minProperties': 1}]}, 'type': 'array'}, 'interval': {'default': '5 hours', 'format': 'interval', 'type': 'string'}, 'limit': {'minimum': 1, 'type': 'integer'}, 'release_estimations': {'oneOf': [{'default': 'strict', 'enum': ['loose', 'strict', 'ignore', 'smart'], 'type': 'string'}, {'properties': {'optimistic': {'format': 'interval', 'type': 'string'}}, 'required': ['optimistic'], 'type': 'object'}]}, 'what': {'items': {'allOf': [{'$ref': '/schema/plugins?phase=input'}, {'maxProperties': 1, 'minProperties': 1}]}, 'type': 'array'}}, 'required': ['what', 'from'], 'type': 'object'}¶
- class flexget.plugins.input.discover.DiscoverEntry(title, task)¶
Bases:
VersionedBase
- 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¶
next_series_episodes
Module¶
find
Module¶
gen_series
Module¶
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 = {'type': '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(**kwargs)¶
- schema = {'oneOf': [{'type': 'string'}, {'additionalProperties': False, 'properties': {'allow_empty_links': {'type': 'boolean'}, 'dump': {'type': 'string'}, 'increment': {'oneOf': [{'type': 'boolean'}, {'additionalProperties': False, 'properties': {'entries_count': {'type': 'integer'}, 'from': {'type': 'integer'}, 'name': {'type': 'string'}, 'step': {'type': 'integer'}, 'stop_when_404': {'type': 'boolean'}, 'stop_when_empty': {'type': 'boolean'}, 'to': {'type': 'integer'}}, 'type': 'object'}]}, 'links_re': {'items': {'format': 'regex', 'type': 'string'}, 'type': 'array'}, 'password': {'type': 'string'}, 'title_from': {'type': 'string'}, 'url': {'format': 'url', 'type': 'string'}, 'username': {'type': 'string'}}, 'required': ['url'], 'type': 'object'}]}¶
- flexget.plugins.input.html.register_plugin()¶
imdb_list
Module¶
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(**kwargs)¶
- schema = {'additionalProperties': False, 'properties': {'url': {'format': 'url', 'type': 'string'}, 'values': {'additionalProperties': {'type': 'integer'}, 'required': ['title', 'url'], 'type': 'object'}}, 'required': ['url', 'values'], 'type': '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 = {'items': {'allOf': [{'$ref': '/schema/plugins?phase=input'}, {'error_maxProperties': 'Plugin options within inputs plugin must be indented 2 more spaces than the first letter of the plugin name.', 'maxProperties': 1, 'minProperties': 1}]}, 'type': 'array'}¶
- flexget.plugins.input.inputs.register_plugin()¶
listdir
Module¶
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 } - Title Only
If url is not given a random url pointing to localhost will be generated.
- on_task_input(task, config)¶
- schema = {'items': {'oneOf': [{'type': 'string'}, {'properties': {'title': {'type': 'string'}, 'url': {'type': 'string'}}, 'required': ['title'], 'type': 'object'}]}, 'type': '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(**kwargs)¶
- parse_rlslog(rlslog_url, task)¶
- Parameters:
rlslog_url – Url to parse from
task – Task instance
- Returns:
List of release dictionaries
- schema = {'format': 'url', 'type': 'string'}¶
- 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
- escape_content(content)¶
- on_task_input(**kwargs)¶
- process_invalid_content(task, data, url)¶
If feedparser reports error, save the received data and log error.
- schema = {'additionalProperties': False, 'anyOf': [{'format': 'url'}, {'format': 'file'}], 'properties': {'all_entries': {'default': True, 'type': 'boolean'}, 'ascii': {'default': False, 'type': 'boolean'}, 'escape': {'default': False, 'type': 'boolean'}, 'filename': {'type': 'boolean'}, 'group_links': {'default': False, 'type': 'boolean'}, 'link': {'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}, 'other_fields': {'items': {'additionalProperties': {'type': 'string'}, 'type': ['string', 'object']}, 'type': 'array'}, 'password': {'type': 'string'}, 'silent': {'default': False, 'type': 'boolean'}, 'title': {'type': 'string'}, 'url': {'anyOf': [{'format': 'url'}, {'format': 'file'}], 'type': 'string'}, 'username': {'type': 'string'}}, 'required': ['url'], 'type': ['string', 'object']}¶
- 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 = {'additionalProperties': False, 'properties': {'encoding': {'type': 'string'}, 'entry': {'properties': {'title': {'format': 'regex', 'type': 'string'}, 'url': {'format': 'regex', 'type': 'string'}}, 'required': ['url', 'title'], 'type': 'object'}, 'file': {'format': 'file', 'type': 'string'}, 'format': {'additionalProperties': {'type': 'string'}, 'type': 'object'}}, 'required': ['file', 'entry'], 'type': 'object'}¶
- class flexget.plugins.input.tail.TailPosition(**kwargs)¶
Bases:
VersionedBase
- 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(**kwargs)¶
- schema = {'additonalProperties': False, 'properties': {'encoding': {'type': 'string'}, 'entry': {'additionalProperties': {'format': 'regex', 'type': 'string'}, 'properties': {'title': {'format': 'regex', 'type': 'string'}, 'url': {'format': 'regex', 'type': 'string'}}, 'required': ['url', 'title'], 'type': 'object'}, 'format': {'additionalProperties': {'type': 'string'}, 'type': 'object'}, 'url': {'oneOf': [{'format': 'url', 'type': 'string'}, {'format': 'file', 'type': 'string'}]}}, 'required': ['entry', 'url'], 'type': 'object'}¶
- flexget.plugins.input.text.register_plugin()¶