Skip to content

Encoder API Documentation

Daniel Neto edited this page Aug 1, 2024 · 2 revisions

This documentation covers the usage of the Encoder API endpoints. All endpoints require the following common parameters for authentication and authorization:

  • user: Your username
  • pass: Your password
  • siteURL: The URL of the AVideo site where the user credentials will be used for login

Endpoints

Note: The endpoint API will always be in the format https://yourdomain.com/API/[endpoint].php, where https://yourdomain.com/ is the encoder URL.

1. delete_queue.php

Description: Deletes a specific queue entry.

Required Variables:

  • queue_id: The ID of the queue entry to be deleted.
  • user: Your username.
  • pass: Your password.
  • siteURL: The URL of the AVideo site where the user credentials will be used for login.

Permissions: Your credentials must give you permissions to manipulate this queue_id.

Example:

POST https://yourdomain.com/API/delete_queue.php
{
    "user": "your_username",
    "pass": "your_password",
    "siteURL": "http://example.com",
    "queue_id": "123"
}

2. edit_queue.php

Description: Edits the priority of a specific queue entry.

Required Variables:

  • queue_id: The ID of the queue entry to be edited.
  • priority: The new priority value (must be between 1 to 10).
  • user: Your username.
  • pass: Your password.
  • siteURL: The URL of the AVideo site where the user credentials will be used for login.

Permissions: You must be the encoder admin to change the priority. Note that the encoder admin is different from the site admin. Public encoders cannot change the priority.

Example:

POST https://yourdomain.com/API/edit_queue.php
{
    "user": "your_username",
    "pass": "your_password",
    "siteURL": "http://example.com",
    "queue_id": "123",
    "priority": "5"
}

3. get_queue_status.php

Description: Retrieves the status of the encoding queue. Optionally, you can filter the status for a specific video.

Required Variables:

  • user: Your username.
  • pass: Your password.
  • siteURL: The URL of the AVideo site where the user credentials will be used for login.

Optional Variables:

  • videos_id: The ID of the video to filter the status.

Example:

GET https://yourdomain.com/API/get_queue_status.php
{
    "user": "your_username",
    "pass": "your_password",
    "siteURL": "http://example.com",
    "videos_id": "456"
}

4. restart_queue.php

Description: Restarts a specific queue entry.

Required Variables:

  • queue_id: The ID of the queue entry to be restarted.
  • user: Your username.
  • pass: Your password.
  • siteURL: The URL of the AVideo site where the user credentials will be used for login.

Permissions: Your user must have permissions to edit this queue.

Example:

POST https://yourdomain.com/API/restart_queue.php
{
    "user": "your_username",
    "pass": "your_password",
    "siteURL": "http://example.com",
    "queue_id": "123"
}

5. submit_video.php

Description: Submits a video to the encoding queue.

Required Variables:

  • videoURL: The URL of the video to be downloaded and encoded.
  • user: Your username.
  • pass: Your password.
  • siteURL: The URL of the AVideo site where the user credentials will be used for login.

Optional Variables:

  • videoTitle: The title of the video.

Example:

POST https://yourdomain.com/API/submit_video.php
{
    "user": "your_username",
    "pass": "your_password",
    "siteURL": "http://example.com",
    "videoURL": "http://example.com/video.mp4",
    "videoTitle": "Sample Video"
}

Each endpoint requires the common authentication variables (user, pass, siteURL). Make sure to include these in your requests to successfully interact with the Encoder API.