Update copymanga mainlandcdn domains (#10212)

* Update build.gradle

* Add files via upload
This commit is contained in:
ppj12345 2021-12-24 21:00:10 +08:00 committed by GitHub
parent 12dd0a19d0
commit a478a446a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 13 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'CopyManga'
pkgNameSuffix = 'zh.copymanga'
extClass = '.CopyManga'
extVersionCode = 21
extVersionCode = 22
}
apply from: "$rootDir/common.gradle"

View File

@ -43,13 +43,15 @@ class CopyManga : ConfigurableSource, HttpSource() {
override val supportsLatest = true
private val popularLatestPageSize = 50 // default
private val searchPageSize = 12 // default
private val mainlandCdn1Url = "https://1767566263.rsc.cdn77.org"
private val mainlandCdn2Url = "https://1025857477.rsc.cdn77.org"
private val mainlandCdn1Url = "https://mirror277.mangafuna.xyz"
private val mainlandCdn2Url = "https://mirror77.mangafuna.xyz"
private val overseasCdn1Url = "https://mirror2.mangafunc.fun"
private val overseasCdn2Url = "https://mirror.mangafunc.fun"
val replaceToMirror2 = Regex("1767566263\\.rsc\\.cdn77\\.org")
val replaceToMirror = Regex("1025857477\\.rsc\\.cdn77\\.org")
val replaceToMirror2 = Regex("mirror277\\.mangafuna\\.xyz\\:12001")
val replaceToMirror = Regex("mirror77\\.mangafuna\\.xyz\\:12001")
// val replaceToMirror2 = Regex("1767566263\\.rsc\\.cdn77\\.org")
// val replaceToMirror = Regex("1025857477\\.rsc\\.cdn77\\.org")
private val CONNECT_PERMITS = 1
private val CONNECT_PERIOD = 2L
@ -158,8 +160,8 @@ class CopyManga : ConfigurableSource, HttpSource() {
title = _title
var picture = document.select("div.comicParticulars-title-left img").first().attr("data-src")
if (preferences.getBoolean(CHANGE_CDN_OVERSEAS, false)) {
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun:443")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun:443")
}
thumbnail_url = picture
description = document.select("div.comicParticulars-synopsis p.intro").first().text().trim()
@ -237,8 +239,8 @@ class CopyManga : ConfigurableSource, HttpSource() {
for (i in 0 until pageArray.length()) {
var page = pageArray.getJSONObject(i).getString("url")
if (preferences.getBoolean(CHANGE_CDN_OVERSEAS, false)) {
page = replaceToMirror2.replace(page, "mirror2.mangafunc.fun")
page = replaceToMirror.replace(page, "mirror.mangafunc.fun")
page = replaceToMirror2.replace(page, "mirror2.mangafunc.fun:443")
page = replaceToMirror.replace(page, "mirror.mangafunc.fun:443")
}
ret.add(Page(i, "", page))
}
@ -379,8 +381,8 @@ class CopyManga : ConfigurableSource, HttpSource() {
title = _title
var picture = obj.getString("cover")
if (preferences.getBoolean(CHANGE_CDN_OVERSEAS, false)) {
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun:443")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun:443")
}
thumbnail_url = picture
author = Array<String?>(authorArray.length()) { i -> authorArray.getJSONObject(i).getString("name") }.joinToString(", ")
@ -398,8 +400,8 @@ class CopyManga : ConfigurableSource, HttpSource() {
element.select("div.exemptComicItem-img > a > img").first().let {
var picture = it.attr("data-src")
if (preferences.getBoolean(CHANGE_CDN_OVERSEAS, false)) {
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun:443")
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun:443")
}
manga.thumbnail_url = picture
}