腾讯获取视频VID

技术文章 腾讯解析 腾讯算法 腾讯解析源码 2018-04-13
$_loc1_ = explode("/",$url);
if( strpos($url,"v.qq.com/x/cover") > 0 ){
    if( $_loc1_[6] ){
        $_loc2_ = explode(".",$_loc1_[6])[0];
        $data['vid'] = $_loc2_;
    }else{
        $_loc3_ = https_curl($url);
        preg_match("|<link rel=\"canonical\" href=\"([^(\}>)]+)\" />|",$_loc3_,$_loc4_);
        $_loc5_ = explode("/",$_loc4_[1]);
        $_loc6_ = explode(".",$_loc5_[6])[0];
        $data['vid'] = $_loc6_;
    }
}else if( strpos($url,"v.qq.com/x/page") > 0 ){
    if( $_loc1_[5] ){
        $_loc7_ = explode(".",$_loc1_[5])[0];
        $data['vid'] = $_loc7_;
    }else{
        $_loc8_ = https_curl($url);
        preg_match("|<link rel=\"canonical\" href=\"([^(\}>)]+)\" />|",$_loc8_,$_loc9_);
        $_loc10_ = explode("/",$_loc9_[1]);
        $_loc11_ = explode(".",$_loc10_[6])[0];
        $data['vid'] = $_loc11_;
    }
}
print_r($data);

2条评论

    blonde

    As the admin of this website is working, no doubt very quickly it will be renowned, due to its feature contents.

    游客 Linux 481 天前回复

      admin
      @blonde

      Thank you, Yoshikazu.

      作者 Windows7 479 天前回复