http://www.12306.cn/mormhweb/k PHP音乐采集部分代码
程序员文章站
2022-04-25 14:39:45
...
set_time_limit(0);
mysql_connect("localhost","root","");
mysql_select_Db("music_36g");
$ip = '127.0.0.1';
function _GetIP()
{
$ip = getenv("REMOTE_ADDR");
$ip1 = getenv("HTTP_X_FORWARDED_FOR");
$ip2 = getenv("HTTP_CLIENT_IP");
($ip1) ? $ip = $ip1 : null ;
($ip2) ? $ip = $ip2 : null ;
return $ip;
}
function MakePassword($length=10)
{
$password = '';
$chars =
array
(
"1","2","3","4","5","6","7","8","9","0",
"a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J",
"k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T",
"u","U","v","V","w","W","x","X","y","Y","z","Z"
);
$count = count($chars) - 1;
srand((double)microtime()*1000000);
for($i = 0; $i {
$password .= $chars[rand(0, $count)];
}
return($password);
}
if ( _GetIP() != $ip )
{
exit("Can't Run!");
}
for ( $i=2;$i{
$url = "http://music.36g.net/SpecialInfo/showspecial".$i.".htm";
$File = @fopen($url,'rb');
if ( $File )
{
$makeFile = $buffer = "";
$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];
$Fp2 = fopen ($Filename2,'w+');
fwrite($Fp2,$makeFile2);
fclose($Fp2);
}
}
else
{
$pic[1] = '';
}
preg_match("/专辑:(.*)
mysql_connect("localhost","root","");
mysql_select_Db("music_36g");
$ip = '127.0.0.1';
function _GetIP()
{
$ip = getenv("REMOTE_ADDR");
$ip1 = getenv("HTTP_X_FORWARDED_FOR");
$ip2 = getenv("HTTP_CLIENT_IP");
($ip1) ? $ip = $ip1 : null ;
($ip2) ? $ip = $ip2 : null ;
return $ip;
}
function MakePassword($length=10)
{
$password = '';
$chars =
array
(
"1","2","3","4","5","6","7","8","9","0",
"a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J",
"k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T",
"u","U","v","V","w","W","x","X","y","Y","z","Z"
);
$count = count($chars) - 1;
srand((double)microtime()*1000000);
for($i = 0; $i {
$password .= $chars[rand(0, $count)];
}
return($password);
}
if ( _GetIP() != $ip )
{
exit("Can't Run!");
}
for ( $i=2;$i{
$url = "http://music.36g.net/SpecialInfo/showspecial".$i.".htm";
$File = @fopen($url,'rb');
if ( $File )
{
$makeFile = $buffer = "";
$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];
$Fp2 = fopen ($Filename2,'w+');
fwrite($Fp2,$makeFile2);
fclose($Fp2);
}
}
else
{
$pic[1] = '';
}
preg_match("/专辑:(.*)
推荐阅读
-
PHP音乐采集(部分代码)
-
PHP音乐采集(部分代码)_php技巧
-
http://www.12306.cn/mormhweb/k php相当简单的分页类
-
http://www.12306.cn/mormhweb/k php 更新数据库中断的解决方法
-
PHP音乐采集(部分代码)_PHP教程
-
http://www.12306.cn/mormhweb/k [PHP]实用函数3
-
http://www.12306.cn/mormhweb/k PHP初学入门
-
http://www.12306.cn/mormhweb/ PHP运行时强制显示出错信息的代码
-
http://www.12306.cn/mormhweb/k 深入理解PHP原理之错误抑制与内嵌HTML分析
-
PHP音乐采集(部分代码)