Fix minori

This commit is contained in:
loviuz 2022-01-09 01:15:58 +01:00
parent e738367072
commit 6e7ce81d91
2 changed files with 5 additions and 2 deletions

View File

@ -28,6 +28,9 @@ foreach ($scraper->results as $url => $scraped_obj) {
$client->request('GET', $url);
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() );
}
}
}

View File

@ -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;