Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

URL signing help please

8 replies [Last post]
Reply

Hi ! I just registered a free account and im currently trying to get URL signing working, but i always get permission denied when i try to watch a video with a signed url.

I have set "secure content" to "secure video dl and player embeds".

this is the php script im using:

<?php

function get_signed_player($videokey,$playerkey) {
$path = "players/".$videokey."-".$playerkey.".js";
$expires = time() + 3600;
$secret = "my secret key, 24 letters";
$string = "$path:$expires:$secret";
$signature = md5($string);
$url = 'http://content.bitsontherun.com/'.$path.'?exp='.$expires.'&sig='.$signature;
return $url;
};

$link = get_signed_player("sPGcp7Kk","ePWhdD6K");

echo "<script type="text/javascript" src="$link"></script>";
?>

I triple checked the secret key, the player and video key.

Any help is appreciated!

Reply

I don't see anything real obvious. Some things to look out for: is the output of the md5sum lowercase? (It should be).

Is your time and timezone configured correctly so your expire time is in UTC and not in local time?

Reply

Im not sure about the timezone but i checked the expire time that my code puts out with that of your url sign demo and the values are quite similar.

The md5sum is lowercase.

This is the output i get:

<script type="text/javascript" src="http://content.bitsontherun.com/previews/sPGcp7Kk-ePWhdD6K.js?exp=1326383346&sig=9001626cf7b43e3ceef1165be68aa138"></script>

Reply

I messed my post up, this is the output i get:

<script type="text/javascript" src="http://content.bitsontherun.com/players/sPGcp7Kk-ePWhdD6K.js?exp=1326386265&sig=8a983f12605f4fe64b2ee6cb56bf5ceb"></script>

Reply

Your example code generates an error 500 for me. As soon as I enter the video key, player key and your account secret in the example code that can be found on http://developer.longtailvideo.com/botr/system-api/content_signing.html and save that as a file it works though, not sure what happens, but there is likely a minor issue in your code.

Reply

Still getting Permission Denied while using the example code from your link.

i printed out the phpinfo and it says Default timezone: System/Localtime.

Could that be the problem?

Reply

But even when I try sth. like

$expires = round((time()+360000000000)/60)*60;

its not working

Reply

Ok i solved it.

i feel like a fool, there was a mistake in the secret key afterall. I took an "l" for an "I".

Thanks for the help anyways

Reply

Ah, you should always copy-paste your key in secret (although unfortunately there is a bug in the Dashboard that makes it hard for Firefox unless you look at the source, but it works in all other browsers.

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options