modify Package

modify Package

Modification phase plugins.

extension Module

class flexget.plugins.modify.extension.ModifyExtension

Bases: object

Allows specifying file extension explicitly when all other built-in detection mechanisms fail.

Example:

extension: nzb

on_feed_modify(feed)
validator()

headers Module

class flexget.plugins.modify.headers.HTTPHeadersProcessor(headers=None)

Bases: urllib2.BaseHandler

handler_order = 490
http_request(request)
http_response(request, response)
https_request(request)
https_response(request, response)
class flexget.plugins.modify.headers.PluginHeaders

Bases: object

Allow setting up any headers in all requests (which use urllib2)

Example:

headers:
cookie: uid=<YOUR UID>; pass=<YOUR PASS>
on_feed_abort(feed, config)

Feed exiting, remove additions

on_feed_exit(feed, config)

Feed exiting, remove additions

on_feed_start(feed, config)

Feed starting

validator()

manipulate Module

class flexget.plugins.modify.manipulate.Manipulate

Bases: object

Usage:

manipulate:
  • <destination field>:

    [phase]: <phase> [from]: <source field> [extract]: <regexp> [separator]: <text> [replace]:

    regexp: <regexp> format: <regexp>

Example:

manipulate:
  • title:

    extract: [dddd](.*)

on_feed_filter(feed, config)
on_feed_metainfo(feed, config)
on_feed_start(feed, config)

Separates the config into a dict with a list of jobs per phase. Allows us to skip phases without any jobs in them.

process(entry, jobs)

Process given jobs from config for an entry.

Parameters:
  • entry – Entry to modify
  • jobs – Config items to run on this entry
Returns:

True if any fields were modified

validator()

path_by_ext Module

class flexget.plugins.modify.path_by_ext.PluginPathByExt

Bases: object

Allows specifying path based on content-type

Example:

path_by_ext:
torrent: ~/watch/torrent/ nzb: ~/watch/nzb/
ext(feed, callback)
on_feed_modify(feed)
set_path(entry, path)
validator()

plugin_priority Module

class flexget.plugins.modify.plugin_priority.PluginPriority

Bases: object

Allows modifying plugin priorities from default values.

Example:

plugin_priority:
ignore: 50 series: 100
on_feed_abort(feed)
on_feed_exit(feed)
on_feed_start(feed)
validator()

set_field Module

class flexget.plugins.modify.set_field.ModifySet

Bases: object

Allows adding information to a feed entry for use later.

Example:

set:
path: ~/download/path/
modify(entry, config, errors=True)

This can be called from a plugin to add set values to an entry

on_feed_filter(feed, config)

Adds the set dict to all accepted entries.

on_feed_start(feed, config)

Checks that jinja2 is available

validator()

torrent Module

class flexget.plugins.modify.torrent.TorrentFilename

Bases: object

Makes sure that entries containing torrent-file have .torrent extension. This is enabled always by default (builtins).

TORRENT_PRIO = 255
make_filename(torrent, entry)

Build a filename for this torrent

on_feed_modify(feed)
on_feed_output(feed)
purge(entry)

torrent_scrub Module

Torrent Scrubber Plugin.

class flexget.plugins.modify.torrent_scrub.TorrentScrub(plugin_info, *args, **kw)

Bases: flexget.plugin.Plugin

Scrubs torrents from unwanted keys.

Example:
feeds:
rutorrent-fast-resume-infected-feed:
torrent_scrub: resume
RT_KEYS = ('libtorrent_resume', 'log_callback', 'err_callback', 'rtorrent')
SCRUB_MODES = ('off', 'on', 'all', 'resume', 'rtorrent')
SCRUB_PRIO = 245
on_feed_modify(feed, config)

Scrub items that are torrents, if they’re affected.

validator()

Our configuration model.

trackers Module

class flexget.plugins.modify.trackers.AddTrackers

Bases: object

Adds tracker URL to torrent files.

Configuration example:

add_trackers:
  • uri://tracker_address:port/

This will add all tracker URL uri://tracker_address:port/. TIP: You can use global section in configuration to make this enabled on all feeds.

on_feed_modify(feed, config)
validator()
class flexget.plugins.modify.trackers.RemoveTrackers

Bases: object

Removes trackers from torrent files using regexp matching.

Configuration example:

remove_trackers:
  • moviex

This will remove all trackers that contain text moviex in their url. TIP: You can use global section in configuration to make this enabled on all feeds.

on_feed_modify(feed, config)
validator()