How can I find download links for vimeo videos?

后端 未结 9 945
长发绾君心
长发绾君心 2020-12-07 21:30

I saw that today vimeo changed the way they are streaming the videos and I can\'t stream their videos anymore. I saw that when I generate the link to the video, which was fo

相关标签:
9条回答
  • 2020-12-07 21:49

    The answers for this on SuperUser were out of date so I thought I would post it here (not enough reputation to post there)

    So I just recorded XHR requests with Chrome devtools and the first request was for the the json file containing the link to the akamai CDN hosted video along with the token akamai provides. This token is important. It is hash that includes a timestamp so the links for the videos here will need to be downloaded somewhat quickly or requests will be refused.

    The format for this JSON file was in the form:

    https://player.vimeo.com/video/VIDEO_ID/config?byline=0&collections=1&context=Vimeo%5CController%5CClipController.main&default_to_hd=1&outro=nothing&portrait=0&share=1&title=0&watch_trailer=0&s=6cffff97fffffffffff4ffffffff679ec66ffff_14ffffffff
    

    And then I just looked for the highest quality object in the JSON (1080p) and download that file. In the format:

    https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/01/XXXXX/8/XXXX/XXXXXXXX.mp4?token=XXXXXXX-0xXXXXXXXXXXXXX
    

    Note the Xs are numbers I replaced for privacy.

    0 讨论(0)
  • 2020-12-07 21:54

    A quick and dirty approach would be:

    $base = 'http://player.vimeo.com/play_redirect';
    
    $curl = curl_init(sprintf('http://player.vimeo.com/video/%s', $_GET['id']));
    curl_setopt_array($curl, array(
        CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
        CURLOPT_RETURNTRANSFER => true
    ));
    
    preg_match('/g:(\{.*?\}),a/s', curl_exec($curl), $match);
    curl_close($curl);
    
    $json = json_decode($match[1])->request;
    $url = sprintf('%s?quality=sd&clip_id=%s&time=%d&sig=%s',
        $base,
        $_GET['id'],
        $json->timestamp,
        $json->signature
    );
    
    $curl = curl_init($url);
    curl_setopt_array($curl, array(
        CURLOPT_HEADER => true,
        CURLOPT_NOBODY => true,
        CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
        CURLOPT_RETURNTRANSFER => true
    ));
    
    $headers = explode("\r\n", curl_exec($curl));
    curl_close($curl);
    
    foreach ($headers as $header) {
        if ($header) {
            header($header);
        }
    }
    
    0 讨论(0)
  • 2020-12-07 22:01

    The extension Vimeo video downloader for browser is helpful to do this.

    After installed the extension in Chrome or Edge browser, then click the Download button in the page. Finally you can download the video of the required quality.

    This extension can also help you download private vimeo video which need input password, certainly you need know the password. No crack here.

    0 讨论(0)
提交回复
热议问题