<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                如何寫一個短視頻去水印解析的接口,這里為大家提供一下思路。僅供參考! 由于平常刷皮皮蝦比較多,所以這里拿皮皮蝦做演示,其他短視頻去水印思路也大致相同。 **獲取鏈接:** 去皮皮蝦獲取視頻的分享鏈接,這一點相信大家都會。 ![](https://wx3.sinaimg.cn/large/007WUzxmly1gnxuqk9c7dj30ef0avgpw.jpg) 例如獲取到的鏈接:https://h5.pipix.com/s/hukXsy **打開鏈接:** 使用Edge瀏覽器打開我們獲取的視頻鏈接,當然你也可以選擇其他瀏覽器,使用Edge是因為他的開發者工具是中文對小白友好方便進行演示。 打開鏈接后可以看到地址欄發生了變化,說明這個鏈接進行了一次跳轉。 此時的鏈接變成了: https://h5.pipix.com/item/6706391587317881095?app\_id=1319&app=super&timestamp=1561611874&user\_id=52595782540&carrier\_region=cn&region=cn&language=zh&utm\_source=weixin **開始抓包:** 我們按下鍵盤的F12喚出開發者工具選擇網絡(Network) 選擇保留日志(Preserve log)然后刷新頁面,我們會抓到網頁所有發送的請求。 ![](https://wx1.sinaimg.cn/large/007WUzxmly1gnxuqmfhddj311g0dwdkm.jpg) **得到接口:** 按下鍵盤Ctrl+F檢索視頻標題,我們會看到一個請求鏈接。 **得到鏈接:** https://h5.pipix.com/bds/webapi/item/detail/?item\_id=6706391587317881095&source=share 雙擊或者右鍵打開這個鏈接,你會發現出現一堆JSON。(一般官方接口大都是返回JSON格式) 大家可以去:https://www.json.cn/ 格式化一下方便查看。 格式化之后我們可以按下鍵盤Ctrl+F搜索video這樣我們就得到了沒有水印的視頻鏈接。 ![](https://wx3.sinaimg.cn/large/007WUzxmly1gnxuqlejmgj312w0kvgse.jpg) ![](https://wx2.sinaimg.cn/large/007WUzxmly1gnxuqlqh9gj312w0kv7c5.jpg) 最后寫成接口思路: ~~~ // 獲取的分享鏈接 https://h5.pipix.com/s/hukXsy // 跳轉后的鏈接 https://h5.pipix.com/item/6706391587317881095?app_id=1319&app=super&timestamp=1561611874&user_id=52595782540&carrier_region=cn&region=cn&language=zh&utm_source=weixin // 我們抓到的官方接口 https://h5.pipix.com/bds/webapi/item/detail/?item_id=6706391587317881095&source=share 是不是我們獲取跳轉后的鏈接item/和?app_id中的這串數字 填寫到官方接口item_id=和&source中間就得到了無水印的視頻下載地址,省掉了中間抓包的繁瑣,有了思路后用世界上最好的語言寫出了一個接口。 ~~~ 是不是我們獲取跳轉后的鏈接item/和?app\_id中的這串數字 填寫到官方接口item\_id=和&source中間就得到了無水印的視頻下載地址,省掉了中間抓包的繁瑣,有了思路后用世界上最好的語言寫出了一個接口。 **演示代碼:** ~~~ <?php header("Access-Control-Allow-Origin: *"); // 既然是接口肯定得允許跨域 $url = @$_GET['url']; // 獲取get傳過來的參數 $loc = get_headers($url, true)["location"]; // 這里我們用PHP內置函數獲取HTTP請求中重定向location的內容 也就是跳轉后的鏈接 // get_headers() 是PHP系統級函數,他返回一個包含有服務器響應一個 HTTP 請求所發送的標頭的數組。 $left = 'item/'; // 獲取 item/ 后面的內容 $right = '?app_id'; // 獲取 ?app_id 前面的內容 $id = GetBetween($loc,$left,$right); // 截取后的內容賦值給$id $data =curl('https://h5.pipix.com/bds/webapi/item/detail/?item_id='.$id); // curl請求官方接口賦值給$data $arr = json_decode($data,true); // 把JSON轉換成數組 $Json = array( "title" => $arr["data"]["item"]["video"]["text"], "cover" => $arr["data"]["item"]["origin_video_download"]["cover_image"]["url_list"]["0"]['url'], "url" => $arr["data"]["item"]["origin_video_download"]["url_list"]['0']['url'], ); $Json = json_encode($Json,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE); echo stripslashes($Json); return $Json; // 這段是截取某些內容 百度來的 function GetBetween($content,$start,$end) { $r = explode($start, $content); if (isset($r[1])) { $r = explode($end, $r[1]); return $r[0]; } return ''; } // 這段是發送curl 百度來的 function curl($url) { $con=curl_init((string)$url); curl_setopt($con,CURLOPT_HEADER,False); curl_setopt($con,CURLOPT_SSL_VERIFYPEER,False); curl_setopt($con,CURLOPT_RETURNTRANSFER,true); curl_setopt($con,CURLOPT_TIMEOUT,5000); $result = curl_exec($con); return $result; } ?> ~~~ **測試請求:** ~~~ 訪問鏈接你的域名/ppx?url=https://h5.pipix.com/s/hukXsy/ 就會返回如下數據 { "title":"標題交給你們了。", "cover":"https://p9-ppx.byteimg.com/img/mosaic-legacy/2ab8400068ec7576befea~272x480_q80.jpeg", "url":"http://v3-ppx.ixigua.com/35c007900ce2fabfe64f00734bfb639b/5f16f7aa/video/tos/hxsy/tos-hxsy-ve-0076/41064fc495f04f029e8629421b1352fd/?a=1319&br=1041&bt=347&cr=0&cs=0&dr=3&ds=1&er=&l=20200721211141010014043146120A948E&lr=&mime_type=video_mp4&qs=0&rc=anl4PGd0bDl4bjMzZGYzM0ApZGk1NTRpNjs5N2k4NDxnZGctYGsucWdjNDVfLS0yMS9zczMxLV82XjA0NDA0XzMuY2I6Yw%3D%3D&vl=&vr=" } ~~~ 有些其他短視頻會直接把真實地址輸出在網頁源代碼里,直接用正則匹配
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看