output Package

output Package

Plugins for “output” feed 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(feed)

Checks all entries for leftover temp files and deletes them.

download_entry(feed, entry, url)

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(feed, entry, require_path=False, handle_magnets=False, fail_html=True)

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
get_temp_files(feed, require_path=False, handle_magnets=False, fail_html=True)

Download all feed 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
on_feed_abort(feed, config)

Make sure all temp files are cleaned up when feed is aborted.

on_feed_download(feed, config)
on_feed_exit(feed, config)

Make sure all temp files are cleaned up when feed exits

on_feed_output(feed, config)

Move downloaded content from temp folder to final destination

on_process_start(feed, config)

Get pathscrub method.

output(feed, entry, config)

Moves temp-file into final destination

Raises:
PluginError if operation fails
process_config(config)

Return plugin configuration in advanced form

process_entry(feed, entry, url)

Processes entry by using url. Does not use entry[‘url’]. Does not fail the entry if there is a network issue, instead just log and return a string error.

Parameters:
  • feed – Feed
  • entry – Entry
  • url – Url to try download
Returns:

String error, if failed.

save_error_page(entry, feed, page)
validator()

Return config validator

dump Module

class flexget.plugins.output.dump.OutputDump

Bases: object

Outputs all entries to console

on_feed_output(feed)
static optik(option, opt, value, parser)
params = None
validator()
flexget.plugins.output.dump.dump(entries, debug=False, eval_lazy=False)

Dump entries to stdout

Parameters:
  • entries (list) – Entries to be dumped.
  • debug (bool) – Print non printable fields as well.
  • eval_lazy (bool) – Evaluate lazy fields.

dump_config Module

class flexget.plugins.output.dump_config.OutputDumpConfig

Bases: object

Dumps feed config in STDOUT in yaml at exit or abort event.

on_feed_abort(feed)
on_feed_exit(feed)

exec Module

class flexget.plugins.output.exec.EscapingDict(dict=None, **kwargs)

Bases: UserDict.UserDict

Helper class, same as a dict, 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(feed, phase_name, config)
execute_cmd(cmd, allow_background, encoding)
prepare_config(config)
validator()

history Module

class flexget.plugins.output.history.History

Bases: sqlalchemy.ext.declarative.Base

details
feed
filename
id
time
title
url
class flexget.plugins.output.history.PluginHistory

Bases: object

Provides –history

on_feed_exit(feed)

Add accepted entries to history

on_process_start(feed)

html Module

class flexget.plugins.output.html.OutputHtml
on_feed_output(feed, config)
validator()

move Module

class flexget.plugins.output.move.MovePlugin

Bases: object

on_feed_output(feed, config)
on_process_start(feed, config)

Get pathscrub method.

validator()
flexget.plugins.output.move.get_directory_size(directory)
Parameters:directory – Path
Returns:Size in bytes (recursively)

notifymyandroid Module

class flexget.plugins.output.notifymyandroid.OutputNotifyMyAndroid

Bases: object

Example:

notifymyandroid:
  apikey: xxxxxxx
  [application: application name, default FlexGet]
  [event: event title, default New Release]
  [priority: -2 - 2 (2 = highest), default 0]

Configuration parameters are also supported from entries (eg. through set).

on_feed_output(feed, config)
prepare_config(config)
validator()

prowl Module

class flexget.plugins.output.prowl.OutputProwl

Bases: object

Send prowl notifications

Example:

prowl:
  apikey: xxxxxxx
  [application: application name, default FlexGet]
  [event: event title, default New Release]
  [priority: -2 - 2 (2 = highest), default 0]
  [description: notification to send]

Configuration parameters are also supported from entries (eg. through set).

on_feed_output(feed, config)
prepare_config(config)
validator()

pyload Module

class flexget.plugins.output.pyload.PluginPyLoad

Bases: object

Parse feed content or url for hoster links and adds them to pyLoad.

Example:

pyload:
  api: http://localhost:8000/api
  queue: yes
  username: my_username
  password: my_password
  folder: desired_folder
  hoster:
    - YoutubeCom
  parse_url: no
  multiple_hoster: yes
  enabled: yes

