diff --git a/README.md b/README.md index 842486c..510fbec 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,5 @@ ============ 适合里站,表站未知; -百度网盘:[egdownloader0.80.exe](http://pan.baidu.com/s/1qY9Y8Cc) 下载。 +百度网盘:[egdownloader0.85.exe](https://pan.baidu.com/s/1dEVzhfj) 下载。 diff --git a/src/org/arong/egdownloader/model/ScriptParser.java b/src/org/arong/egdownloader/model/ScriptParser.java index 3db26d8..6a330e3 100644 --- a/src/org/arong/egdownloader/model/ScriptParser.java +++ b/src/org/arong/egdownloader/model/ScriptParser.java @@ -183,7 +183,7 @@ public static Task buildTaskByJavaScript(Task task, Setting setting, JDialog win if(i == 0){ pictures = collectpictrues(source, setting.getCollectPictureScriptPath(), creatingWindow); }else{ - source = WebClient.getRequestUseJavaWithCookie(task.getUrl() + "?" + setting.getPageParam() + "=" + i, null, setting.getCookieInfo());//WebClient.postRequestWithCookie(task.getUrl() + "?" + setting.getPageParam() + "=" + i, setting.getCookieInfo()); + source = WebClient.getRequestUseJavaWithCookie(task.getUrl() + "?" + setting.getPageParam() + "=" + i, "UTF-8", setting.getCookieInfo());//WebClient.postRequestWithCookie(task.getUrl() + "?" + setting.getPageParam() + "=" + i, setting.getCookieInfo()); pictures.addAll(collectpictrues(source, setting.getCollectPictureScriptPath(), creatingWindow)); } }catch(Exception e){ @@ -226,7 +226,7 @@ private static List collectpictrues(String source, String scriptPath, C public static void rebuildTask(Task task, Setting setting) throws SpiderException, ScriptException, WebClientException, KeyManagementException, NoSuchAlgorithmException, IOException{ // if("".equals(task.getSubname()) || "".equals(task.getType()) || "".equals(task.getCoverUrl()) // ||"".equals(task.getSize()) || "".equals(task.getLanguage())){ - String source = WebClient.getRequestUseJavaWithCookie(task.getUrl(), null, setting.getCookieInfo()); + String source = WebClient.getRequestUseJavaWithCookie(task.getUrl(), "UTF-8", setting.getCookieInfo()); Map param = new HashMap(); param.put("htmlSource", source); Task t = JsonUtil.json2bean(Task.class, parseJsScript(param, getCreateScriptFile(setting.getCreateTaskScriptPath())).toString()); @@ -252,7 +252,7 @@ public static void rebuildTask(Task task, Setting setting) throws SpiderExceptio */ public static String getdownloadUrl(String taskName, String sourceUrl, Setting setting) throws WebClientException, KeyManagementException, NoSuchAlgorithmException, IOException{ String url = null; - String source = WebClient.getRequestUseJavaWithCookie(sourceUrl, null, setting.getCookieInfo()); + String source = WebClient.getRequestUseJavaWithCookie(sourceUrl, "UTF-8", setting.getCookieInfo()); try { Map param = new HashMap(); param.put("htmlSource", source); @@ -281,7 +281,7 @@ public static String[] search(String source, Setting setting) throws ConnectTime public static void testScript(String url, JTextArea resultArea, Setting setting, boolean create, boolean collect, boolean download){ String source; try { - source = WebClient.getRequestUseJavaWithCookie(url, null, setting.getCookieInfo()); + source = WebClient.getRequestUseJavaWithCookie(url, "UTF-8", setting.getCookieInfo()); Map param = new HashMap(); param.put("htmlSource", source); Object result = parseJsScript(param, getCreateScriptFile(setting.getCreateTaskScriptPath())); @@ -307,7 +307,7 @@ public static void testScript(String url, JTextArea resultArea, Setting setting, //展示第一张图片的真实下载地址 List pics = JsonUtil.jsonArray2beanList(Picture.class, result.toString()); if(pics != null){ - source = WebClient.getRequestUseJavaWithCookie(pics.get(0).getUrl(), null, setting.getCookieInfo()); + source = WebClient.getRequestUseJavaWithCookie(pics.get(0).getUrl(), "UTF-8", setting.getCookieInfo()); param.put("htmlSource", source); result = parseJsScript(param, getDownloadScriptFile(setting.getDownloadScriptPath())); if(result == null){ @@ -322,7 +322,7 @@ public static void testScript(String url, JTextArea resultArea, Setting setting, //展示第一张图片的真实下载地址 List pics = JsonUtil.jsonArray2beanList(Picture.class, o.toString()); if(pics != null){ - source = WebClient.getRequestUseJavaWithCookie(pics.get(0).getUrl(), null, setting.getCookieInfo()); + source = WebClient.getRequestUseJavaWithCookie(pics.get(0).getUrl(), "UTF-8", setting.getCookieInfo()); param.put("htmlSource", source); result = parseJsScript(param, getDownloadScriptFile(setting.getDownloadScriptPath())); if(result == null){ diff --git a/src/org/arong/egdownloader/model/Task.java b/src/org/arong/egdownloader/model/Task.java index 781a0fa..33bc8d5 100644 --- a/src/org/arong/egdownloader/model/Task.java +++ b/src/org/arong/egdownloader/model/Task.java @@ -54,6 +54,7 @@ public class Task { private Long byteLength = 0L; private Long oldByteLength = 0L; private String downSpeed = "";//下载速度 + private String shortCreatetime = ""; public String getDisplayName(){ return subname == null || "".equals(subname) ? name : subname; @@ -160,6 +161,14 @@ public String detatil(){ "结束索引:" + end; } + public String getShortCreatetime() { + return shortCreatetime; + } + + public void setShortCreatetime(String shortCreatetime) { + this.shortCreatetime = shortCreatetime; + } + public String getUrl() { return url; } @@ -222,6 +231,9 @@ public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { + if(createTime != null && createTime.length() > 10){ + this.shortCreatetime = createTime.substring(2, 10).replaceAll("-", "/"); + } this.createTime = createTime; } public String getCompletedTime() { diff --git a/src/org/arong/egdownloader/ui/table/TaskTableCellRenderer.java b/src/org/arong/egdownloader/ui/table/TaskTableCellRenderer.java index 40d11d8..ee84b61 100644 --- a/src/org/arong/egdownloader/ui/table/TaskTableCellRenderer.java +++ b/src/org/arong/egdownloader/ui/table/TaskTableCellRenderer.java @@ -76,9 +76,9 @@ public Component getTableCellRendererComponent(JTable table, Object value, String subname = task.getSubname().trim(); JLabel nameLabel = null; if(subname.length() > 230){ - nameLabel = new AJLabel("[" + task.getTag() + " ]" + subname.substring(0, 223) + " ......", fontColor, font, JLabel.LEFT); + nameLabel = new AJLabel("[" + task.getTag() + " ][" + task.getShortCreatetime() + "]" + subname.substring(0, 223) + " ......", fontColor, font, JLabel.LEFT); }else{ - nameLabel = new AJLabel("[" + task.getTag() + " ]" + subname + "", fontColor, font, JLabel.LEFT); + nameLabel = new AJLabel("[" + task.getTag() + " ][" + task.getShortCreatetime() + "]" + subname + "", fontColor, font, JLabel.LEFT); } if(value != null){ nameLabel.setToolTipText(task.getName());//设置鼠标移过提示 diff --git a/src/org/arong/egdownloader/ui/table/TaskTableModel.java b/src/org/arong/egdownloader/ui/table/TaskTableModel.java index 5cd42a6..7c0e363 100644 --- a/src/org/arong/egdownloader/ui/table/TaskTableModel.java +++ b/src/org/arong/egdownloader/ui/table/TaskTableModel.java @@ -37,7 +37,7 @@ public Object getValueAt(int rowIndex, int columnIndex) { case 0 : return ""; case 1 : - return (tasks.get(rowIndex).getTag() == null ? "" : "[" + tasks.get(rowIndex).getTag() + " ]") + tasks.get(rowIndex).getName() + ""; + return (tasks.get(rowIndex).getTag() == null ? "" : "[" + tasks.get(rowIndex).getTag() + " ][" + tasks.get(rowIndex).getShortCreatetime() + "]") + tasks.get(rowIndex).getName() + ""; case 2 : return tasks.get(rowIndex).getTotal(); case 3 : diff --git a/src/org/arong/egdownloader/ui/work/DownloadWorker.java b/src/org/arong/egdownloader/ui/work/DownloadWorker.java index ad7f80d..21f865c 100644 --- a/src/org/arong/egdownloader/ui/work/DownloadWorker.java +++ b/src/org/arong/egdownloader/ui/work/DownloadWorker.java @@ -154,6 +154,7 @@ protected Void doInBackground() throws Exception { setting.setLastDownloadTime(pic.getTime()); Tracker.println(DownloadWorker.class ,task.getDisplayName() + ":" + pic.getName() + "下载完成。"); success ++; + continue; }catch (SocketTimeoutException e){ //碰到异常 Tracker.println(task.getDisplayName() + ":" + pic.getName() + "-读取流超时,滞后重试"); diff --git a/src/org/arong/egdownloader/ui/work/SearchComicWorker.java b/src/org/arong/egdownloader/ui/work/SearchComicWorker.java index 1e02c72..2f4581a 100644 --- a/src/org/arong/egdownloader/ui/work/SearchComicWorker.java +++ b/src/org/arong/egdownloader/ui/work/SearchComicWorker.java @@ -30,7 +30,7 @@ public SearchComicWorker(EgDownloaderWindow mainWindow, String url, Integer curr protected Void doInBackground() throws Exception { SearchComicWindow searchComicWindow = (SearchComicWindow)this.mainWindow.searchComicWindow; try { - String source = WebClient.getRequestUseJavaWithCookie(this.url, null, mainWindow.setting.getCookieInfo()); + String source = WebClient.getRequestUseJavaWithCookie(this.url, "UTF-8", mainWindow.setting.getCookieInfo()); String[] result = ScriptParser.search(source, mainWindow.setting); if(result != null){ String json = result[1]; diff --git a/src/org/arong/egdownloader/version/Version.java b/src/org/arong/egdownloader/version/Version.java index b983bfd..a21e368 100644 --- a/src/org/arong/egdownloader/version/Version.java +++ b/src/org/arong/egdownloader/version/Version.java @@ -12,6 +12,6 @@ public final class Version { // 程序作者 public final static String AUTHOR = "dipoo"; // 程序最后修改时间 - public final static String MODIFLIED = "2016-10-27"; + public final static String MODIFLIED = "2017-06-18"; }