[¿ø¸®ÀÌÇØ]
µÎ°¡Áö °Ë»ö ±â´ÉÀÌ Á¸ÀçÇϴµ¥..
°Ë»ö1.ÀÔ·ÂÇÑ URL°Ë»öÇÏ¿© »ç¿îµå ÆÄÀϸ¸ »Ì¾Æ ¿É´Ï´Ù.
°Ë»ö2.¿¥ÆĽº»ç¿îµåÆÄÀÏ °Ë»ö ÆûÀ» ³»ºÎ¿¡ Ãß°¡ÇØ URL°Ë»öÀÌ ¾Æ´Ñ Å°¿öµå °Ë»öÀ» ÇÏ¿© »ç¿îµå ÆÄÀÏÀ» »Ì¾Æ ¿É´Ï´Ù.
°Ë»öµÈ ¸®½ºÆ®¸¦ Á÷Á¢ Ŭ¸¯ÇÏ¸é ´Ù¿î·Îµå µÇ°í "WinAmp½Ç½Ã°£µè±â"¸¦ Ŭ¸¯ÇÏ¸é °Ë»öµÈ ¸®½ºÆ®°¡ list.m3uÆÄÀÏ¿¡ ÀúÀåµÈ ÈÄ À©¾ÚÇÁ°¡ ½ÇÇàµË´Ï´Ù.
[ŽºÆ® ¹æ¹ý]
»ç¿îµåÆÄÀÏÀÌ ¸µÅ©µÈ À¥ÆäÀÌÁö¸¦ URLÆû¿¡ ³Ö¾î °Ë»öÇÏ´Â ¹æ¹ý°ú ¿¥ÆĽº»ç¿îµå°Ë»öÆû¿¡ Å°¿öµå(¿¹:ses)¸¦ ³Ö°í °Ë»öÇÏ´Â ¾ÆÁÖ ½¬¿î °Ë»ö ¹æ¹ýÀÌ ÀÖ½À´Ï´Ù.
ÆÄÀÏÀ̸§:findmp3.php
<? //À½¾ÇÆÄÀÏ °Ë»öÇÏ¿© À©¾ÚÇÁ·Î ½Ç½Ã°£ µè±â
echo "
<body>
<center>
<form method=post action=$PHP_SELF>
<input type=hidden name=ext value=ok>
À½¾ÇÆÄÀϸ¦ °Ë»öÇÏ°í ½ÍÀº À¥ÆäÀÌÁö¸¦ ÀÔ·ÂÇϼ¼¿ä.<br>
[mp3,mp2,mid,wav ÆÄÀÏ°Ë»ö Áö¿ø]<br>
URL°Ë»ö <input type=text name=url size=40> <input type=submit value=»ç¿îµå°Ë»ö> <br>
<font color=blue>¿¥ÆĽº»ç¿îµå°Ë»ö</font> <input type=text name=amurl size=30 value=''><input type=submit value=Å°¿öµå+ÆÄÀÏ°Ë»ö>
</form>
<form method=post action=./findmp3_m3u.php>
<input type=submit value=WinAmp·Î½Ç½Ã°£µè±â>
</form>
</center>
</body>
";
if( $ext == "ok" )
{
if($url){$url=$url;}
else if($amurl){$url="http://search.empas.com/search/avi.html?q=".$amurl;}
$fcontents=implode(" ",file($url));
//\nÀ¸·Î ÀúÀåµÈ ¹è¿À» ¿¬°á¹®ÀÚ¸¦ ÀÌ¿ëÇÏ¿© ÇÑ°³ÀÇ ½ºÆ®¸µº¯¼ö¿¡ ÀúÀå
//$fcontents=htmlspecialchars($fcontents);
$fcontents=explode("http://",$fcontents);
$count=1;
echo"$url ¿¡¼ °Ë»öµÈ À½¾ÇÆÄÀÏ ¸ñ·Ï";
for($i=1; $i< sizeof($fcontents); $i++)
{
if(eregi("(\.mp3)|(\.wav)|(\.mid)|(\.mp2)",$fcontents[$i]))
{
eregi("(([a-zA-Z0-9\_\-\.\/\~\@\?\=\%\&])(.+)(\.mp3|\.wav|\.mid|\.mp2))",$fcontents[$i],$memo);
if(!eregi($memo[0],$musiclist))
{
$musiclist.=$memo[0]; //Áߺ¹ ÆÄÀÏ °Ë»ç..
echo" $count <a href='http://$memo[0]'>http://$memo[0]</a> ";
//¹Ýº¹¹®¿¡ ÀÇÇØ ¹è¿$memo°¡ Çѹø¸¸ ÀúÀåµÇ°í °»½ÅµÈ´Ù.
$count++;
$mp3list.="#EXTM3U\n#EXTINF:0,http://$memo[0]\nhttp://$memo[0]\n"; //m3uÆÄÀÏ¿¡¼ »ç¿ëµÇ´Â Çü½ÄÀ¸·Î ¹Ù²Þ
}
}
}
$fp=fopen("list.m3u","w"); //list.m3u´Â findmp3.phpÆÄÀÏÀÌ À§Ä¡ÇÑ µð·ºÅ丮¿¡ »ý¼ºµÈ´Ù.
fwrite($fp,$mp3list);
fclose($fp);
echo"°Ë»öµÈ ÃÑ ÆÄÀÏ °³¼ö:".($count-1)."°³";
}
?>
µÎ¹ø° ÆÄÀÏÀ̸§:findmp3_m3u.php
<?
$myurl="http://".$SERVER_NAME."/php"; //ÀÚ½ÅÀÇ °èÁ¤ÁÖ¼Ò¸¦ ÀÔ·ÂÇÑ´Ù. list.m3u´Â findmp3.phpÆÄÀÏÀÌ À§Ä¡ÇÑ µð·ºÅ丮¿¡ »ý¼ºµÈ´Ù.
header("location:$myurl/list.m3u");
?> |
|