From 46beccb67a7e6aec838693c8a94a12c9a4206061 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Sun, 13 Nov 2022 17:08:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=85=BE=E8=AE=AF=E4=BA=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=9C=B0=E5=9D=80=E9=89=B4=E6=9D=83=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Vod.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/app/Services/Vod.php b/app/Services/Vod.php index 9e5af267..b48cc93f 100644 --- a/app/Services/Vod.php +++ b/app/Services/Vod.php @@ -172,29 +172,25 @@ class Vod extends Service $expiredTime = base_convert(time() + $expiry, 10, 16); $tryTime = 0; // 试看时间,0不限制 - $ipLimit = 0; // ip数量限制,0不限制 - $random = rand(100000, 999999); // 随机数 + $ipLimit = 9; // ip数量限制,0不限制 + $random = uniqid(); // 随机数 /** * 腾讯坑爹的参数类型和文档,先凑合吧 * 不限制试看 => 必须exper=0(不能设置为空) - * 不限制IP => 必须rlimit为空(不能设置为0),暂不可用 + * 不限制IP => 必须rlimit为空(不能设置为0) */ - $myTryTime = $tryTime >= 0 ? $tryTime : 0; - $myIpLimit = $ipLimit > 0 ? $ipLimit : ''; + $myTryTime = $tryTime; + $myIpLimit = $ipLimit; $sign = $key . $dirName . $expiredTime . $myTryTime . $myIpLimit . $random; $query = []; $query['t'] = $expiredTime; - if ($tryTime >= 0) { - $query['exper'] = $tryTime; - } + $query['exper'] = $myTryTime; - if ($ipLimit > 0) { - $query['rlimit'] = $ipLimit; - } + $query['rlimit'] = $myIpLimit; $query['us'] = $random;