zhangyong hai 4 meses
pai
achega
7f27337d78

+ 10 - 2
etl-core/src/main/java/com/tzld/crawler/etl/util/FileUtils.java

@@ -214,8 +214,16 @@ public class FileUtils {
 
     public static void downloadZFHYD(String fileUrl, String filePath, boolean useUa, boolean useProxy, Map<String, String> proxyInfo) throws Exception {
         log.info("begin download [{}] to [{}] useUa [{}] useProxy [{}] proxyInfo[{}]", fileUrl, filePath, useUa, useProxy, proxyInfo);
-        String command = String.format("ffmpeg -y -i \"%s\" -c copy -bsf:a aac_adtstoasc \"%s\"", fileUrl, filePath);
-        Process process = Runtime.getRuntime().exec(command);
+        ProcessBuilder processBuilder = new ProcessBuilder(
+                "ffmpeg",
+                "-y",
+                "-i", fileUrl,
+                "-c", "copy",
+                "-bsf:a", "aac_adtstoasc",
+                filePath
+        );
+        processBuilder.redirectErrorStream(true);
+        Process process = processBuilder.start();
         int exitCode = process.waitFor();
         if (exitCode == 0) {
             log.info("Downloaded successfully [{}] to [{}]", fileUrl, filePath);