It's just a php client of the OpenLoad.co service.
composer require ideneal/openload:~1.1
All api features are been implemented.
You can retrieve your account info by using getAccountInfo
method.
<?php
include_once './vendor/autoload.php';
use Ideneal\OpenLoad\OpenLoadClient;
$openload = new OpenLoadClient('apiLogin', 'apiKey');
$accountInfo = $openload->getAccountInfo();
echo $accountInfo->getEmail(); //[email protected]
In order to retrieve a ticket to download a file you have to use
the getTicket
method and pass it the remote file you want to get the ticket.
The remote file has to be a FileInfo object or the file id.
<?php
include_once './vendor/autoload.php';
use Ideneal\OpenLoad\OpenLoadClient;
$openload = new OpenLoadClient('apiLogin', 'apiKey');
$fileInfo = $openload->getFileInfo('72fA-_Lq8Ak');
$ticket = $openload->getTicket($fileInfo);
// ...
// After read the captcha response from $ticket->getCaptcha()->getUrl()
$downloadLink = $openload->getDownloadLink($ticket, $captchaResponse);
You can upload a file by using uploadFile
method.
<?php
include_once './vendor/autoload.php';
use Ideneal\OpenLoad\OpenLoadClient;
$openload = new OpenLoadClient('apiLogin', 'apiKey');
$openload->uploadFile('/home/user/Pictures/image.jpg');
You can use searchFiles
method to search a file by its name.
The first parameter is the file name,
the second is a folder id (default null)
and the third parameter defines whether the search has to be recursive or not (default false)
<?php
include_once './vendor/autoload.php';
use Ideneal\OpenLoad\OpenLoadClient;
$openload = new OpenLoadClient('apiLogin', 'apiKey');
$files = $openLoad->searchFiles('video.mp4', null, true);
You can use searchFolders
method to search a folder by its name.
The first parameter is the folder name,
the second is a folder id (default null)
and the third parameter defines whether the search has to be recursive or not (default false)
<?php
include_once './vendor/autoload.php';
use Ideneal\OpenLoad\OpenLoadClient;
$openload = new OpenLoadClient('apiLogin', 'apiKey');
$folders = $openLoad->searchFolders('movies', null, true);
It's also possible find more about what you can to do at OpenLoad Api.
Daniele Pedone
MIT