Vidoza API

General

Base-URL for our API is https://api.vidoza.net

Requests to the API should be made via HTTP GET or POST parameters. Response is always in JSON-Format.

Authorization requires API key, which you can find in your settings menu in the User Panel. API key should be added in HTTP headers:

Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK

or as GET / POST parameter api_token

HTTP Upload

Request URL

https://api.vidoza.net/v1/upload/http/server

There are 2 stage in upload:

1. You should get an Upload URL via GET request.

Example of request

curl -X GET \
  https://api.vidoza.net/v1/upload/http/server \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Example of response

{
    "data": {
        "upload_url": "https://upload22.vidoza.net/upload/03",
        "upload_params": {
            "is_xhr": true,
            "sess_id": "SDErfNTBc03PYnmw"
        }
    }
}

2. Uploads should be made via POST request to the upload URL returned by our API and it should be multipart/form-data encoded.
Also you should add all parameters (upload_params) received in GET request.

Example of request

curl -X POST \
  https://upload22.vidoza.net/upload/03 \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F is_xhr=true \
  -F sess_id=SDErfNTBc03PYnmw \
  -F file=@/tmp/video.mp4

Example of response

{
    "status": "OK",
    "code": "zb736dqrhx45"
}

The file will be available by URL https://vidoza.net/zb736dqrhx45.html

Parameters

Required parameters for upload:

  • is_xhr (always “ true”)
  • sess_id
  • file - file for upload

Optional parameters (see https://vidoza.net/?op=upload_multi)

  • file_title
  • file_descr
  • fld_id - folder id
  • cat_id - Video Category. Adult = 2 Not adult = 3
  • extra_Year
  • tags

Example

<?PHP
function vidoza_upload($apiToken, $file, $params  = array())
{
    // Get upload server
    $ch = curl_init('https://api.vidoza.net/v1/upload/http/server');
    $authorization = "Authorization: Bearer ".$apiToken; // Prepare the authorisation token
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization )); // Inject the token into the header
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $res = curl_exec($ch);
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        return false;
    }
    curl_close($ch);
    $res = json_decode($res);
    if (!$res->data) {
        return false;
    }

    // POST variables
    $postParams = array();
    foreach (array_merge((array) $res->data->upload_params, $params) as $field => $value) {
        $postParams[$field] = $value;
    }
    if (function_exists('curl_file_create')) { // php 5.5+
        $postParams['file'] = curl_file_create($file);
    } else {
        $postParams['file'] = '@' . realpath($file);
    }

    // Upload file
    $ch = curl_init($res->data->upload_url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $postResult = curl_exec($ch);
    if (curl_errno($ch)) {
        print curl_error($ch);
        print "Unable to upload file." . curl_errno($ch);
       return false;
    }
    curl_close($ch);
    $res = json_decode($postResult, true);
    if (($res['status'] != 'OK')) {
        print "Upload error:" . $res['code'];
        return false;
    }
}

$apiToken = 'GIjUt8';
$fileCode = vidoza_upload($apiToken, '/tmp/video.mp4');
print "https://vidoza.net/{$fileCode}.html";

Status of files

You can check whether your file is active or deleted.

Request URL

https://api.vidoza.net/v1/files/check

Files’ codes should be sent via GET array (not more 500 codes) such a way
?f[]=dsx720i6x2zn&f[]=kk2osjr01ogp&f[]=zb736dqrhx45

Example of request

curl -X GET \
  'https://api.vidoza.net/v1/files/check?f[]=dsx720i6x2zn&f[]=kk2osjr01ogp&f[]=zb736dqrhx45' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Example of response

{
    "data": [
        {
            "id": "dsx720i6x2zn",
            "name": "Ariana Grande - God is woman.mp4",
            "title": "Ariana Grande - God is woman",
            "descr": "",
            "folder_id": 0,
            "status": "active",
            "streamable": true
        },
        {
            "id": "kk2osjr01ogp",
            "name": "Naan_Kadavul.avi",
            "title": "Naan Kadavul",
            "descr": "",
            "folder_id": 0,
            "status": "active",
            "streamable": false
        },
        {
            "id": "zb736dqrhx45",
            "name": "Cinema_countdown_timer.mp4",
            "title": "Cinema countdown timer",
            "descr": "",
            "folder_id": 0,
            "status": "deleted",
            "delete_reason": "abuse"
        }
    ]
}

Fields of response

  • Status: “active” / “deleted”
  • Delete_reason: if the file was deleted, you get the reason of deletion
  • Streamable: “true” if the file was already encoded / “false” if the file is in encoding queue

Folder Management

Request URL

https://api.vidoza.net/v1/folders

List Folder

Shows the list of your folders

