diff --git a/app/src/main/java/com/github/catvod/utils/ProxyServer.kt b/app/src/main/java/com/github/catvod/utils/ProxyServer.kt index a11549fb..8162fee1 100644 --- a/app/src/main/java/com/github/catvod/utils/ProxyServer.kt +++ b/app/src/main/java/com/github/catvod/utils/ProxyServer.kt @@ -41,9 +41,15 @@ object ProxyServer { val headers = req.queryParams["headers"]; SpiderDebug.log("url: $url") SpiderDebug.log("headers: $headers") - url = Util.base64Decode(url) + url = String( + org.apache.commons.codec.binary.Base64().decode(url), + Charset.forName("UTF-8") + ) val header: Map = Gson().fromJson>( - Util.base64Decode(headers), MutableMap::class.java + String( + org.apache.commons.codec.binary.Base64().decode(headers), + Charset.forName("UTF-8") + ), MutableMap::class.java ) proxyAsync(url, header, req, response) } @@ -218,12 +224,18 @@ object ProxyServer { } fun buildProxyUrl(url: String, headers: Map): String { - return "http://127.0.0.1:$port/proxy?url=${Util.base64Encode(url.toByteArray(Charset.defaultCharset()))}&headers=${ - Util.base64Encode( + + return "http://127.0.0.1:$port/proxy?url=${ + org.apache.commons.codec.binary.Base64() + .encodeToString(url.toByteArray(Charset.defaultCharset())) + }&headers=${ + org.apache.commons.codec.binary.Base64().encodeToString( Json.toJson(headers).toByteArray( Charset.defaultCharset() ) ) + + }" } diff --git a/jar/custom_spider.jar b/jar/custom_spider.jar index 4046e437..8d3abd2a 100644 Binary files a/jar/custom_spider.jar and b/jar/custom_spider.jar differ diff --git a/jar/custom_spider.jar.md5 b/jar/custom_spider.jar.md5 index 6350bc46..04ff91a4 100644 --- a/jar/custom_spider.jar.md5 +++ b/jar/custom_spider.jar.md5 @@ -1 +1 @@ -a7ec699dbb3c9e127e1d1781660263f7 +49fdf9b1a3b560514c13c8ab835de5d7 diff --git a/json/test.json b/json/test.json index bd3ad4e7..ac92e446 100644 --- a/json/test.json +++ b/json/test.json @@ -1,5 +1,5 @@ { - "spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;a7ec699dbb3c9e127e1d1781660263f7", + "spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;49fdf9b1a3b560514c13c8ab835de5d7", "lives": [ { "name": "电视直播",