从Level3 CDN保护RTMP流的问题

The*_*can 5 php hash cdn digest

我目前正在处理从Level3 CDN保护rtmp流的问题.

文档可以在这里找到:https: //rapidshare.com/files/1450549534/Token_Components.html (看起来你需要登录才能查看,因此我在托管上托管.原始网址是: https:// mediaportal.level3.com/mediaWeb/help/Content/ServicesDocs-Streaming/StreamingTokenAuth/TokenComponents.htm)

Scoll down to On Demand流输入/输出示例(适用于MP4文件)

我试图重现该示例并获得具有相同值的相同网址.我为此写了一个小函数:

function flimmithash($file) {
    $streamer = 'pmsales';
    $host = 'pmsalesfs.fplive.net'; 
    $start_time = '20080101120000'; 
    $end_time = '20101231235900'; 
    $customer_secret = 'Secret'; // in the documentation there is also secret with a non capital s, i tried both

    $resouce_path = "/$streamer/$file";                                                     echo "resouce_path: $resouce_path <br>\n";
    $message = "$resouce_path?start_time=$start_time&end_time=$end_time#$customer_secret";  echo "message: $message <br>\n";
    $digest = md5($message);                                                                echo "digest: $digest <br>\n";
    $tokenvalue = "start_time=$start_time&end_time=$end_time&digest=$digest";               echo "tokenvalue: $tokenvalue <br>\n";
    $token = base64_encode($tokenvalue);                                                    echo "token: $token <br>\n";
    $url = "rtmp://$host/$streamer?token=".($token)."/mp4:$file";                           echo "url: $url <br>\n";        
    return $url;
}
echo "url: ".flimmithash('support/lvlt300kbps.mp4')."<br>\n"; 
Run Code Online (Sandbox Code Playgroud)

我使用与示例中完全相同的值,但无法获得相同的摘要.

我使用md5,因为它匹配长度.我也尝试过资本和非资本的秘密.

您可以在此处访问示例脚本:https://rapidshare.com/files/2581196874/Appendix.html(原文:https://mediaportal.level3.com/mediaWeb/help/Content/ServicesDocs-Streaming/StreamingTokenAuth/Appendix- SampleScripts.htm)

但是绝对没有使用md5,他们使用sha1.但是sha1比示例中的摘要长.

当然,我试图用我的值填充两个版本,但都没有奏效.

所以我的问题是:根据示例,任何人都可以重现示例和/或告诉我摘要或改变我的功能吗?

mje*_*jec 2

他们的例子是不正确的。他们给出的摘要是针对该文件的/support/lvlt300kbps.flv,并且可以使用该文件名的 md5 轻松生成,并使用小写字母secret作为共享密钥。您可以看到它与其文档中上面的 FLV 示例中给出的摘要相同。