Example of request

curl -X GET \
  https://api.vidoza.net/v1/folders \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Example of response

{
    "data": [
        {
            "id": 12,
            "name": "TopFolder2",
            "parent_id": 0
        },
        {
            "id": 69,
            "name": "TopFolder1",
            "parent_id": 0
        },
        {
            "id": 42428,
            "name": "torrent",
            "parent_id": 0
        },
        {
            "id": 96087,
            "name": "SecondLevel1",
            "parent_id": 69
        },
        {
            "id": 96088,
            "name": "SecondLevel2",
            "parent_id": 69
        },
        {
            "id": 96089,
            "name": "ThirdLevel1",
            "parent_id": 96087
        }
    ],
    "links": {
        "first": "https://api.vidoza.net/v1/folders?page=1",
        "last": "https://api.vidoza.net/v1/folders?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://api.vidoza.net/v1/folders",
        "per_page": 100,
        "to": 6,
        "total": 6
    }
}

Show the specific folder

Example of request

curl -X GET \
  https://api.vidoza.net/v1/folders/69 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Example of response

{
    "data": {
        "id": 69,
        "name": "TopFolder1",
        "parent_id": 0,
        "subfolders": [
            96087,
            96088
        ]
    }
}

Fields of response

  • “subfolders” is ID of subfolders

Rename Folder

Example of request

curl -X PUT \
  'https://api.vidoza.net/v1/folders/96088?name=NewName' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Create Folder

Example of request

