찾다
php教程php手册批量下载 妹子图自拍

批量下载 妹子图自拍

Jun 06, 2016 pm 07:38 PM
다운로드중복 제거그림소녀일괄웹사이트셀카반복하다

源网站图片有重复,下载后请自行去重== 无 ?phpdefine('DocumentRoot', dirname(__FILE__));function curl_file_get_contents($durl, $timeout = 5, $refer = 'http://www.baidu.com') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $durl); curl_seto

源网站图片有重复,下载后请自行去重 = =
<?php
define('DocumentRoot', dirname(__FILE__));
function curl_file_get_contents($durl, $timeout = 5, $refer = 'http://www.baidu.com') {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $durl);
    curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; QQBrowser/7.7.31732.400)');
    curl_setopt($ch, CURLOPT_REFERER, $refer);
    curl_setopt($ch, CURLOPT_COOKIE, "JYERN=0.775963805813623; jyean=1oVda1o0GzAC5tHXqcngD5XqLFNdMLIvhQh26WTfpaGLxNzqLHxnXfN1R3R0jhZ6W6JEtBAXfF0rM9It6h7NZcZmVNcaLYBjqDfgui0dALG3rIEus3VK5IeBE4yWBUgs0; WL=2; CNZZDATA2018550=cnzz_eid%3D1056381356-1417509991-%26ntime%3D1417509991");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $r = curl_exec($ch);
    curl_close($ch);
    return $r;
}

function JsJump($url, $time = 0) {
    $SleepTime = $time * 1000;
    echo '<script language="javascript">window.setTimeout("window.location=\'' . $url . '\'", ' . $time . ');</script>';
    exit();
}

function _mkdir($dir) {
    if (file_exists($dir)) {
        return true;
    }

    $u = umask(0);
    $r = @mkdir($dir, 0777);
    umask($u);
    return $r;
}

function getHtml($url){
    $page = curl_file_get_contents($url);
    return $page;
}

function downloadImg($imgUrl,$foldername = 'img'){
    $picpath = DocumentRoot.'/'.$foldername;
    _mkdir($picpath);
    $filename= basename($imgUrl);
    $img = file_get_contents($imgUrl);
    if ($img) {
        file_put_contents($picpath.'/'.$filename, $img);
        return true;
    }
    return false;
}

function findPage($html){
    preg_match('/<a class=\"next page-numbers\" href=\"http:\/\/www.mzitu.com\/share\/comment-page-(.*?)#comments\"><\/a>/is', $html,$matches);
    return $matches;
}

function findList($html){
    preg_match_all('/<p><img src=\"(.*?)\" alt=\"(.*?)\" \/><\/p>/is', $html,$matches);
    return $matches;
}

$p = isset($_GET['p'])?max(1,$_GET['p']):1;
$home = getHtml('http://www.mzitu.com/share/comment-page-'.$p);
$list = findList($home);
echo "now downloading page ".$p."...";
if (is_array($list[1])) {
    foreach ($list[1] as $key => $value) {
        downloadImg($value);
    }
}

$page = findPage($home);
if ($page[1] AND $page[1]>$p) {
    JsJump('/mzi.php?p='.$page[1]);
}else{
    exit("finished");
}
성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
4 몇 주 전By尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SecList

SecList

SecLists는 최고의 보안 테스터의 동반자입니다. 보안 평가 시 자주 사용되는 다양한 유형의 목록을 한 곳에 모아 놓은 것입니다. SecLists는 보안 테스터에게 필요할 수 있는 모든 목록을 편리하게 제공하여 보안 테스트를 더욱 효율적이고 생산적으로 만드는 데 도움이 됩니다. 목록 유형에는 사용자 이름, 비밀번호, URL, 퍼징 페이로드, 민감한 데이터 패턴, 웹 셸 등이 포함됩니다. 테스터는 이 저장소를 새로운 테스트 시스템으로 간단히 가져올 수 있으며 필요한 모든 유형의 목록에 액세스할 수 있습니다.

PhpStorm 맥 버전

PhpStorm 맥 버전

최신(2018.2.1) 전문 PHP 통합 개발 도구

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

SublimeText3 Linux 새 버전

SublimeText3 Linux 새 버전

SublimeText3 Linux 최신 버전