output Package¶
output
Package¶
Plugins for “output” task phase.
download
Module¶
- class flexget.plugins.output.download.PluginDownload¶
Bases:
object
Downloads content from entry url and writes it into a file.
Example:
download: ~/torrents/
Allow HTML content:
By default download plugin reports failure if received content is a html. Usually this is some sort of custom error page without proper http code and thus entry is assumed to be downloaded incorrectly.
In the rare case you actually need to retrieve html-pages you must disable this feature.
Example:
download: path: ~/something/ fail_html: no
You may use commandline parameter –dl-path to temporarily override all paths to another location.
- cleanup_temp_file(entry)¶
- cleanup_temp_files(task)¶
Checks all entries for leftover temp files and deletes them.
- download_entry(task, entry, url, tmp_path)¶
Downloads entry by using url.
- Raises:
Several types of exceptions …
- Raises:
PluginWarning
- filename_ext_from_mime(entry)¶
Tries to set filename extension from mime-type
- filename_from_headers(entry, response)¶
Checks entry filename if it’s found from content-disposition
- get_temp_file(task, entry, require_path=False, handle_magnets=False, fail_html=True, tmp_path='/tmp')¶
Download entry content and store in temporary folder. Fails entry with a reason if there was problem.
- Parameters:
require_path (bool) – whether or not entries without ‘path’ field are ignored
handle_magnets (bool) – when used any of urls containing magnet link will replace url, otherwise warning is printed.
fail_html – fail entries which url respond with html content
tmp_path – path to use for temporary files while downloading
- get_temp_files(task, require_path=False, handle_magnets=False, fail_html=True, tmp_path='/tmp')¶
Download all task content and store in temporary folder.
- Parameters:
require_path (bool) – whether or not entries without ‘path’ field are ignored
handle_magnets (bool) – when used any of urls containing magnet link will replace url, otherwise warning is printed.
fail_html – fail entries which url respond with html content
tmp_path – path to use for temporary files while downloading
- on_task_abort(task, config)¶
Make sure all temp files are cleaned up when task is aborted.
- on_task_download(task, config)¶
- on_task_learn(task, config)¶
Make sure all temp files are cleaned up after output phase
- on_task_output(task, config)¶
Move downloaded content from temp folder to final destination
- output(task, entry, config)¶
Moves temp-file into final destination
- Raises:
PluginError if operation fails
- process_config(config)¶
Return plugin configuration in advanced form
- process_entry(task, entry, url, tmp_path)¶
Processes entry by using url. Does not use entry[‘url’]. Does not fail the entry if there is a network issue, instead just logs and returns a string error.
- Parameters:
task – Task
entry – Entry
url – Url to try download
tmp_path – Path to store temporary files
- Returns:
String error, if failed.
- save_error_page(entry, task, page)¶
- schema = {'oneOf': [{'additionalProperties': False, 'properties': {'fail_html': {'default': True, 'type': 'boolean'}, 'filename': {'type': 'string'}, 'overwrite': {'default': False, 'type': 'boolean'}, 'path': {'format': 'path', 'type': 'string'}, 'temp': {'format': 'path', 'type': 'string'}}, 'title': 'specify options', 'type': 'object'}, {'format': 'path', 'title': 'specify path', 'type': 'string'}, {'enum': [True], 'title': 'no options', 'type': 'boolean'}]}¶
- flexget.plugins.output.download.register_parser_arguments()¶
- flexget.plugins.output.download.register_plugin()¶
dump
Module¶
- class flexget.plugins.output.dump.OutputDump¶
Bases:
object
Outputs all entries to console
- on_task_output(task, config)¶
- schema = {'type': 'boolean'}¶
- flexget.plugins.output.dump.dump(entries, debug=False, eval_lazy=False, trace=False, title_only=False)¶
Dump entries to stdout
- flexget.plugins.output.dump.register_parser_arguments()¶
- flexget.plugins.output.dump.register_plugin()¶
dump_config
Module¶
- class flexget.plugins.output.dump_config.OutputDumpConfig¶
Bases:
object
Dumps task config in STDOUT in yaml at exit or abort event.
- on_task_start(task, config)¶
- flexget.plugins.output.dump_config.register_parser_arguments()¶
- flexget.plugins.output.dump_config.register_plugin()¶
exec
Module¶
- class flexget.plugins.output.exec.EscapingEntry(entry)¶
Bases:
Entry
Helper class, same as a Entry, but returns all string value with quotes escaped.
- class flexget.plugins.output.exec.PluginExec¶
Bases:
object
Execute commands
Simple example, xecute command for entries that reach output:
exec: echo 'found {{title}} at {{url}}' > file
Advanced Example:
exec: on_start: phase: echo "Started" on_input: for_entries: echo 'got {{title}}' on_output: for_accepted: echo 'accepted {{title}} - {{url}} > file
You can use all (available) entry fields in the command.
- HANDLED_PHASES = ['start', 'input', 'filter', 'output', 'exit']¶
- NAME = 'exec'¶
- execute(task, phase_name, config)¶
- execute_cmd(cmd, allow_background, encoding)¶
- prepare_config(config)¶
- schema = {'definitions': {'phaseSettings': {'additionalProperties': False, 'properties': {'for_accepted': {'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}, 'for_entries': {'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}, 'for_failed': {'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}, 'for_rejected': {'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}, 'for_undecided': {'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}, 'phase': {'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}}, 'type': 'object'}}, 'oneOf': [{'oneOf': [{'items': {'title': 'single value', 'type': 'string'}, 'minItems': 1, 'title': 'multiple values', 'type': 'array', 'uniqueItems': False}, {'title': 'single value', 'type': 'string'}]}, {'additionalProperties': False, 'properties': {'allow_background': {'type': 'boolean'}, 'auto_escape': {'type': 'boolean'}, 'encoding': {'type': 'string'}, 'fail_entries': {'type': 'boolean'}, 'on_exit': {'$ref': '#/definitions/phaseSettings'}, 'on_filter': {'$ref': '#/definitions/phaseSettings'}, 'on_input': {'$ref': '#/definitions/phaseSettings'}, 'on_output': {'$ref': '#/definitions/phaseSettings'}, 'on_start': {'$ref': '#/definitions/phaseSettings'}}, 'type': 'object'}]}¶
- flexget.plugins.output.exec.register_plugin()¶
history
Module¶
html
Module¶
- class flexget.plugins.output.html.OutputHtml¶
Bases:
object
- on_task_output(task, config)¶
- schema = {'additionalProperties': False, 'properties': {'file': {'type': 'string'}, 'template': {'type': 'string'}}, 'required': ['file'], 'type': 'object'}¶
- flexget.plugins.output.html.register_plugin()¶
move
Module¶
notifymyandroid
Module¶
prowl
Module¶
pyload
Module¶
qbittorrent
Module¶
queue_movies
Module¶
rss
Module¶
- class flexget.plugins.output.rss.OutputRSS¶
Bases:
object
Write RSS containing succeeded (downloaded) entries.
Example:
make_rss: ~/public_html/flexget.rss
You may write into same file in multiple tasks.
Example:
my-task-A: make_rss: ~/public_html/series.rss . . my-task-B: make_rss: ~/public_html/series.rss . .
With this example file series.rss would contain succeeded entries from both tasks.
Number of days / items
By default output contains items from last 7 days. You can specify different perioid, number of items or both. Value -1 means unlimited.
Example:
make_rss: file: ~/public_html/series.rss days: 2 items: 10
Generate RSS that will containing last two days and no more than 10 items.
Example 2:
make_rss: file: ~/public_html/series.rss days: -1 items: 50
Generate RSS that will contain last 50 items, regardless of dates.
RSS feed properties:
You can specify the URL, title, and description to include in tthe header of the RSS feed.
Example:
make_rss: file: ~/public_html/series.rss rsslink: http://my.server.net/series.rss rsstitle: The Flexget RSS Feed rssdesc: Episodes about Flexget.
RSS item title and link
You can specify the title and link for each item in the RSS feed.
The item title can be any pattern that references fields in the input entry.
The item link can be created from one of a list of fields in the input entry, in order of preference. The fields should be enumerated in a list. Note that the url field is always used as last possible fallback even without explicitly adding it into the list.
Default field list for item URL: imdb_url, input_url, url
Example:
make_rss: file: ~/public_html/series.rss title: '{{title}} (from {{task}})' link: - imdb_url
- on_task_exit(task, config)¶
Store finished / downloaded entries at exit
- on_task_output(task, config)¶
- prepare_config(config)¶
- schema = {'oneOf': [{'type': 'string'}, {'additionalProperties': False, 'properties': {'days': {'type': 'integer'}, 'encoding': {'type': 'string'}, 'file': {'type': 'string'}, 'history': {'type': 'boolean'}, 'items': {'type': 'integer'}, 'link': {'items': {'type': 'string'}, 'type': 'array'}, 'rssdesc': {'type': 'string'}, 'rsslink': {'type': 'string'}, 'rsstitle': {'type': 'string'}, 'template': {'type': 'string'}, 'timestamp': {'type': 'boolean'}, 'title': {'type': 'string'}}, 'required': ['file'], 'type': 'object'}]}¶
- class flexget.plugins.output.rss.RSSEntry(**kwargs)¶
Bases:
VersionedBase
- description¶
- enc_length¶
- enc_type¶
- file¶
- id¶
- link¶
- published¶
- rsslink¶
- title¶
- flexget.plugins.output.rss.register_plugin()¶
sabnzbd
Module¶
- class flexget.plugins.output.sabnzbd.OutputSabnzbd¶
Bases:
object
Example:
sabnzbd: apikey: 123456 url: http://localhost/sabnzbd/api? category: movies
All parameters:
sabnzbd: apikey: ... url: ... category: ... script: ... pp: ... priority: ...
- get_params(config)¶
- on_task_output(task, config)¶
- schema = {'additionalProperties': False, 'properties': {'category': {'type': 'string'}, 'key': {'type': 'string'}, 'password': {'type': 'string'}, 'pp': {'type': 'string'}, 'priority': {'type': 'integer'}, 'script': {'type': 'string'}, 'url': {'format': 'url', 'type': 'string'}, 'username': {'type': 'string'}}, 'required': ['key', 'url'], 'type': 'object'}¶
- flexget.plugins.output.sabnzbd.register_plugin()¶
send_email
Module¶
subtitles
Module¶
- class flexget.plugins.output.subtitles.Subtitles¶
Bases:
object
Fetch subtitles from opensubtitles.org
- on_task_download(task, config)¶
- prepare_config(config, task)¶
- schema = {'additionalProperties': False, 'properties': {'languages': {'default': ['eng'], 'items': {'type': 'string'}, 'type': 'array'}, 'match_limit': {'default': 0.8, 'type': 'number'}, 'min_sub_rating': {'default': 0.0, 'type': 'number'}, 'output': {'format': 'path', 'type': 'string'}}, 'type': 'object'}¶
- flexget.plugins.output.subtitles.register_plugin()¶