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
8271cbd637
commit
f60a0d37a7
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'WNACG'
|
extName = 'WNACG'
|
||||||
extClass = '.wnacg'
|
extClass = '.wnacg'
|
||||||
extVersionCode = 16
|
extVersionCode = 17
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import uy.kohesive.injekt.api.get
|
|||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import kotlin.random.Random
|
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(
|
fun getPreferencesInternal(
|
||||||
context: Context,
|
context: Context,
|
||||||
@ -71,7 +71,7 @@ class UpdateUrlInterceptor(private val preferences: SharedPreferences) : Interce
|
|||||||
|
|
||||||
val failedResponse = try {
|
val failedResponse = try {
|
||||||
val response = chain.proceed(request)
|
val response = chain.proceed(request)
|
||||||
if (response.isSuccessful) return response
|
if (response.isSuccessful && response.header("Server") != "Parking/1.0") return response
|
||||||
response.close()
|
response.close()
|
||||||
Result.success(response)
|
Result.success(response)
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
@ -119,7 +119,7 @@ class wnacg : ParsedHttpSource(), ConfigurableSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListParse(response: Response): List<Page> {
|
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 =
|
val galleryaid =
|
||||||
response.body.string()
|
response.body.string()
|
||||||
return regex.findAll(galleryaid).mapIndexedTo(ArrayList()) { index, match ->
|
return regex.findAll(galleryaid).mapIndexedTo(ArrayList()) { index, match ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user