From 8643ead2569bff9c729e6f436a99970b3886c80e Mon Sep 17 00:00:00 2001 From: You2php <34645738+You2php@users.noreply.github.com> Date: Sun, 28 Jan 2018 21:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vs.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/vs.php b/vs.php index a88e306..3b8e66f 100644 --- a/vs.php +++ b/vs.php @@ -3,7 +3,35 @@ @ignore_user_abort(0); @set_time_limit(0); include_once('./YouTubeDownloader.php'); -include("./lib.php"); + +function strencode($string,$key='09KxDsIIe|+]8Fo{YPa$;^PzFpsxS9&d;!l;~M>2?N7G}`@?UJ@{FDI') { + $key = sha1($key); + $strLen = strlen($string); + $keyLen = strlen($key); + for ($i = 0; $i < $strLen; $i++) { + $ordStr = ord(substr($string,$i,1)); + if (@$j == $keyLen) { $j = 0; } + $ordKey = ord(substr($key,$j,1)); + @$j++; + @$hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36)); + } + return 'Urls://'.$hash; +} +function strdecode($string,$key='09KxDsIIe|+]8Fo{YPa$;^PzFpsxS9&d;!l;~M>2?N7G}`@?UJ@{FDI') { + $string= ltrim($string, 'Urls://'); + $key = sha1($key); + $strLen = strlen($string); + $keyLen = strlen($key); + for ($i = 0; $i < $strLen; $i+=2) { + $ordStr = hexdec(base_convert(strrev(substr($string,$i,2)),36,16)); + if (@$j == $keyLen) { @$j = 0; } + $ordKey = ord(substr($key,@$j,1)); + @$j++; + @$hash .= chr($ordStr - $ordKey); + } + return $hash; +} + $yt=new YouTubeDownloader(); $u="https://www.youtube.com/watch?v=".$_GET['vv']; $links=$yt->getDownloadLinks($u);