$_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);
最后修改:2020 年 04 月 13 日 01 : 21 PM
如果觉得我的文章对你有用,请随意赞赏