Fix minori
This commit is contained in:
parent
e738367072
commit
6e7ce81d91
|
@ -28,6 +28,9 @@ foreach ($scraper->results as $url => $scraped_obj) {
|
||||||
$client->request('GET', $url);
|
$client->request('GET', $url);
|
||||||
|
|
||||||
print '[*] Downloading '.$scraped_obj['filename']."\n";
|
print '[*] Downloading '.$scraped_obj['filename']."\n";
|
||||||
file_put_contents( $download_dir.'/'.$scraped_obj['filename'], $client->getResponse()->getContent() );
|
|
||||||
|
if( !file_exists($download_dir.'/'.$scraped_obj['filename']) ){
|
||||||
|
file_put_contents( $download_dir.'/'.$scraped_obj['filename'], $client->getResponse()->getContent() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -101,7 +101,7 @@ class Scraper
|
||||||
$content_type = '';
|
$content_type = '';
|
||||||
|
|
||||||
if (isset($client->getResponse()->getHeaders()['content-type'][0])) {
|
if (isset($client->getResponse()->getHeaders()['content-type'][0])) {
|
||||||
$content_type = $client->getResponse()->getHeaders()['content-type'][0];
|
$content_type = explode( ';', $client->getResponse()->getHeaders()['content-type'][0] ) [0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $content_type;
|
return $content_type;
|
||||||
|
|
Loading…
Reference in New Issue