|
|
@ -120,7 +120,7 @@ object BookHelp { |
|
|
|
val awaitList = arrayListOf<Deferred<Unit>>() |
|
|
|
val awaitList = arrayListOf<Deferred<Unit>>() |
|
|
|
content.split("\n").forEach { |
|
|
|
content.split("\n").forEach { |
|
|
|
val matcher = AppPattern.imgPattern.matcher(it) |
|
|
|
val matcher = AppPattern.imgPattern.matcher(it) |
|
|
|
if (matcher.find()) { |
|
|
|
while (matcher.find()) { |
|
|
|
matcher.group(1)?.let { src -> |
|
|
|
matcher.group(1)?.let { src -> |
|
|
|
val mSrc = NetworkUtils.getAbsoluteURL(bookChapter.url, src) |
|
|
|
val mSrc = NetworkUtils.getAbsoluteURL(bookChapter.url, src) |
|
|
|
awaitList.add(async { |
|
|
|
awaitList.add(async { |
|
|
@ -158,7 +158,8 @@ object BookHelp { |
|
|
|
).writeBytes(it) |
|
|
|
).writeBytes(it) |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
AppLog.putDebug("${src}下载错误", e) |
|
|
|
e.printStackTrace() |
|
|
|
|
|
|
|
AppLog.put("${src}下载错误", e) |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
downloadImages.remove(src) |
|
|
|
downloadImages.remove(src) |
|
|
|
} |
|
|
|
} |
|
|
|