mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
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:
parent
d1b605e987
commit
34f829234c
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'WNACG'
|
||||
extClass = '.wnacg'
|
||||
extVersionCode = 16
|
||||
extVersionCode = 17
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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 ->
|
||||
|
Loading…
Reference in New Issue
Block a user