1. <dd id="5jlnw"><center id="5jlnw"></center></dd>
    <dd id="5jlnw"><track id="5jlnw"></track></dd>

    <th id="5jlnw"></th>
    <em id="5jlnw"><acronym id="5jlnw"></acronym></em>
    1. 立即注冊 找回密碼

      QQ登錄

      只需一步,快速開(kāi)始

      php獲取優(yōu)酷土豆頁(yè)面中視頻swf播放器地址

      2018-1-16 00:23| 發(fā)布者: 豬八戒| 查看: 2366| 評論: 0

      摘要: 項目用到臨時(shí)寫(xiě)的。待完善2/* * 根據用戶(hù)提交的(swf/html)地址,獲取優(yōu)酷,土豆的swf播放地址 * */ private function _getSwf ($url = '') { if(isset($url) !empty($url)){ preg_match_all('/http://(.*?)?.( ...
      項目用到臨時(shí)寫(xiě)的。待完善
      2/*
           * 根據用戶(hù)提交的(swf/html)地址,獲取優(yōu)酷,土豆的swf播放地址
           * */
          private function _getSwf ($url = '') {
              if(isset($url) && !empty($url)){
                  preg_match_all('/http://(.*?)?.(.*?)?.com/(.*)/',$url,$types);
              }else{
                  return false;
              }
              $type = $types[2][0];
              $domain = $types[1][0];
              $isswf = strpos($types[3][0], 'v.swf') === false ? false : true;
              $method = substr($types[3][0],0,1);
      3        switch ($type){
                  case 'youku' :
                      if( $domain == 'player' ) {
                          $swf = $url;
                      }else if( $domain == 'v' ) {
                          preg_match_all('/http://v.youku.com/v_show/id_(.*)?.html/',$url,$url_array);
                          $swf = 'http://player.youku.com/player.php/sid/'.str_replace('/','',$url_array[1][0]).'/v.swf';
                      }else{
                          $swf = $url;
                      }
                      break;
                  case 'tudou' :
                      if($isswf){
                          $swf = $url;
                      }else{
                          $method = $method == 'p' ? 'v' : $method ;
                          preg_match_all('/http://www.tudou.com/(.*)?/(.*)?/',$url,$url_array);
                          $str_arr = explode('/',$url_array[1][0]);
                          $count = count($str_arr);
                          if($count == 1) {
                              $id = explode('.',$url_array[2][0])[0];
                          }else if($count == 2){
                              $id = $str_arr[1];
                          }else if($count == 3){
                              $id = $str_arr[2];
                          }
                          $swf = 'http://www.tudou.com/'.$method.'/'.$id.'/v.swf';
                      }
                      break;
                  default :
                      $swf = $url;
                      break;
              }
              return $swf;
          }

      最新評論

      相關(guān)推薦
      道勤望推介優(yōu)質(zhì)主機商
      道勤網(wǎng)推薦優(yōu)質(zhì)idc主機
      !jz_fbzt! !jz_lxwm! !jz_gfqqq!

      Powered by DaoQin! X3.4 © 2016-2063 Dao Qin & 道勤科技

      返回頂部
      色综合网站国产麻豆_国产在线精品福利尤物_两个人的视频全免费观看高清_日日干狠狠干