Extensions
Some sites cannot be downloaded from with a plain HTTP request: the link is a web page, with a login, a countdown or a captcha in front of the file. Extensions are small Python plugins that deal with that. They find the real download link and hand it back to FatRat, which downloads it like any other transfer, with segmenting, speed limits and resume.
What extensions add
- Download plugins, for sites that need special handling. The plugin takes over links that match the site and resolves them.
- Link extractor plugins, which turn one link (a folder page, say) into the links inside it.
- Upload plugins, which upload a file to a file host and report the link.
- Search plugins. Desktop: once one is installed, they appear as engines in the File sharing server search tool.
- Account status plugins, which report what is left of a premium account. Desktop: once one is installed, a premium account icon appears in the status bar; click it to see the status.
Extensions need a FatRat built with Python support.
Trust
FatRat has no central index of extensions. You add the repositories you want,
and install individual extensions from them. An installed extension runs with
your full user privileges, like anything else you install from a git
repository. Only add repositories you trust. The desktop, web and terminal front ends ask you to confirm before
they add one; the fatrat-conf command only prints a warning.
Repositories
A repository is a git repository, or just a directory, that contains a
fatrat-plugins.json file listing the extensions it offers. A git
repository is cloned (this needs git installed). A directory is
used where it lies, so changes you make to its files are picked up when the
extension is reloaded.
FatRat remembers which commit it installed an extension from. An update is something you choose: FatRat never installs one by itself. The desktop app can tell you that one is available (see Updating below).
Installing and removing extensions
Every front end shows the repositories you have added, the extensions they offer (Available) and the extensions you have Installed. A newly installed extension works straight away; you do not need to restart FatRat.
Desktop
Open Settings and choose Extensions. It has four tabs.
- Repositories: type a git URL in the box and press Add, or press Add directory... to pick a local directory. Select a repository and press Remove to forget it. Extensions already installed from it stay installed.
- Available: the extensions your repositories offer, with the version, the installed version and the repository. Press Refresh to fetch the repositories again. Select an extension and press Install / update. An extension with a newer version available is shown in bold.
- Installed plugins: name, version and description. Untick an extension to switch it off without removing it. Press Remove to delete it. Switching off is applied when you press OK in the settings dialog, and takes effect at once, without a restart.
- Plugin settings: pick an extension in the Plugin list to change the settings it declares, such as a user name and password.
Web interface
Open Settings and choose Extensions. The page has these sections:
- Repositories: type a git URL, or a directory on the server, and press Add. Refresh fetches the repositories again. Forget removes a repository; its installed extensions stay.
- Available: each entry has an Install button, which reads Update when a newer version is offered, or Reinstall when the same version is installed.
- Installed: an Enabled checkbox and a Remove button for each extension.
- Plugin settings: the settings the installed extensions declare. A few kinds of setting can only be changed in the desktop interface, and say so.
Terminal
Press F4 (or Ctrl+X) to open the extensions dialog.
Tab moves between the Installed, Available and
Repositories sections, and the keys for the current section are shown
in the bottom bar:
- Installed:
E(orEnter) enables or disables the extension,Dremoves it. - Available:
Enterinstalls or updates. - Repositories:
Aadds,Dforgets,Rrefreshes.
Extension settings are on the Extensions page of the terminal's settings dialog.
Command line
fatrat-conf plugins manages extensions without any front end,
which is useful on a server:
fatrat-conf plugins add https://example.com/someone/fatrat-plugins.git fatrat-conf plugins repos fatrat-conf plugins available fatrat-conf plugins install fatrat-plugins myplugin fatrat-conf plugins list
repos prints the repository ids FatRat gave the repositories;
install takes a repository id and an extension name. The other
commands are refresh [id], updates,
uninstall NAME and remove-repo ID. A running FatRat
loads the extension when it next starts; to load it right away, install it
from one of the front ends.
Dependencies
Most extensions need nothing beyond Python itself. If one needs packages from
the Python Package Index, FatRat names them and asks before installing
anything. They are installed with pip for that extension alone, and are
removed with it. From the command line, add --with-dependencies
to the install command to agree.
Updating
Refresh the repositories, then install the extension again from the Available list (the button says Install / update or Update). If transfers are still using the old version, FatRat tells you, and the new version takes over when they finish.
Desktop: FatRat checks the repositories you added for updates 30 seconds after
it starts, and then every 24 hours. It does nothing if you have added no
repository. An icon in the status bar shows the number of updates, with the
tooltip Extension updates. Click it to open the settings. This check is
on by default. It has no check box in the settings: to switch it off, set
python/check_updates to false in the settings file
(see Configuration Files). The web interface and
the terminal do not check by themselves;
fatrat-conf plugins updates lists the updates.
Switching extensions off
You can switch off one extension without removing it, as described above. A switched-off extension cannot start new transfers; transfers that are already using it carry on.
To run FatRat without any Python extensions, start it with:
fatrat --no-python
For a server, pass the same option to fatrat-nogui.
Where extensions are stored
Extensions, the repositories' clones and the record of what was installed
are in ~/.local/share/fatrat/plugins/.
Writing your own
An extension is a Python file and a small manifest. See Writing a FatRat Extension.