WNACG | Added support for ".jpeg" and fixed domain update (#6101)

* Added support for ".jpeg" and fixed domain update

* Apply stevenyomi's suggestion

* Apply suggestion

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>

---------

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
This commit is contained in:
KenjieDec 2024-11-19 21:54:37 +07:00 committed by GitHub
parent d1b605e987
commit 34f829234c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'WNACG'
extClass = '.wnacg'
extVersionCode = 16
extVersionCode = 17
isNsfw = true
}

View File

@ -12,7 +12,7 @@ import uy.kohesive.injekt.api.get
import java.io.IOException
import kotlin.random.Random
private const val DEFAULT_LIST = "https://www.hm08.lol,https://www.hm09.lol,https://www.hm10.lol,https://www.hm06.lol,https://www.hm07.lol,https://www.hm05.lol,https://www.hm04.lol,https://www.hm01.lol,https://www.hm02.lol,https://www.hm03.lol,https://www.hm1.lol,https://www.hm2.lol,https://www.hm3.lol"
private const val DEFAULT_LIST = "https://www.wn01.uk,https://www.wn05.cc,https://www.wn04.cc,https://www.wn03.cc"
fun getPreferencesInternal(
context: Context,
@ -71,7 +71,7 @@ class UpdateUrlInterceptor(private val preferences: SharedPreferences) : Interce
val failedResponse = try {
val response = chain.proceed(request)
if (response.isSuccessful) return response
if (response.isSuccessful && response.header("Server") != "Parking/1.0") return response
response.close()
Result.success(response)
} catch (e: Throwable) {

View File

@ -119,7 +119,7 @@ class wnacg : ParsedHttpSource(), ConfigurableSource {
}
override fun pageListParse(response: Response): List<Page> {
val regex = """//\S*(jpg|png|webp|gif)""".toRegex()
val regex = """//\S*(jpeg|jpg|png|webp|gif)""".toRegex()
val galleryaid =
response.body.string()
return regex.findAll(galleryaid).mapIndexedTo(ArrayList()) { index, match ->