how to get the private meta data from vimeo private video

4.4k Views Asked by At

Hi i cant able to fetch the private meta data like title, duration,image,etc... from the private access video's in Vimeo. Can any one help me to find a solution for this?

I uploaded one video in my account with private mode. I cant able to fetch the meta data details too.

I am using PHP to fetch the details.

2

There are 2 best solutions below

0
On

This is very similar to: Get URL/Embed code to private Vimeo videos programatically

Unfortunately the answer there has not been marked as the answer, a necessary step to link the two questions together, so I'll repost it here.


  1. Register an API app on https://developer.vimeo.com/apps

This is necessary for every API app. We need to know who is using our system, and how to contact them if necessary.

  1. Generate an access token.

There is general documentation at https://developer.vimeo.com/api/authentication, but you will likely be using the "single user application" workflow. It's a lofty title for "generate an access token via the UI on your application page, then hard code it into your app". This access token will interact with the API on behalf of the user who registered the application.

  1. Request your video information.

There are many different API calls to get video information. You can find these at https://developer.vimeo.com/api/endpoints. /me/videos will show all of the authenticated users videos, /videos/{video_id} will show a single video.


One extra note, if you are using PHP you should use the official Vimeo PHP library: https://github.com/vimeo/vimeo.php

0
On

Visite https://github.com/leandrocfe/PHPVimeoAPI_List_Private_Video

List private videos from Vimeo

  1. Modify config.json info vimeo account;
  2. Access video.php and add vimeo_video_id get param. Ex: localhost/vimeo/video.php?id=123123123

    <?php
    
    //utf-8
    header('Content-Type: text/html; charset=utf-8');
    
    //lib vimeo
    use Vimeo\Vimeo;
    
    //métodos de inicialização
    $config = require(__DIR__ . '/init.php');
    
    //vimeo video id
    @$id = $_GET["id"];
    
    //isset get
    if(isset($id)){
    
        // vimeo class send config.json paramns
        $lib = new Vimeo($config['client_id'], $config['client_secret'], $config['access_token']);
    
        //get data vimeo video
        $me = $lib->request("/me/videos/$id");
    
        //iframe vídeo
        $embed = $me["body"]["embed"]["html"];
    
        //edit video size
        $default_size = 'width="'.$me["body"]["width"].'" height="'.$me["body"]["height"].'"';
        $new_size = 'width="420" height="220"';
    
        $embed = str_replace($default_size, $new_size, $embed);
    
        //autoplay
        $embed = str_replace('player_id=0', 'player_id=0&autoplay=1', $embed);
    
    }else{
    
        echo("Not find get id video");
    }
    ?>
    <!DOCTYPE html>
    <html>
        <head>
            <title>Vimeo Vídeo</title>
        </head>
        <body>
            <div><?php echo $embed ?></div>
            <div>
                <p><b>Name: </b><?php print_r($me["body"]["name"]); ?></p>
                <p><b>Description: </b><?php print_r($me["body"]["description"]); ?></p>
                <p><b>Link: </b><?php print_r($me["body"]["link"]); ?></p>
                <p><b>Likes: </b><?php print_r($me["body"]["embed"]["buttons"]["like"]); ?></p>
                <p><b>Data Created: </b><?php print_r($me["body"]["created_time"]); ?></p>
                <p><b>Data Modified: </b><?php print_r($me["body"]["modified_time"]); ?></p>
                <p><b>Images: </b>
                    <?php print_r($me["body"]["pictures"]["uri"]); ?> |
                    <?php print_r($me["body"]["pictures"]["sizes"][0]["link"]); ?> |
                    <?php print_r($me["body"]["pictures"]["sizes"][1]["link"]); ?> |
                    <?php print_r($me["body"]["pictures"]["sizes"][2]["link"]); ?> |
                    <?php print_r($me["body"]["pictures"]["sizes"][3]["link"]); ?> |
                    <?php print_r($me["body"]["pictures"]["sizes"][4]["link"]); ?> |
                    <?php print_r($me["body"]["pictures"]["sizes"][5]["link"]); ?>
                    </p>
            </div>
            <div><?php //print_r($me); //use for show all options ?></div>
        </body>
    </html>