Load! Plug-in development

With version 3 of our plug-in system we have decided to provide it as open source in order to allow everyone to create a plug-in. The only requirement is the ability to know a programming language which is able to create native Windows-DLL's - such as C, C++ or Delphi. Our example plug-ins and the following declarations are written in Pascal(Delphi).

Most of it should be understood off our example plug-ins from the hosts Filemonkey.in (more advanced plugin), Sockshare.com (easier plugin) and NCrypt.in (decrypt plugin): http://www.candisoft.com/downloads/Example_Plugins.zip

Now following explanations of the interface methods:

The library has to export three functions:
CreateInstance – Creates a Load! plug-in object and returns is as an interface.

GetCapabilities – Returns a TCapabilities record, please refer to our example plug-in. A "0" in max. value means infinite, IsMultiHost should always stay on "false" (Only needed for services like SpeedLoad etc.).

GetHostFilter – Returns the filter, which applies on all links the plug-in needs to use. This also can be a regular expression. In this case the first character of the string must be a \.

The download plug-ins must implement the following methods:

procedure Init(Ifc: IDownload); stdcall;
Gives the interface to the plug-in in order to communicate with Load!

function GetFileInfo(Link: WideString): IFileInfo; stdcall;
Detects filename and size (Bytes) for a link.

function GetFileInfoMulti(Links: ICSList): IFileInfos; stdcall;
Detects file information for several links at the same time.

procedure Download(Link: WideString); stdcall;
Free download of a link.

procedure Premium(Link, Username, Password: WideString); stdcall;
Download of a link with a premium account.

function GetAccountInfo(Username, Password: WideString): TAccountInfo; stdcall;
Getting information of the premium account, such as validation time and included traffic left.

function CheckFile(Contents: WideString): Boolean; stdcall;
Is being opened, if the file is smaller than 30 KiB to check if there returned a HTML-error site of the file hoster. If a "False" appears, an error is deteced. In this case, the runtime has to open "RestartLink" as well.

Now talking about the IHTTP-Interface. It is the basement of IDownload and IDecrypt.

function Captcha(Link: WideString; Cookie: WideString = ”; Referer: WideString = ”;
Description: WideString = ”): WideString; stdcall;

Shows a captcha. Only set a description if it is not clear what to put in the captcha field or what to click in it. To show a clickable captcha we have to put "point@:description text" in the description.

function HTTP: IHTTPClient; stdcall;
Returns a "IHTTPClient-Interface", which opens the possibility for advanced manipulation of the client. "GetCurrentHeaders" can be used if a cookie is being delivered in a captcha download. "SetCustomHeader" adds the stated header to the next request. "RawRequest" can be used if there are rare and very advanced security arrangements, where the normal HTML-support is not enough.

function HTTPRequest(Link: WideString; Cookie: WideString = ”; Referer: WideString = ”; PostParams: WideString = ”; AllowRedirect: Boolean = True): THTTPResult; stdcall;
Self explaining. If "PostParams" is empty a GET-request is being performed.

function IsStopped: Boolean; stdcall;
Shows if the user clicked "stop" to cancel the link-processing.

procedure Log(Msg: WideString; Debug: Boolean = False); stdcall;
Log entries to find errors. Debug should always stay "False". Otherwise the entries will be shown in non-public debug builds of Load! only!

function Password: WideString; stdcall;
procedure RestartLink; stdcall;
function Tools: ITools; stdcall;

Self explaining.

Methods of "IDecrypt":

procedure AddContainer(Link, Extension: WideString; Cookie: WideString = ”;
Referer: WideString = ”); stdcall;

Downloads a container and adds it in. .dlc, .rsdf and .ccf are the supported formats.

function MirrorSelect(Mirrors: ICSList): TMirrorSelection; stdcall;
Shows a selection window for mirrors with names of the file hosters. A record will be returned with the name and the index. (we count from 0, -1 = stop).

procedure Progress(Current, Max: Integer; Info: WideString = ”); stdcall;
Shows the progress of the decryption. Info can e.g. be the name of the content which is being decrypted or it will just show the link.
You will find many useful hints and help in the "Unit Tools", esspecially for strings. Also there is the class "TCSList" declared where more help functions are integrated. The sense of this is to keep the plug-in as small as possible. The big standard units (e.g. classes) would take too much space.

Of course we will reply to any questions about out plug-in system - just post your question or comment in our support forum. You can publish your plug-in in our public support forum or alternatively send it us via PM or e-mail. If you want to publish your plug-in for official use on our update server, you have to send us the source code, so we can check if it's working correctly and without problems.

English