curl -X POST \
  'https://api.vidoza.net/v1/folders?name=NewFolder&parent_id=69' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Parameters

  • name - Name of folder
  • parent_id - Folder ID ( if 0, new folder will be created in the root folder)
  • Example of response

    {
        "data": {
            "id": 96090,
            "name": "NewFolder",
            "parent_id": "69",
            "subfolders": []
        }
    }

    Files Management

    Request URL

    https://api.vidoza.net/v1/files

    List Files

    Shows the list of your files

    Example of request

    curl -X GET \
      https://api.vidoza.net/v1/files \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache'

    Example of response

    {
        "data": [
            {
                "id": "test-code1",
                "name": "test name1",
                "name_seo": "test name seo",
                "title": "test title1",
                "descr": "test descr1",
                "folder_id": 100846,
                "downloads": 0,
                "views_paid": 0,
                "category": "Not adult",
                "size": 0,
                "created": "0000-00-00 00:00:00",
                "status": "active",
                "streamable": false
            },
            {
                "id": "test-code2",
                "name": "test name2",
                "name_seo": "test name seo",
                "title": "test title2",
                "descr": "test descr2",
                "folder_id": 0,
                "downloads": 0,
                "views_paid": 0,
                "size": 0,
                "created": "0000-00-00 00:00:00",
                "status": "active",
                "streamable": false
            }
        ],
        "links": {
            "first": "https://api.vidoza.net/v1/files?page=1",
            "last": "https://api.vidoza.net/v1/files?page=1",
            "prev": null,
            "next": null
        },
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 1,
            "path": "https://api.vidoza.net/v1/files",
            "per_page": 100,
            "to": 2,
            "total": 2
        }
    }

    Filtering

    When you get list of files you can filter result by using GET parameters

    • name
    • name_seo
    • title
    • descr
    • folder_id
    • category - adult category (Adult/Not adult)
    • downloads_from
    • views_paid_from
    • downloads_to
    • views_paid_to

    Example of request

    curl -X GET \
      "https://api.vidoza.net/v1/files?name=test name1&name_seo=test name seo" \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache'

    Example of response

    {
        "data": [
            {
                "id": "test-code1",
                "name": "test name1",
                "name_seo": "test name seo",
                "title": "test title1",
                "descr": "test descr1",
                "folder_id": 100846,
                "downloads": 0,
                "views_paid": 0,
                "category": "Not adult",
                "size": 0,
                "created": "0000-00-00 00:00:00",
                "status": "active",
                "streamable": false
            },
        ],
        "links": {
            "first": "https://api.vidoza.local/v1/files?name=test%20name1&name_seo=test%20name%20seo&page=1",
            "last": "https://api.vidoza.local/v1/files?name=test%20name1&name_seo=test%20name%20seo&page=1",
            "prev": null,
            "next": null
        },
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 1,
            "path": "https://api.vidoza.net/v1/files/100846",
            "per_page": 100,
            "to": 1,
            "total": 1
        }
    }

    Sorting

    When you get list of files you can sort result by using GET parameters

  • orderColumn - sort file column (id/name/folder_id/downloads/views_paid/size/created/status, default:id)
  • orderDirection - sort direction (asc/desc, default:asc)
  • Example of request

    curl -X GET \
      https://api.vidoza.net/v1/files?orderColumn=name&orderDirection=desc \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache'

    Update file

    Request URL

    https://api.vidoza.net/v1/files/<FileCodeId>

    Parameters

    • name - Name of file, string, max 255 symbols
    • name_seo - Seo name of file<, string, max 255 symbols
    • title - Title of file, string, max 255 symbols
    • descr - Title of file, text
    • folder_id - Id of file folder (integer, not null, folder must be exists, you shod be owner of this folder)

    Example of request

    curl -X PATCH \
      https://api.vidoza.net/v1/files/test-code1 \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache' \
      -F "name=test name edited" \
      -F "name_seo=test name_seo edited" \
      -F "title=test title edited" \
      -F "descr=test description edited" \
      -F "folder_id=100846"

    Example of response

    {
        "data": {
            "id": "test-code1",
            "name": "test name edited",
            "name_seo": "test name_seo edited",
            "title": "test title edited",
            "descr": "test description edited",
            "folder_id": 100846,
            "downloads": 0,
            "views_paid": 0,
            "category": "Not adult",
            "size": 0,
            "created": "0000-00-00 00:00:00",
            "status": "active",
            "streamable": false
        }
    }

    Clone upload

    Request URL

    https://api.vidoza.net/v1/upload/clone

    Parameters

    • urls - array with file urls
    • category - adult category (Adult/Not adult)
    • tags - string with tags
    • year - string with year
    • folder_id - Id of file folder (integer, not null, folder must be exists, you shod be owner of this folder)

    Example of request

    curl -X POST \
      https://api.vidoza.net/v1/upload/clone \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache' \
      -F "urls[]=https://vidoza.net/o243zovszbnt/test%20name%20seo" \
      -F "urls[]=https://vidoza.net/ylu6o9owewq2/test%20name%20seo" \
      -F "category=Adult" \
      -F "tags=test tag1, test tag2" \
      -F "year=2019" \
      -F "folder_id=100846"
    {
        "cloned": [
            "kkyj9al0kwry",
            "gjuyjrhek28g"
        ],
        "failed": "",
        "state": "success"
    }

    Srt Management

    Request URL

    https://api.vidoza.net/v1/files/<FileCodeId>/sub

    List srt

    Shows the list srt of you file

    Example of request

    curl -X GET \
      https://api.vidoza.net/v1/files/test-code1/sub \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache'

    Example of response

    {"Arabic":{"ext":"vtt","size":2439,"url":"https:\/\/api.vidoza.net\/srt\/01917\/test-code1_Arabic.vtt"}}

    Upload srt

    Upload srt to you file

    Parameters

    • srt - file with subtitles (.srt or .vtt)
    • srt_lang - language name (supported: Arabic; Bulgarian; Chinese; Croatian; Czech; Danish; English; Filipino; Finnish; French; German; Greek; Hungarian; Icelandic; Indonesian; Italian; Japanese; Norwegian; Polish; Portuguese; Romanian; Russian; Serbian; Spanish; Swedish; Thai; Turkish; Vietnamese)

    Example of request

    curl -X POST \
      https://api.vidoza.net/v1/files/test-code1/sub \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache'
      -F "srt_lang=Arabic"
      -F "srt=@/path/to/srt/file.srt"

    Example of response

    {
        "data": {
            "id": "test-code1",
            "name": "test name1",
            "name_seo": "test name seo",
            "title": "test title1",
            "descr": "test descr1",
            "folder_id": 100846,
            "downloads": 0,
            "views_paid": 0,
            "category": "Not adult",
            "size": 0,
            "created": "0000-00-00 00:00:00",
            "status": "active",
            "streamable": false
        },
    }

    Destroy srt

    Destroy selected srt lang from you file

    Parameters

    • del_srt - lang name (list of lang see in "Upload srt" section)
    • ext - removed file extension (srt/vtt)

    Example of request

    curl -X DELETE \
      https://api.vidoza.net/v1/files/test-code1/sub \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
      -H 'cache-control: no-cache'
      -F "del_srt=Arabic"
      -F "ext=vtt"

    Example of response

    {
        "data": {
            "id": "test-code1",
            "name": "test name1",
            "name_seo": "test name seo",
            "title": "test title1",
            "descr": "test descr1",
            "folder_id": 100846,
            "downloads": 0,
            "views_paid": 0,
            "category": "Not adult",
            "size": 0,
            "created": "0000-00-00 00:00:00",
            "status": "active",
            "streamable": false
        },
    }
    We ask that you allow us to use a little bit of your CPU to mine cryptocurrency, this helps us to reduce ads and stay alive.
    If you want you can cancel mining.