|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
是一个漫画站的采集,很垃圾,也没优化速度,只是给大家做为参考,哈哈~~
漫画站地址:http://www.dmzzz.com
只要在程序里修改下要采集的漫画地址就可以了!
平台要求:PHP5
- <?php
- $url = "http://www.dmzzz.com/ComicInfo/BaDao/Dmzzz_Url.htm";
- $r = file_get_contents($url);
- preg_match_all("/href='\/ComicInfo\/BaDao\/([\d]+)\.htm'>(.+)<\/a><\/div>/isU", $r, $c);
- $count = count($c[1]);
- for($i=0;$i<=$count;$i++) {
- $url1 = "http://www.dmzzz.com/ComicInfo/BaDao/" . $c[1][$i] . ".htm";
- $r1 = file_get_contents($url1);
- preg_match_all("/Dmzzz_img_path\[([\d]+)\] = '\/comicdate2\/comicabcd\/a-d\/bd\/([\d]+)\/(.+)';/isU", $r1, $c1);
- $count1 = count($c1[3]);
- $path = "./霸刀/" . $c[2][$i] . "/";
- if(!file_exists($path)) {
- if(mkdir($path)) {
- ob_flush();
- flush();
- sleep(1);
- echo $path . " <font color="blue">建立成功</font><br>";
- } else {
- ob_flush();
- flush();
- sleep(1);
- echo $path . " <font color="red">建立失败</font><br>";
- }
- }
- for($j=0;$j<=$count1;$j++) {
- $url2 = "http://60.191.239.185/comicdate2/comicabcd/a-d/bd/" . $c1[2][$j] . "/" . $c1[3][$j];
- $r2 = file_get_contents($url2);
- $file = $path . $c1[3][$j];
- if(file_exists($file)) break;
- if(file_put_contents($file, $r2)) {
- ob_flush();
- flush();
- sleep(1);
- echo $file . " <font color="green">采集成功</font><br>";
- } else {
- ob_flush();
- flush();
- sleep(1);
- echo $file . " <font color="red">采集失败</font><br>";
- }
- }
- }
- ?>
复制代码
我记得金光是有干扰码的,所以,附上一份附件啦 |
评分
-
查看全部评分
|