Configuration Files |
![]() |
FatRat's configuration files typically reside in /usr/share/fatrat/data
(this location is hardcoded at compile time), along with some other data files. Any user may force FatRat to use his own config files by placing them into ~/.local/share/fatrat/data
.
When autodetecting link types, FatRat has to distinguish between ordinary HTTP links and links pointing to torrents. This is quite easy if the link ends with .torrent
, however there are many websites that don't follow this scheme. Such websites have regular expressions in the btlinks.txt
file - if an URL is fully matched by a regular expression from this file, it is regarded as a URL pointing to a torrent file.
This XML document contains information about torrent search engines. The following sample file should make the document's structure clear:
<search> <engine name="The Pirate Bay"> <!-- Search engine's name --> <!-- The URL to be used for search queries; %1 will be replaced with the search phrase --> <param name="query">http://thepiratebay.org/search.php?q=%1</param> <!-- A string that marks the beggining of search results --> <param name="beginning"><td class="vertTh"></param> <!-- A string that is used as a splitter between individual search results --> <param name="splitter"></tr></param> <!-- A string that marks the end of search results --> <param name="ending"></table></param> <!-- If the query has to be sent using the POST method, the following data will be used for the POST request. %1 will be replaced with the search phrase. --> <param name="postdata">SearchString1=%1&SearchString=&search=Search</param> <!-- When the results have been cut out and split by the splitter, regular expression matching is used to extract torrent's details. --> <!-- A regular expression matching the name of a search result --> <regexp name="name" field="1">class="detLink" title="([^"]+)">([^"]+)</a></regexp> <!-- A regular expression matching the link pointing to the .torrent file --> <regexp name="link" match="1"><td><a href="([^"]+)"</regexp> <!-- A regular expression matching the link pointing to the details page --> <regexp name="info" match="2"><td><a href="([^"]+)"</regexp> <!-- A regular expression matching the torrent's size. FatRat will automaically detect units (KB, MB etc.) --> <regexp name="size"><td align="right">([^"]+)</td></regexp> <!-- A regular expression matching the number of peers seeding the torrent --> <regexp name="seeders" match="1"><td align="right">([^"]+)</td></regexp> <!-- A regular expression matching the number of peers downloading the torrent --> <regexp name="leechers" match="2"><td align="right">([^"]+)</td></regexp> <!-- Notice the field and match attributes. The field number specifies which of the regular expression's subexpressions is the desired resulting string. The match number specifies which match of the expression is to be used. 1 is default, 2 means the second match will be used and so on. --> </engine> </search>
The default values of all sorts of configurable values are stored in this file. Generally, all of these values may be reconfigured via the GUI. Therefore it shouldn't be necessary to edit this file.
Copyright © 2006-2008 Luboš Doležel