DynTube API
  • Welcome!
  • Key Concepts
  • Quick Start
  • Reference
    • Videos
      • Video Upload via File (Server Side)
      • Video Upload via URL (server side)
      • HTML-Form Client Side Video Uploads
      • Get Video Status
      • Get Videos
      • Get Video
      • Update Video
      • Delete Video
      • Download Original Video
      • Get Video for Mobile App/Custom Player
      • Update Video Image
      • Add Video Captions/Chapters/Subtitles
      • Delete Video Captions/Subtitles/Chapters
      • Create Expirable Links
      • Get Collected Emails
      • Setting Up Webhooks
      • Copy call-to-action (CTA) to Videos
      • Token Authentication
    • Projects
      • Create Project
      • Update a Project
      • Get Projects
      • Get a Project
      • Delete a Project
      • Set default CTA for Project
    • Live Streaming
      • Create a Live Stream
      • Update a Live Stream
      • Get Live Streams
      • Get a Live Stream
      • Count Live Streams
      • Live Streams Limit
      • Get Live Streaming Recording
      • Delete a Live Stream
      • Service and Regions for live streams
    • Channels
      • Get Channels
      • Get Channel
      • Delete Channel
    • Subscriptions
      • Create a Plan
      • Create a Member
      • Attach Plan To Member
      • Get Plans
      • Get Members
      • Get Member's Plans
      • Delete a Plan
    • Analytics
      • Use your User Ids in Analytics
      • Get Video Analytics
    • Javascript Events Methods
      • Plain Javascript Events & Methods
      • Control the Player using React
      • Control the Player in Vue.js
    • Developer Resources
      • How to embed DynTube player in Next.Js
      • How to embed the video player in React
      • How to play DynTube videos in React Native
      • ExoPlayer app to play HLS videos
      • How to embed videos & channels dynamically
      • How to Import Vimeo Videos into DynTube
Powered by GitBook
On this page
  • Get the link to original file.
  • C# Sample
  • Node.js Sample
  • Python Sample
  • PHP Sample
  1. Reference
  2. Videos

Download Original Video

Get the link to original file.

GET https://api.dyntube.com/v1/videos/{id}/original-file

This endpoint will provide a link to your original video file that was uploaded. The response type will be text/plain.

{
    // Response
}
{
    // Response
}
{
    // Response
}

C# Sample

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

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

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";

$options = array(
    'http' => array(
        'header'  => "Authorization: Bearer {$bearerToken}\r\n",
        'method'  => 'GET',
    ),
);

$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);

if ($response) {
    echo "Original file URL: {$response}";
} else {
    echo "Error getting original file
PreviousDelete VideoNextGet Video for Mobile App/Custom Player

Last updated 2 years ago