Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the video thumbnail of private videos on Vimeo

Tags:

oauth

vimeo

This is a repost from the vimeo forum, but since nobody is answering over there, I try my luck here:

I have been trying for some hours now to get my head around the whole oAuth thing, but I don't seem to get it working. I want to retrieve thumbnails for private videos, using the advanced vimeo api. This is what I have right now:

$vimeo = new phpVimeo($consumer_key, $consumer_secret, $access_token, $access_token_secret);
$result = $vimeo->call('vimeo.videos.getThumbnailUrls', array('video_id ' => $video_id));

When I try it like this, I keep getting the error

"Fatal error: Uncaught exception 'VimeoAPIException' with message 'Invalid signature' ".

I'm absolutely positive that the keys and secrets are correct. Do I have to do more to make this thing work? Of course, it would be amazing to have an example where I just have to put in all my key data in and it works.

thanks in advance!

like image 450
rassoh Avatar asked Aug 27 '12 11:08

rassoh


People also ask

Why is Vimeo thumbnail not showing?

If you use the Vimeo API in your custom applications and/or are caching your video thumbnail's URL, your thumbnails may no longer be appearing in the video player, particularly in cases where your thumbnail URLs were hard-coded in an application or site which therefore means the link structure will not be updated ...

Does Vimeo have thumbnails?

In the Vimeo video manager, select your video, then click Settings to the right of the player. 3. Under the General tab, scroll down and click on Edit thumbnail.

Can private Vimeo videos be embedded?

Only public showcases and showcases set to Hide from Vimeo can be embedded, as password-protected showcases cannot be. Also, only videos with a privacy setting of Anyone or Hide this video from Vimeo.com can be displayed in an embedded playlist.

How do I get the Vimeo thumbnail image in PHP?

php-vimeo-video-thumbnail-url.php * Gets the thumbnail url for a vimeo video using the video id. This only works for public videos. * @param string $id The video id. * @param string $thumbType Thumbnail image size.


1 Answers

There are a couple of ways to help troubleshoot your signature errors. First I want to explain some terminology.

  • Api Endpoint - The api url you are requesting.
  • Client ID / Client Secret - A pair of tokens given to you when you create your Api Application
  • Request Token - A token generated while authorizing a user. This token can not be used to make api calls.
  • OAuth Token / Token Secret - A pair of tokens given to you when you send a user through your authorization workflow
  • Base String - A specifically formatted string that contains all the information relating to your API request.
  • OAuth Signature - A hashed token that represents the request you are making. This is generated using a base string, your client id and secret, and an optional oauth token and secret.

Troubleshooting

  1. Try using the latest version of the official PHP library : https://github.com/vimeo/vimeo-php-lib.
  • If this works, there is an issue in your code. Continue to step 2.
  • If this does not work let Vimeo know. You do not need to continue these steps.
  1. Use the Hueniverse interactive guide : http://hueniverse.com/oauth/guide/authentication/
  • Make a request and log every URL, header and parameter. Also include the Base String.
  • Click all the plus signs to expand the input forms and then fill in all of the appropriate data.
  1. Ensure that the Hueniverse Base String matches your own generated Base String
  • If this matches, and the signature is still incorrect you are likely performing the hmac signature incorrectly. Check all of your tokens, feel free to contact Vimeo.
  • If the Base String does not match, make sure you are following the spec : https://www.rfc-editor.org/rfc/rfc5849#section-3.4.1
  1. If all else fails, your best option is to contact Vimeo directly. They can look up your authentication tokens and expected signatures.
like image 151
Dashron Avatar answered Sep 22 '22 08:09

Dashron