|
@@ -211,6 +211,19 @@ public class FileUtils {
|
|
|
log.info("downloaded successfully [{}] to [{}]", fileUrl, filePath);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ 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);
|
|
|
+ int exitCode = process.waitFor();
|
|
|
+ if (exitCode == 0) {
|
|
|
+ log.info("Downloaded successfully [{}] to [{}]", fileUrl, filePath);
|
|
|
+ } else {
|
|
|
+ throw new IOException("FFmpeg download failed with exit code " + exitCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static void downloadDY(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);
|
|
|
URL url = new URL(fileUrl);
|