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_task_modify
(task, config)¶
-
schema
= {u'type': [u'string', u'number']}¶
-
-
flexget.plugins.modify.extension.
register_plugin
()¶
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_task_abort
(task, config)¶ Task exiting, remove additions
-
on_task_exit
(task, config)¶ Task exiting, remove additions
-
on_task_start
(task, config)¶ Task starting
-
schema
= {u'additionalProperties': {u'type': u'string'}, u'type': u'object'}¶
-
flexget.plugins.modify.headers.
register_plugin
()¶
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>
[remove]: <boolean>
Example:
- manipulate:
- title:
extract: [dddd](.*)
-
on_task_filter
(task, config)¶
-
on_task_metainfo
(task, config)¶
-
on_task_start
(task, 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
()¶
-
flexget.plugins.modify.manipulate.
register_plugin
()¶
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
(task, config, callback)¶
-
on_task_modify
(task, config)¶
-
schema
= {u'type': u'object'}¶
-
set_path
(entry, path)¶
-
flexget.plugins.modify.path_by_ext.
register_plugin
()¶
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_task_abort
(task, config)¶
-
on_task_exit
(task, config)¶
-
on_task_start
(task, config)¶
-
schema
= {u'additionalProperties': {u'type': u'integer'}, u'type': u'object'}¶
-
flexget.plugins.modify.plugin_priority.
register_plugin
()¶
set_field
Module¶
-
class
flexget.plugins.modify.set_field.
ModifySet
¶ Bases:
object
Allows adding information to a task entry for use later.
Example:
- set:
- path: ~/download/path/
-
lazy_set
(config, field, orig_field_value, entry, errors=True)¶
-
modify
(entry, config, errors=True)¶ This can be called from a plugin to add set values to an entry
-
on_task_metainfo
(task, config)¶ Adds the set dict to all accepted entries.
-
schema
= {u'type': u'object', u'minProperties': 1}¶
-
flexget.plugins.modify.set_field.
register_plugin
()¶
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_task_modify
(task, config)¶
-
on_task_output
(task, config)¶
-
purge
(entry)¶
-
-
flexget.plugins.modify.torrent.
register_plugin
()¶
torrent_scrub
Module¶
Torrent Scrubber Plugin.
-
class
flexget.plugins.modify.torrent_scrub.
TorrentScrub
¶ Bases:
object
Scrubs torrents from unwanted keys.
- Example:
- tasks:
- rutorrent-fast-resume-infected-task:
- torrent_scrub: resume
-
RT_KEYS
= (u'libtorrent_resume', u'log_callback', u'err_callback', u'rtorrent')¶
-
SCRUB_MODES
= (u'off', u'on', u'all', u'resume', u'rtorrent')¶
-
SCRUB_PRIO
= 245¶
-
on_task_modify
(task, config)¶ Scrub items that are torrents, if they’re affected.
-
schema
= {u'oneOf': [{u'type': u'boolean'}, {u'enum': [u'off', u'on', u'all', u'resume', u'rtorrent'], u'type': u'string'}, {u'items': {u'type': u'string'}, u'type': u'array'}]}¶
-
flexget.plugins.modify.torrent_scrub.
register_plugin
()¶
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/.
-
on_task_modify
(task, config)¶
-
schema
= {u'items': {u'type': u'string', u'format': u'url'}, u'type': u'array'}¶
-
class
flexget.plugins.modify.trackers.
ModifyTrackers
¶ Bases:
object
Modify tracker URL to torrent files.
Configuration example:
modify_trackers: - SearchAndReplace: from: string_to_search to: string_to_replace
-
on_task_modify
(task, config)¶
-
schema
= {u'items': {u'additionalProperties': {u'additionalProperties': False, u'type': u'object', u'properties': {u'to': {u'type': u'string'}, u'from': {u'type': u'string'}}}, u'maxProperties': 1, u'type': u'object'}, u'type': u'array'}¶
-
-
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.
-
on_task_modify
(task, config)¶
-
schema
= {u'items': {u'type': u'string', u'format': u'regex'}, u'type': u'array'}¶
-
flexget.plugins.modify.trackers.
register_plugin
()¶