{"id":17749,"date":"2020-02-03T16:23:00","date_gmt":"2020-02-03T08:23:00","guid":{"rendered":"http:\/\/4563.org\/?p=17749"},"modified":"2020-02-03T16:23:00","modified_gmt":"2020-02-03T08:23:00","slug":"%e8%a7%86%e9%a2%91%e5%ae%8c%e7%be%8e%e5%88%87%e7%89%87%e5%ad%98%e5%82%a8%e6%96%b9%e6%a1%88-%e9%99%84%e8%87%aa%e5%8a%a8%e5%8c%96%e5%a4%84%e7%90%86%e8%84%9a%e6%9c%ac%e3%80%90%e8%bd%ac%e8%bd%bd%e3%80%91","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=17749","title":{"rendered":"\u89c6\u9891\u5b8c\u7f8e\u5207\u7247\u5b58\u50a8\u65b9\u6848 \u9644\u81ea\u52a8\u5316\u5904\u7406\u811a\u672c\u3010\u8f6c\u8f7d\u3011 &#8211; VPS\u8d44\u8baf"},"content":{"rendered":"<br \/>\n<h3>\u8f6c\u8f7d\u81ea<\/h3>\n<p><code>blog.kieng.cn<\/code><\/p>\n<h3>\u524d\u8a00<\/h3>\n<p>\u89c6\u9891\u50a8\u5b58\u662f\u5f88\u591a\u4eba\u7684\u4e00\u4e2a\u96be\u9898\u2026\u81ea\u5df1\u4e70\u4e2a\u670d\u52a1\u5668\u53c8\u9700\u8981\u5bbd\u5ea6\u6709\u9700\u8981\u786c\u76d8\u591f\u5927\uff01<\/p>\n<p>\u770b\u770b\u600e\u4e48\u662f\u4e00\u4e2a\u5b8c\u7f8e\u7684\u5b58\u50a8.<\/p>\n<h3>\u5f00\u59cb\u64cd\u4f5c<\/h3>\n<p>\u6211\u4e5f\u662f\u5076\u7136\u53d1\u73b0\u7684\u3002\u628a\u89c6\u9891\u5207\u7247\u6210 m3u8 \u4e4b\u540e\uff0c\u89c6\u9891\u4f1a\u53d8\u6210\u4e00\u6bb5\u6bb5\u7684 ts \u683c\u5f0f\u7684\u89c6\u9891\u3002\u8fd9\u4e2a\u65f6\u5019\u6211\u60f3\u4e86\u4e00\u4e0b\u3002\u5982\u679c\u8bf4\u67d0\u4e9b\u56fe\u5e8a\u53c8 bug \u4e0d\u9a8c\u8bc1\u6587\u4ef6\u683c\u5f0f\uff0c\u90a3\u4e48\u662f\u4e0d\u662f\u5c31\u53ef\u4ee5\u628a\u5207\u7247\u89c6\u9891\u653e\u5728\u4ed6\u7684\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u64ad\u653e\u4e86\uff1f<\/p>\n<p>\u563f\u563f\uff0c\u6ca1\u60f3\u5230\u771f\u7684\u53ef\u4ee5\u3002\u5f53\u5f53\u5f53~ \ud83d\ude06 \u4ed6\u5c31\u662f\u963f\u91cc\u7684\u201c\u56fe\u5e8a\u201d\u3002<\/p>\n<p><code>\u8fd9\u4e2a\u5176\u5b9e\u4e0d\u662f\u4ec0\u4e48\u56fe\u5e8a\uff0c\u662f\u963f\u91cc\u5df4\u5df4\u5ba2\u670d\u4e2d\u4e00\u4e2a\u6f0f\u6d1e\uff0c\u7a33\u5b9a\u51e0\u5e74\u4e86\uff0c\u5f88\u591a\u4ec0\u4e48\u56fe\u5e8a\u7f51\u7ad9\u5c31\u662f\u7528\u8fd9\u4e2a\u63a5\u53e3<\/code><\/p>\n<p>\u6709\u4e86\u65b9\u6848\u6211\u4eec\u5c31\u8bd5\u8bd5\u5427\u3002<\/p>\n<p>\u6211\u76f4\u63a5\u4e0a\u81ea\u52a8\u5316\u811a\u672c\u4e86\uff1a<\/p>\n<pre><code>&lt;?php   $v_path = $argv[1]; \/\/\u5207\u7247\u8def\u5f84 $v_name = $argv[2]; \/\/\u5e26\u5207\u7247\u7684\u89c6\u9891\u8def\u5f84\u540d\u79f0 $s = 5; \/\/\u5207\u7247\u79d2  ts \u5207\u7247\u5fc5\u987b\u5c0f\u4e8e 5MB if (empty($v_path) || empty($v_name)) {     echo &quot;\u8bf7\u586b\u5199\u5b8c\u6574\u53c2\u6570&quot;;     exit; }   if ($v_path == '\/' || $v_path == '\\') {     $v_path = ''; } else {     mkFolder($v_path);     $v_path = $v_path . &quot;\/&quot;; } \/\/\u8fd9\u662f FFmpeg \u5904\u7406\u547d\u4ee4\u5927\u5bb6\u81ea\u884c\u66f4\u6539 exec(&quot;ffmpeg -i $v_name -c copy -map 0 -f segment -segment_list &quot; . $v_path . &quot;playlist.m3u8 -segment_time $s &quot; . $v_path . &quot;player%03d.ts&quot;);   $m = file_get_contents('.\/' . $v_path . 'playlist.m3u8');   preg_match_all('\/player(.*?).ts\/', $m, $arr);   foreach ($arr[1] as $key =&gt; $value) {     echo &quot;\u5904\u7406\u7b2c&quot; . $value . '\u4e2a\u5207\u7247' . &quot;n&quot;;     $ali = upload('.\/' . $v_path . 'player' . $value . '.ts');     $m = str_replace('player' . $value . '.ts', $ali, $m);     file_put_contents('.\/' . $v_path . 'play.m3u8', $m); }   echo &quot;\u5904\u7406\u5b8c\u6bd5&quot; . &quot;n&quot;; echo &quot;\u64ad\u653e\u94fe\u63a5\u4e3a\uff1a\/&quot; . $v_path . 'play.m3u8';   function upload($file) {     $post['file'] = file_path($file);     $post['scene'] = 'aeMessageCenterV2ImageRule';     $post['name'] = 'player.jpg';     $rel = get_curl('https:\/\/kfupload.alibaba.com\/mupload', $post, 'iAliexpress\/6.22.1 (iPhone; iOS 12.1.2; Scale\/2.00)');     $rel = json_decode($rel, true);       return $rel['url']; }   function get_curl($url, $post = 0, $ua = 0) {     $ch = curl_init();     curl_setopt($ch, CURLOPT_URL, $url);     \/\/ \u4e0d\u9a8c\u8bc1\u8bc1\u4e66     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);     \/\/ \u6700\u5927\u6267\u884c\u65f6\u95f4     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);     curl_setopt($ch, CURLOPT_TIMEOUT, 120);     $httpheader[] = &quot;Accept:application\/json&quot;;     $httpheader[] = &quot;Accept-Encoding:gzip,deflate,sdch&quot;;     $httpheader[] = &quot;Accept-Language:zh-CN,zh;q=0.8&quot;;     $httpheader[] = &quot;Connection:close&quot;;     $ip = mt_rand(48, 140) . &quot;.&quot; . mt_rand(10, 240) . &quot;.&quot; . mt_rand(10, 240) . &quot;.&quot; . mt_rand(10, 240); \/\/\u968f\u673a ip     $httpheader[] = 'CLIENT-IP:' . $ip;     $httpheader[] = 'X-FORWARDED-FOR:' . $ip;     curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);     if ($post) {         curl_setopt($ch, CURLOPT_POST, 1);         curl_setopt($ch, CURLOPT_POSTFIELDS, $post);     }       if ($ua) {         curl_setopt($ch, CURLOPT_USERAGENT, $ua);     } else {         curl_setopt($ch, CURLOPT_USERAGENT, &quot;Mozilla\/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build\/IMM76D) AppleWebKit\/534.30 (KHTML, like Gecko) Version\/4.0&quot;);     }     curl_setopt($ch, CURLOPT_ENCODING, &quot;gzip&quot;);     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);     $ret = curl_exec($ch);     curl_close($ch);     return $ret; } function mkFolder($path) {     if (!is_readable($path)) {         is_file($path) or mkdir($path, 0700);     } } function file_path($file) {     if (class_exists('CURLFile')) {         return $post['file'] = new CURLFile(realpath($file));     } else {         return $post['file'] = '@' . realpath($file);     } }<\/code><\/pre>\n<p>\u628a\u8fd9\u4e2a\u53e6\u5b58\u4e3a m3u8.php(\u4ec0\u4e48\u540d\u90fd\u6210!\u8fd9\u4e2a\u5c31\u968f\u4fbf\u547d\u540d\u4e00\u4e0b)<br \/>\u8fd0\u884c\u547d\u4ee4:<br \/><code>php m3u8.php \u89c6\u9891\u7684\u50a8\u5b58\u8def\u5f84 \u89c6\u9891\u5b8c\u6574\u8def\u5f84<\/code><br \/>\u5982:<br \/><code>php m3u8.php mp4 wwwroot\/test\/test.mp4<\/code><\/p>\n<pre><code>\u6ce8\u610f:\u8fd9\u4e2a\u63a5\u53e3\u53ea\u80fd\u4e0a\u6b21\u5c0f\u4e8e 5MB \u4e00\u4e0b\u7684\u56fe\u7247(\u89c6\u9891\u5207\u7247)\u6240\u4ee5\u5207\u7247\u5b8c\u6587\u4ef6\u5927\u5c0f\u5fc5\u987b\u5c0f\u4e8e 5MB,\u8fd8\u6709\u5c31\u662f PHP \u672c\u8eab\u5c31\u4e0d\u9002\u5408\u5199\u811a\u672c,\u5355\u7ebf\u7a0b\u5904\u7406,\u5f88\u6162.\u5efa\u8bae\u7528 PY \u6216\u8005 java(\u6211\u4e0d\u4f1a,\u5e0c\u671b\u6709\u5927\u4f6c\u5199\u4e00\u4e0b),\u5176\u4ed6\u7684\u81ea\u5df1\u770b\u4ee3\u7801\u5c31\u80fd\u61c2,\u5176\u5b9e\u6ca1\u5565.<\/code><\/pre>\n<div style=\"padding: 10px 0; margin: 20px auto; width: 100%; font-size:16px; text-align: center;\">      <button disable=\"enable\" onclick=\"var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}\">          <span>\u6253\u8d4f<\/span><\/button>      <\/p>\n<div style=\"display: none;\">\n<div style=\"display: inline-block\">              <a rel=\"group\">                  <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/20200204_5e38e784c074c.jpg\" alt=\"\u89c6\u9891\u5b8c\u7f8e\u5207\u7247\u5b58\u50a8\u65b9\u6848 \u9644\u81ea\u52a8\u5316\u5904\u7406\u811a\u672c\u3010\u8f6c\u8f7d\u3011 - VPS\u8d44\u8baf\"><\/a>              <\/p>\n<p>\u5fae\u4fe1\u6253\u8d4f<\/p>\n<\/p><\/div>\n<div style=\"display: inline-block\">              <a rel=\"group\">                  <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/20200204_5e38e78850651.jpg\" alt=\"\u89c6\u9891\u5b8c\u7f8e\u5207\u7247\u5b58\u50a8\u65b9\u6848 \u9644\u81ea\u52a8\u5316\u5904\u7406\u811a\u672c\u3010\u8f6c\u8f7d\u3011 - VPS\u8d44\u8baf\"><\/a>              <\/p>\n<p>\u652f\u4ed8\u5b9d\u6253\u8d4f<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\u81ea blog.kieng.cn&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/17749"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17749"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/17749\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17749"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}