porque falla /* 2024-10-28 05:30:00 - Error en recalcularHash: URL inválida:…
- User
porque falla
/* 2024-10-28 05:30:00 - Error en recalcularHash: URL inválida: /home/asley01/MEGA/Waw/Kits/MEMPHIS KIT/VITAGEN HIP HOP KIT/SNARE ONE SHOT/Hip Hop Snare_fuwI_2upra.wav 2024-10-28 05:30:00 - Error en recalcularHash: URL inválida: /home/asley01/MEGA/Waw/Kits/LOFI KIT/DRUM LOOP/Lofi Drums 150_BVG9_2upra.wav 2024-10-28 05:30:00 - Error en recalcularHash: URL inválida: /home/asley01/MEGA/Waw/Kits/MEMPHIS KIT/SAMPLES MEMPHIS/dark.wav */
function recalcularHash(audio_file_path) { try { // Verificaciones iniciales if (!filter_var(audio_file_path, FILTER_VALIDATE_URL)) { throw new Exception("URL inválida: " . $audio_file_path); }
code$upload_dir = wp_upload_dir(); $file_path = str_replace($upload_dir['baseurl'], $upload_dir['basedir'], $audio_file_path); // Verificaciones de archivo if (!file_exists($file_path)) { throw new Exception("Archivo no encontrado: " . $file_path); } if (!is_readable($file_path)) { throw new Exception("No hay permisos de lectura para el archivo: " . $file_path); } // Verificar script wrapper if (!file_exists(WRAPPER_SCRIPT_PATH)) { throw new Exception("Script wrapper no encontrado en: " . WRAPPER_SCRIPT_PATH); } if (!is_executable(WRAPPER_SCRIPT_PATH)) { throw new Exception("Script wrapper no tiene permisos de ejecución: " . WRAPPER_SCRIPT_PATH); } // Ejecutar el comando $command = escapeshellarg(WRAPPER_SCRIPT_PATH) . ' ' . escapeshellarg($file_path); //guardarLog("Ejecutando comando: " . $command); $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") ); $process = proc_open($command, $descriptorspec, $pipes); if (!is_resource($process)) { throw new Exception("No se pudo iniciar el proceso"); } $output = stream_get_contents($pipes[1]); $error = stream_get_contents($pipes[2]); foreach ($pipes as $pipe) { fclose($pipe); } $return_value = proc_close($process); if ($return_value !== 0) { throw new Exception("Error en el proceso Python: " . $error); } $hash = trim($output); if (!preg_match('/^[a-f0-9]{64}$/', $hash)) { throw new Exception("Hash inválido generado: " . $output); } //guardarLog("Hash calculado correctamente: " . $hash); return $hash; } catch (Exception $e) { guardarLog("Error en recalcularHash: " . $e->getMessage()); return false; } - Assistant