|  | @@ -119,8 +119,13 @@ public class FileUtils {
 | 
											
												
													
														|  |          if (useUa) {
 |  |          if (useUa) {
 | 
											
												
													
														|  |              conn.setRequestProperty("User-Agent", FakeUserAgent.getRandomUserAgent());
 |  |              conn.setRequestProperty("User-Agent", FakeUserAgent.getRandomUserAgent());
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        if (conn.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        int code = conn.getResponseCode();
 | 
											
												
													
														|  | 
 |  | +        if (code == HttpURLConnection.HTTP_FORBIDDEN) {
 | 
											
												
													
														|  |              throw new CommonException(ExceptionEnum.URL_FORBIDDEN);
 |  |              throw new CommonException(ExceptionEnum.URL_FORBIDDEN);
 | 
											
												
													
														|  | 
 |  | +        } else if (code == HttpURLConnection.HTTP_MOVED_PERM || code == HttpURLConnection.HTTP_MOVED_TEMP) {
 | 
											
												
													
														|  | 
 |  | +            fileUrl = conn.getHeaderField("Location");
 | 
											
												
													
														|  | 
 |  | +            download(fileUrl, filePath, useUa, false, null);
 | 
											
												
													
														|  | 
 |  | +            return;
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          conn.setConnectTimeout(5000);
 |  |          conn.setConnectTimeout(5000);
 | 
											
												
													
														|  |          conn.setReadTimeout(5000);
 |  |          conn.setReadTimeout(5000);
 | 
											
										
											
												
													
														|  | @@ -195,7 +200,7 @@ public class FileUtils {
 | 
											
												
													
														|  |      public static void main(String[] args) throws Exception {
 |  |      public static void main(String[] args) throws Exception {
 | 
											
												
													
														|  |          // try {
 |  |          // try {
 | 
											
												
													
														|  |          System.out.println("https://api-hl.huoshan.com/hotsoon/item/video/_source/?video_id=v0300fg10000ckmbrbbc77uc3nq19840&line=0&app_id=0&vquality=normal&watermark=0&long_video=0&sf=4&ts=1697528496&item_id=7290410334844718376".replace("https://api-hl.huoshan.com", "http://api-hl.huoshan.com"));
 |  |          System.out.println("https://api-hl.huoshan.com/hotsoon/item/video/_source/?video_id=v0300fg10000ckmbrbbc77uc3nq19840&line=0&app_id=0&vquality=normal&watermark=0&long_video=0&sf=4&ts=1697528496&item_id=7290410334844718376".replace("https://api-hl.huoshan.com", "http://api-hl.huoshan.com"));
 | 
											
												
													
														|  | -        download("http://api-hl.huoshan.com/hotsoon/item/video/_source/?video_id=v0d00fg10000ckjb1bbc77u340cpgelg&line=0&app_id=0&vquality=normal&watermark=0&long_video=0&sf=4&ts=1697529427&item_id=7288707446217002255", "/Users/dingyunpeng/Downloads/" + System.currentTimeMillis(), true);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        download("https://cdn-xalbum.xiaoniangao.cn/653386010000014c61302281?Expires=1704038400&OSSAccessKeyId=LTAI5tB7cRkYiqHcTdkVprwb&Signature=fvzTLq/lmPJirVzwzrBLJv58ZEI%3D", "/Users/luojunhui/Downloads/" + System.currentTimeMillis() + ".mp4", true);
 | 
											
												
													
														|  |          //
 |  |          //
 | 
											
												
													
														|  |          // } catch (Exception e) {
 |  |          // } catch (Exception e) {
 | 
											
												
													
														|  |          //     e.printStackTrace();
 |  |          //     e.printStackTrace();
 |