diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 537737c3f..59359fbc7 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -101,7 +101,7 @@ object BookHelp { downloadImages.add(src) val analyzeUrl = AnalyzeUrl(src) try { - analyzeUrl.getImageBytes(book.origin)?.let { + analyzeUrl.getResponseBytes(book.origin)?.let { FileUtils.createFileIfNotExist( downloadDir, cacheFolderName, diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 3728f4819..a226b46d6 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -48,21 +48,6 @@ object HttpHelper { return null } - fun getBytes( - url: String, - queryMap: Map, - headers: Map - ): ByteArray? { - NetworkUtils.getBaseUrl(url)?.let { baseUrl -> - return getByteRetrofit(baseUrl) - .create(HttpGetApi::class.java) - .getMapByte(url, queryMap, headers) - .execute() - .body() - } - return null - } - suspend fun simpleGetAsync(url: String, encode: String? = null): String? { NetworkUtils.getBaseUrl(url)?.let { baseUrl -> val response = getApiService(baseUrl, encode) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index b4401bd39..a4729341e 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -352,18 +352,6 @@ class AnalyzeUrl( return Res(NetworkUtils.getUrl(res), res.body()) } - fun getImageBytes(tag: String): ByteArray? { - val cookie = CookieStore.getCookie(tag) - if (cookie.isNotEmpty()) { - headerMap["Cookie"] += cookie - } - return if (fieldMap.isEmpty()) { - HttpHelper.getBytes(url, mapOf(), headerMap) - } else { - HttpHelper.getBytes(url, fieldMap, headerMap) - } - } - suspend fun getResponseBytes(tag: String? = null): ByteArray? { if (tag != null) { val cookie = CookieStore.getCookie(tag)