Videos

Download Original Video

Get the link to the original file.

http
GET /v1/videos/{id}/original-file

This endpoint returns a signed link to the uploaded original video file. The response type is text/plain.

Headers

Name / Type / Description
NameTypeDescription
AuthorizationStringBearer YOUR_API_KEY

Response

On success, the response body contains the direct URL to the original video file as plain text.

Status Code / Description
Status CodeDescription
200Success - Response body contains the original file URL
403Forbidden - Access to the original file is not allowed
404Not Found - Original file does not exist or video not found

C# Sample

csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace GetOriginalFileUrlExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            string videoId = "your_video_id";
            string bearerToken = "your_bearer_token";
            string url = $"https://api.dyntube.com/v1/videos/{videoId}/original-file";

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization =
                    new AuthenticationHeaderValue("Bearer", bearerToken);

                var response = await client.GetAsync(url);

                if (response.IsSuccessStatusCode)
                {
                    var content = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Original file URL: {content}");
                }
                else
                {
                    Console.WriteLine($"Error getting original file URL. Status code: {response.StatusCode}");
                }
            }
        }
    }
}

Node.js Sample

javascript
const axios = require('axios');

const videoId = 'your_video_id';
const bearerToken = 'your_bearer_token';
const url = `https://api.dyntube.com/v1/videos/${videoId}/original-file`;

const config = {
    headers: {
        Authorization: `Bearer ${bearerToken}`
    }
};

axios.get(url, config)
    .then(response => {
        if (response.status === 200) {
            console.log(`Original file URL: ${response.data}`);
        } else {
            console.log(`Error getting original file URL. Status code: ${response.status}`);
        }
    })
    .catch(error => {
        console.log(`Error getting original file URL. ${error}`);
    });

Python Sample

python
import requests

video_id = 'your_video_id'
bearer_token = 'your_bearer_token'
url = f'https://api.dyntube.com/v1/videos/{video_id}/original-file'

headers = {
    'Authorization': f'Bearer {bearer_token}'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    print(f'Original file URL: {response.content.decode()}')
else:
    print(f'Error getting original file URL. Status code: {response.status_code}')

PHP Sample

php
$videoId = 'your_video_id';
$bearerToken = 'your_bearer_token';
$url = "https://api.dyntube.com/v1/videos/{$videoId}/original-file";

$ch = curl_init($url);
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer {$bearerToken}"]
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status >= 200 && $status < 300) {
    echo "Original file URL: {$response}";
} else {
    echo "Error getting original file URL. Status code: {$status}";
}
  • Get video to confirm the video ID and original file metadata.
  • Get videos to request original file links for multiple videos with includeOriginalFile=true.
  • Video upload via file if you need to replace or re-upload the source file.

Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.