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);
|
||||
|
||||
print '[*] Downloading '.$scraped_obj['filename']."\n";
|
||||
|
||||
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 = '';
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user