[zh-copymanga]Fix: change mainland cdn domains (#8327)
* fix: change mainland cdn domains * bump version * fix typo
This commit is contained in:
parent
d1d027fd91
commit
5d12ba6eeb
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'CopyManga'
|
||||
pkgNameSuffix = 'zh.copymanga'
|
||||
extClass = '.CopyManga'
|
||||
extVersionCode = 10
|
||||
extVersionCode = 11
|
||||
libVersion = '1.2'
|
||||
}
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -42,8 +42,8 @@ class CopyManga : ConfigurableSource, HttpSource() {
|
|||
private val popularLatestPageSize = 50 // default
|
||||
private val searchPageSize = 12 // default
|
||||
|
||||
val replaceWith277 = Regex("mirror277")
|
||||
val replaceWith77 = Regex("mirror77")
|
||||
val replaceToMirror2 = Regex("1767566263\\.rsc\\.cdn77\\.org")
|
||||
val replaceToMirror = Regex("1025857477\\.rsc\\.cdn77\\.org")
|
||||
|
||||
private val preferences: SharedPreferences by lazy {
|
||||
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||
|
@ -114,8 +114,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_tomainland, false)) {
|
||||
picture = replaceWith277.replace(picture, "mirror2")
|
||||
picture = replaceWith77.replace(picture, "mirror")
|
||||
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
|
||||
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
|
||||
}
|
||||
thumbnail_url = picture
|
||||
description = document.select("div.comicParticulars-synopsis p.intro").first().text().trim()
|
||||
|
@ -199,8 +199,8 @@ class CopyManga : ConfigurableSource, HttpSource() {
|
|||
for (i in 0 until pageArray.length()) {
|
||||
var page = pageArray.getJSONObject(i).getString("url")
|
||||
if (!preferences.getBoolean(change_cdn_tomainland, false)) {
|
||||
page = replaceWith277.replace(page, "mirror2")
|
||||
page = replaceWith77.replace(page, "mirror")
|
||||
page = replaceToMirror2.replace(page, "mirror2.mangafunc.fun")
|
||||
page = replaceToMirror.replace(page, "mirror.mangafunc.fun")
|
||||
}
|
||||
ret.add(Page(i, "", page))
|
||||
}
|
||||
|
@ -341,8 +341,8 @@ class CopyManga : ConfigurableSource, HttpSource() {
|
|||
title = _title
|
||||
var picture = obj.getString("cover")
|
||||
if (!preferences.getBoolean(change_cdn_tomainland, false)) {
|
||||
picture = replaceWith277.replace(picture, "mirror2")
|
||||
picture = replaceWith77.replace(picture, "mirror")
|
||||
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
|
||||
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
|
||||
}
|
||||
thumbnail_url = picture
|
||||
author = Array<String?>(authorArray.length()) { i -> authorArray.getJSONObject(i).getString("name") }.joinToString(", ")
|
||||
|
@ -360,8 +360,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_tomainland, false)) {
|
||||
picture = replaceWith277.replace(picture, "mirror2")
|
||||
picture = replaceWith77.replace(picture, "mirror")
|
||||
picture = replaceToMirror2.replace(picture, "mirror2.mangafunc.fun")
|
||||
picture = replaceToMirror.replace(picture, "mirror.mangafunc.fun")
|
||||
}
|
||||
manga.thumbnail_url = picture
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue