首頁  >  文章  >  後端開發  >  http://www.12306.cn/mormhweb/k PHP音樂擷取部分程式碼

http://www.12306.cn/mormhweb/k PHP音樂擷取部分程式碼

WBOY
WBOY原創
2016-07-29 08:36:151016瀏覽

set_time_limit(0);
mysql_connect("localhost","root","");
mysql_select_Db("music_36g");
$ip='127.0.0.1';
函數 _GetIP() 
{
        $ip  = getenv("REMOTE_ADDR");
        $ip1 = getenv("HTTP_X_FORWARDED_FOR");
        $ip2 = getenv("HTTP_CLIENT_IP");
        ($ip1) ? $ip = $ip1: null;
        ($ip2) ? $ip = $ip2: null;
        返回 $ip;
}
函數 MakePassword($length=10)
{        
        $password 
        $chars = 
               報表                          "a","A","b","B","c","C","d"a","A","b","B","c","C","d"a","A","b","B","c","C"," "f","F","g","G","h","H","i","I","j","J",
               ,"l","L","m","M","n","N","o","O","p","P","q","Q"," r","R","s","S","t","T",
                     "x","X","y","Y","z","Z"
               );
    ((double); microtime ()*1000000);
        for($i = 0; $i         }
        return($password);
}
if ( _GetIP() ! )
}
for ( $i=2;$i{
        $url = "http://music.36g.net/SpecialInfo/showspecial"$url = "http://music.36g.net/SpecialInfo/showspecial" htm.$i." . ";
        $File = @fopen($url,'rb');
        if ( $File        $makeFile = $buffer ="";
                $緩衝區= 「」;
                while ($buffer = fread($File,4096))
                    $makeFile = $makeFile.$buffer;
                }
                @fclose($File);
           preg_match("/src=/uppic/(.*) width=135/",$makeFile,$pic);#圖片
              
                if ( $pic[1]!='es/Nophoto.gif' )
                    $p_url = "http://music.36g.net/uppic/".$pic[1] ;
                        $File2 = fopen($p_url,'rb');
                        if ( $File2 )
                        {
                                $Buffer2 = $makeFile2 = "";
                                while ($Buffer2 = fread ($File2,4096))
                                {
                                        $makeFile2 = $makeFile2.$Buffer2;
                                }
                                fclose($File2);
                        
                                $Filename2 = './pic/ '.$pic[1];
                                                        fwrite($Fp2,$makeFile2);      fclose($Fp2);
                        }
                }
               >                        $pic[1] = '';
    
                preg_match("/專輯:(.*)

               preg_match("/歌手:(.*) /",$makeFile,$songer); #歌手名稱
                preg_match("/(.*) /",$songer[1],$songer_name); /",$songer  preg_match(" /發行公司:(.*)/",$songer[1],$company);#發行公司
                preg_match("/發行時間:(.*) /",$makeFile,$date);#發行時間
               preg_match("/(.*)/",$date[1],$date[1],$date                preg_match("/(.*)/",$date[1],$language);#發行語言(.*)
/",$makeFile,$descript);#專輯簡介
                
                $company= addslashes($company[1]);
                      #取得歌曲ID
                (d+)&which=BakDownUrl1/",$makeFile,$id2);#歌曲ID
                $num = count($id2[11]); for ($jj=0;$jj                {         
     insert into tx_music set musicID='".$id2[1][$jj]."',specialID='$i',specialName='$name', s
                        ///echo $id2[1][$       mysql_query($sql);
                }
     br>";
                $sql = " insert into tx_special set order         echo $sql;
                mysql_query($ sql);
        }
}
?>
以上就介紹了http://www.12306.cn/mormhweb/k PHP音樂擷取部分程式碼,包括了http://www.12306.cn/mormhweb/k方面的內容,希望對PHP教學有興趣的朋友有所幫助。


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn