fix:调整了无头浏览器的流程:需要手动调用关闭浏览器方法

fix:调整了下载文件判断,如果下载结束后文件不存在则抛异常
This commit is contained in:
2022-07-25 08:57:44 +08:00
parent c10abbe82e
commit 8661d8f3e7
10 changed files with 81 additions and 55 deletions

View File

@@ -64,6 +64,7 @@ public class Moyu extends Model {
@Override
public void onError(Exception e) {
super.onError(e);
e.printStackTrace();
downloadImage(isSend,qq);
}
});

View File

@@ -43,6 +43,8 @@ public class BaiHeHui extends Model {
} catch (Exception e) {
e.printStackTrace();
QQBotManager.getInstance().sendMessage(QQBotManager.defGroup, "百合会签到失败:" + AppTools.getExceptionString(e));
}finally {
WebClient.getInstance().quit();
}
}
}
@@ -82,9 +84,6 @@ public class BaiHeHui extends Model {
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
driver.close();
driver.quit();
}
}

View File

@@ -42,6 +42,8 @@ public class NicePT extends Model {
} catch (Exception e) {
QQBotManager.getInstance().sendMessage(QQBotManager.defGroup, "NicePT签到失败:" + AppTools.getExceptionString(e));
e.printStackTrace();
}finally {
WebClient.getInstance().quit();
}
}
}
@@ -76,10 +78,6 @@ public class NicePT extends Model {
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
driver.close();
driver.quit();
}
}
}

View File

@@ -59,6 +59,8 @@ public class Tsdm extends Model {
} catch (Exception e) {
QQBotManager.getInstance().sendMessage(QQBotManager.defGroup, "天使动漫签到失败:" + AppTools.getExceptionString(e));
e.printStackTrace();
}finally {
WebClient.getInstance().quit();
}
}
}
@@ -103,9 +105,6 @@ public class Tsdm extends Model {
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
driver.close();
driver.quit();
}
}

View File

@@ -38,6 +38,7 @@ public class ZhuZhu extends Model {
}else{
QQBotManager.getInstance().sendMessage("HiRes论坛签到失败");
}
WebClient.getInstance().quit();
}
}
@@ -69,9 +70,6 @@ public class ZhuZhu extends Model {
}
} catch (Exception e) {
return false;
}finally {
driver.close();
driver.quit();
}
return true;
}