Default values for the config elements:

pyload:
    api: http://localhost:8000/api
    queue: no
    hoster: ALL
    parse_url: no
    multiple_hoster: yes
    enabled: yes
DEFAULT_API = 'http://localhost:8000/api'
DEFAULT_FOLDER = ''
DEFAULT_HOSTER = []
DEFAULT_MULTIPLE_HOSTER = True
DEFAULT_PARSE_URL = False
DEFAULT_QUEUE = False
add_entries(feed, config)

Adds accepted entries

check_login(feed, config)
on_feed_output(feed, config)
on_process_start(feed, config)
validator()

Return config validator

flexget.plugins.output.pyload.query_api(url, method, post=None)

queue_movies Module

class flexget.plugins.output.queue_movies.QueueMovies

Bases: object

Adds all accepted entries to your movie queue.

on_feed_output(feed, config)
validator()

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 feeds.

Example:

my-feed-A:
  make_rss: ~/public_html/series.rss
  .
  .
my-feed-B:
  make_rss: ~/public_html/series.rss
  .
  .

With this example file series.rss would contain succeeded entries from both feeds.

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 containg 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 location link:

You can specify the url location of the rss file.

Example:

make_rss:
  file: ~/public_html/series.rss
  rsslink: http://my.server.net/series.rss

RSS link

You can specify what field from entry is used as a link in generated rss feed.

Example:

make_rss:
  file: ~/public_html/series.rss
  link:
    - imdb_url

List should contain a list of fields in order of preference. Note that the url field is always used as last possible fallback even without explicitly adding it into the list.

Default list: imdb_url, input_url, url

get_config(feed)
on_feed_exit(feed)

Store finished / downloaded entries at exit

on_feed_output(feed)
on_process_end(feed)

Write RSS file at application terminate.

validator()

Validate given configuration

class flexget.plugins.output.rss.RSSEntry(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

description
file
id
published
title

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_feed_output(feed, config)
validator()

send_email Module

class flexget.plugins.output.send_email.OutputEmail

Bases: object

Send an e-mail with the list of all succeeded (downloaded) entries.

Configuration options

Option Description
from The email address from which the email will be sent (required)
to The email address of the recipient (required)
smtp_host The host of the smtp server
smtp_port The port of the smtp server
smtp_username The username to use to connect to the smtp server
smtp_password The password to use to connect to the smtp server
smtp_tls Should we use TLS to connect to the smtp server
smtp_ssl Should we use SSL to connect to the smtp server Due to a bug in python, this only works in python 2.6.3 and up
active Is this plugin active or not

Config basic example:

email:
  from: xxx@xxx.xxx
  to: xxx@xxx.xxx
  smtp_host: smtp.host.com

Config example with smtp login:

email:
  from: xxx@xxx.xxx
  to: xxx@xxx.xxx
  smtp_host: smtp.host.com
  smtp_port: 25
  smtp_login: true
  smtp_username: my_smtp_login
  smtp_password: my_smtp_password
  smtp_tls: true

Config multi-feed example:

global:
  email:
    from: xxx@xxx.xxx
    to: xxx@xxx.xxx
    smtp_host: smtp.host.com

feeds:
  feed1:
    rss: http://xxx
  feed2:
    rss: http://yyy
    email:
      active: False
  feed3:
    rss: http://zzz
    email:
      to: zzz@zzz.zzz

GMAIL example:

from: from@gmail.com
to: to@gmail.com
smtp_host: smtp.gmail.com
smtp_port: 587
smtp_login: true
smtp_username: gmailUser
smtp_password: gmailPassword
smtp_tls: true

Default values for the config elements:

email:
  active: True
  smtp_host: localhost
  smtp_port: 25
  smtp_login: False
  smtp_username:
  smtp_password:
  smtp_tls: False
  smtp_ssl: False
on_feed_exit(feed, config)

Send email at exit.

on_feed_output(feed, config)

Count the email as an output

prepare_config(config)
validator()

subtitles Module

class flexget.plugins.output.subtitles.Subtitles

Bases: object

Fetch subtitles from opensubtitles.org

get_config(feed)
on_feed_download(feed)
validator()