Update compile_database.php

This commit is contained in:
jakani24
2024-02-17 15:47:54 +01:00
parent 667aa96d11
commit 50972b6d59

View File

@@ -35,33 +35,18 @@ function sort_hashesh($inputFile) {
fclose($handle); fclose($handle);
} }
function download_files(){ function download_files(){
$file_count=485;
} for($i=0;$i<$file_count;$i++){
$url = 'http://example.com/file.txt'; $fileNumber = sprintf('%05d', $i);
$url="https://virusshare.com/hashfiles/VirusShare_$fileNumber.md5";
// Initialize cURL session $ch = curl_init($url);
$ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$fileContents = curl_exec($ch);
// Set options file_put_contents("/var/www/html/database_srv/$fileNumber.md5", $fileContents);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); }
// Execute cURL session
$fileContents = curl_exec($ch);
// Check if the request was successful
if ($fileContents === false) {
die('Failed to download file');
} }
// Close cURL session download_files();
curl_close($ch);
// Save the downloaded file to disk
$localFilePath = 'downloaded_file.txt';
file_put_contents($localFilePath, $fileContents);
echo 'File downloaded successfully';
// Usage example: Provide the path to the input file
$inputFile = "input.txt"; $inputFile = "input.txt";
//sortWordsIntoFiles($inputFile); //sortWordsIntoFiles($inputFile);