Skip to content

Commit

Permalink
UPDATE TO VERSION 0.85
Browse files Browse the repository at this point in the history
  • Loading branch information
dipoo committed Jun 18, 2017
1 parent 9379e65 commit e55c5b7
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
============
适合里站,表站未知;

百度网盘:[egdownloader0.80.exe](http://pan.baidu.com/s/1qY9Y8Cc) 下载。
百度网盘:[egdownloader0.85.exe](https://pan.baidu.com/s/1dEVzhfj) 下载。

12 changes: 6 additions & 6 deletions src/org/arong/egdownloader/model/ScriptParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -226,7 +226,7 @@ private static List<Picture> 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<String, Object> param = new HashMap<String, Object>();
param.put("htmlSource", source);
Task t = JsonUtil.json2bean(Task.class, parseJsScript(param, getCreateScriptFile(setting.getCreateTaskScriptPath())).toString());
Expand All @@ -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<String, Object> param = new HashMap<String, Object>();
param.put("htmlSource", source);
Expand Down Expand Up @@ -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<String, Object> param = new HashMap<String, Object>();
param.put("htmlSource", source);
Object result = parseJsScript(param, getCreateScriptFile(setting.getCreateTaskScriptPath()));
Expand All @@ -307,7 +307,7 @@ public static void testScript(String url, JTextArea resultArea, Setting setting,
//展示第一张图片的真实下载地址
List<Picture> 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){
Expand All @@ -322,7 +322,7 @@ public static void testScript(String url, JTextArea resultArea, Setting setting,
//展示第一张图片的真实下载地址
List<Picture> 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){
Expand Down
12 changes: 12 additions & 0 deletions src/org/arong/egdownloader/model/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("<html><font color=\"#248FB7\">[<i>" + task.getTag() + "</i> ]</font>" + subname.substring(0, 223) + " ......</html>", fontColor, font, JLabel.LEFT);
nameLabel = new AJLabel("<html><font color=\"#248FB7\">[<i>" + task.getTag() + "</i> ][" + task.getShortCreatetime() + "]</font>" + subname.substring(0, 223) + " ......</html>", fontColor, font, JLabel.LEFT);
}else{
nameLabel = new AJLabel("<html><font color=\"#248FB7\">[<i>" + task.getTag() + "</i> ]</font>" + subname + "</html>", fontColor, font, JLabel.LEFT);
nameLabel = new AJLabel("<html><font color=\"#248FB7\">[<i>" + task.getTag() + "</i> ][" + task.getShortCreatetime() + "]</font>" + subname + "</html>", fontColor, font, JLabel.LEFT);
}
if(value != null){
nameLabel.setToolTipText(task.getName());//设置鼠标移过提示
Expand Down
2 changes: 1 addition & 1 deletion src/org/arong/egdownloader/ui/table/TaskTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Object getValueAt(int rowIndex, int columnIndex) {
case 0 :
return "";
case 1 :
return (tasks.get(rowIndex).getTag() == null ? "" : "<html><font color=\"#248FB7\">[<i>" + tasks.get(rowIndex).getTag() + "</i> ]</font>") + tasks.get(rowIndex).getName() + "</html>";
return (tasks.get(rowIndex).getTag() == null ? "" : "<html><font color=\"#248FB7\">[<i>" + tasks.get(rowIndex).getTag() + "</i> ][" + tasks.get(rowIndex).getShortCreatetime() + "]</font>") + tasks.get(rowIndex).getName() + "</html>";
case 2 :
return tasks.get(rowIndex).getTotal();
case 3 :
Expand Down
1 change: 1 addition & 0 deletions src/org/arong/egdownloader/ui/work/DownloadWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() + "-读取流超时,滞后重试");
Expand Down
2 changes: 1 addition & 1 deletion src/org/arong/egdownloader/ui/work/SearchComicWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/org/arong/egdownloader/version/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";

}

0 comments on commit e55c5b7

Please sign in to comment.