Skip to content

Plugins

parg edited this page Feb 14, 2024 · 36 revisions

BiglyBT supports various plugins to extend its features. Some are actually built into BiglyBT and don't need installing. Others have separate repositories and documentation, see https://github.com/BiglySoftware/

For example, the 'Command Runner' plugin can be found at https://github.com/BiglySoftware/BiglyBT-plugin-azexec

External plugins can be installed by going to the Tools menu and selecting Plugins->Get Plugins

Built In Plugins

Simple API

This was added in 2801_B20 to initially support a the adding of a tag or category to a download but can easily be extended. The intent is that it would be called from a local script - the external plugin "BiglyBT Web Remote" has a very extensive API for interacting with BiglyBT but is more complicated to use, hence the addition of this plugin.

An 'apikey' is required for all operations as a security measure, this can be found in the plugin configuration under Plugins->Simple API. You can set this to whatever you want or use the suggested value.

Operations are performed via a simple URL and currently the response is via HTTP code - 200 indicates success.

Typically the plugin will accept connections to local host on the (default) port of 6906:

http://127.0.0.1:6906/?apikey=<key>&...

Add Tag

To add a tag to a download the remainder of the URL is

method=addtag&hash=<download hash>&tag=<tag name>

Remove Tag

To remove a tag from a download:

method=removetag&hash=<download hash>&tag=<tag name>

Set Category

To set a download's category: (Use "" for uncategorized):

method=setcategory&hash=<download hash>&category=<category name>

Set Networks

To set a download's networks (valid networks are "Public", "I2P" and "Tor"):

method=setnetworks&hash=<download hash>&networks=<comma separated network list>

Set a Download's Attributes

For simple attributes this method can be used:

method=setdownloadattribute&hash=<download hash>&name=<attribute_name>&value=<attribute_value>[&name=<...>&value=<...>]*

Supported attributes:

  • completedon: value=seconds since January 1st 1970
  • displayname: download's display name
  • savepath: download save path - rename the download name/folder only, can't be used to generally move the download location
  • torrentname: name of the torrent
  • usercomment: user comment
  • ipfilterenable: whether or not the download's IP filter is enabled; value=true/false
  • pluginoption: value=URL Encoded list of parameters: id=pluginid, enableannounce=true/false. Currently only defined for the "mldht" plugin. Example usage ...&name=pluginoption&value=id%3Dmldht%26enableannounce%3Dfalse

List Downloads

You can list downloads with the result being returned as a JSON array:

method=listdownloads

List a Download's Files

You can list a download's files with the result being returned as a JSON array:

method=listfiles&hash=<download hash>[&calc_root_hashes=<0|1>]

The optional parameter "calc_root_hashes" can be supplied to force a V2 root file hash to be computed for V1 torrents.

Set a Download's File Attributes

You can set a download's file attributes:

method=setdownloadfileattribute&hash=<download hash>&index=<index>&name=<attribute_name>&value=<attribute_value>[&index=<...>&name=<...>&value=<...>]*

Supported attributes:

  • datapath: value=absolute file path for the file's data
  • skipped: whether the file is downloaded or not; value true/false

Add a Download

You can add a download from a torrent file, magnet URI or torrent download URL using (since 3501_B14)

method=adddownload&[file|magnet|url]=<absolute path|magnet URI|torrent download URL>

Note that the file/magnet/url parameter names are synonymous, any of them can be used to add a file/magnet/url. Also the value needs to be URL-encoded.

Raise an Alert

To raise an alert against a download: (details is optional)

method=alert&caption=<caption>&type=<info|error>&details=<extra information>

Invocation from Tags

Rather than continually extending the 'execute on assign' Tag function with more and more features it made sense to enhance the existing 'script' option to invoke SimpleAPI features directly. Given that this is an internal invocation the 'apikey' is not required. Also as it applies to a specific download the 'hash' is implicit. For example, to invoke the 'setnetworks' method to set the download's networks to 'I2P you would use the following script

plugin( simpleapi, "method=setnetworks&networks=I2P" )

or, since 3201_B34, to play a sound when a download is assigned to a Tag:

plugin( simpleapi, "method=playsound[&file=<absolute path of .wav file>]" )

Multiple commands can be executed by semi-colon separating them.

Mark Result Read In Subscription

method=markresultsread&subscription_id=<subscription id>&subscription_result_id=<result_id> method=markresultsread&subscription_id=<subscription id>&subscription_result_ids=<comma separated list of result_ids>

Mark Result Read In All Subscriptions

This is identical to the above method but with the name set to 'markresultsreadinall'

Invocation from Subscriptions

Subscriptions have an "execute on new result" item allowing a script to be specified via a right-click menu item. In this case the 'subscription_id' and 'subscription_result_id(s)' are supplied automatically. To mark a new result as read you would use the following script

plugin( simpleapi, "method=markresultsread" )

Examples

One of our users, Droo, has created an HTML page that uses the SimpleAPI to list your downloads and allow you to make various modifications to it:

droo-simple-api-util.html

Save the file as a local HTML file and then open it in your browser. Enter your API key and experiment.

Download BiglyBT

Clone this wiki locally