avoid leaking connections

This commit is contained in:
jmir1
2021-09-14 16:34:23 +02:00
parent ba000a1dd2
commit 02051fc913
4 changed files with 8 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'AnimePahe'
pkgNameSuffix = 'en.animepahe'
extClass = '.AnimePahe'
extVersionCode = 3
extVersionCode = 4
libVersion = '12'
}

View File

@ -315,7 +315,9 @@ class AnimePahe : AnimeHttpSource() {
if (tries > 19) {
throw Exception("Failed to extract the stream uri from kwik.")
}
return content?.header("location").toString()
val location = content?.header("location").toString()
content?.close()
return location
}
private fun decrypt(fullString: String, key: String, v1: Int, v2: Int): String {

View File

@ -5,7 +5,7 @@ ext {
extName = 'Gogoanime'
pkgNameSuffix = 'en.gogoanime'
extClass = '.GogoAnime'
extVersionCode = 11
extVersionCode = 12
libVersion = '12'
}

View File

@ -112,7 +112,9 @@ class GogoAnime : ParsedAnimeHttpSource() {
private fun videoUrlParse(url: String): String {
val noRedirectClient = client.newBuilder().followRedirects(false).build()
val videoUrl = noRedirectClient.newCall(GET(url)).execute().header("location")
val response = noRedirectClient.newCall(GET(url)).execute()
val videoUrl = response.header("location")
response.close()
return videoUrl ?: url
}