Remove Mangas.pw (Mangas.in) (#9489)
* Remove Mangas.pw (Mangas.in) * Remove log
This commit is contained in:
parent
dd6472114b
commit
050fd89919
|
@ -32,7 +32,7 @@ jobs:
|
|||
},
|
||||
{
|
||||
"type": "both",
|
||||
"regex": ".*(mangago|mangafox|hq\\s*dragon|manga\\s*host|supermangas|superhentais|union\\s*mangas|yes\\s*mangas|manhuascan|heroscan|manhwahot|leitor\\.?net|manga\\s*livre|tsuki\\s*mangas|manga\\s*yabu).*",
|
||||
"regex": ".*(mangago|mangafox|hq\\s*dragon|manga\\s*host|supermangas|superhentais|union\\s*mangas|yes\\s*mangas|manhuascan|heroscan|manhwahot|leitor\\.?net|manga\\s*livre|tsuki\\s*mangas|manga\\s*yabu|mangas\\.in|mangas\\.pw).*",
|
||||
"ignoreCase": true,
|
||||
"message": "{match} will not be added back as it is too difficult to maintain. Read #3475 for more information"
|
||||
},
|
||||
|
|
|
@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.multisrc.mmrcms
|
|||
|
||||
import android.annotation.SuppressLint
|
||||
import android.net.Uri
|
||||
import android.util.Base64
|
||||
import com.github.salomonbrys.kotson.array
|
||||
import com.github.salomonbrys.kotson.bool
|
||||
import com.github.salomonbrys.kotson.get
|
||||
|
@ -25,7 +24,6 @@ import okhttp3.Request
|
|||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Element
|
||||
import rx.Observable
|
||||
import java.net.URLDecoder
|
||||
import java.text.ParseException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
@ -116,10 +114,6 @@ abstract class MMRCMS(
|
|||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
val url: Uri.Builder
|
||||
when {
|
||||
name == "Mangas.pw" -> {
|
||||
url = Uri.parse("$baseUrl/search")!!.buildUpon()
|
||||
url.appendQueryParameter("q", query)
|
||||
}
|
||||
query.isNotBlank() -> {
|
||||
url = Uri.parse("$baseUrl/search")!!.buildUpon()
|
||||
url.appendQueryParameter("query", query)
|
||||
|
@ -160,7 +154,7 @@ abstract class MMRCMS(
|
|||
return if (listOf("query", "q").any { it in response.request.url.queryParameterNames }) {
|
||||
// If a search query was specified, use search instead!
|
||||
val jsonArray = JsonParser.parseString(response.body!!.string()).let {
|
||||
if (name == "Mangas.pw") it.array else it["suggestions"].array
|
||||
it["suggestions"].array
|
||||
}
|
||||
MangasPage(
|
||||
jsonArray
|
||||
|
@ -191,8 +185,6 @@ abstract class MMRCMS(
|
|||
val mangas = document.select(latestUpdatesSelector())
|
||||
.let { elements ->
|
||||
when {
|
||||
// Mangas.pw
|
||||
elements.select("a.fa-info-circle + a").firstOrNull()?.hasText() == true -> elements.map { latestUpdatesFromElement(it, "a.fa-info-circle + a") }
|
||||
// List layout (most sources)
|
||||
elements.select("a").firstOrNull()?.hasText() == true -> elements.map { latestUpdatesFromElement(it, "a") }
|
||||
// Grid layout (e.g. MangaID)
|
||||
|
@ -371,7 +363,7 @@ abstract class MMRCMS(
|
|||
val chapter = SChapter.create()
|
||||
|
||||
try {
|
||||
val titleWrapper = if (name == "Mangas.pw") element.select("i a").last() else element.select("[class^=chapter-title-rtl]").first()
|
||||
val titleWrapper = element.select("[class^=chapter-title-rtl]").first()
|
||||
// Some websites add characters after "..-rtl" thus the need of checking classes that starts with that
|
||||
val url = titleWrapper.getElementsByTag("a")
|
||||
.first { it.attr("href").contains(urlRegex) }
|
||||
|
@ -421,12 +413,6 @@ abstract class MMRCMS(
|
|||
.mapIndexed { i, e ->
|
||||
var url = (if (e.hasAttr("data-src")) e.attr("abs:data-src") else e.attr("abs:src")).trim()
|
||||
|
||||
// Mangas.pw encodes some of their urls, decode them
|
||||
if (name.contains("Mangas.pw") && !url.contains(".")) {
|
||||
url = Base64.decode(url.substringAfter("//"), Base64.DEFAULT).toString(Charsets.UTF_8).substringBefore("=")
|
||||
url = URLDecoder.decode(url, "UTF-8")
|
||||
}
|
||||
|
||||
Page(i, response.request.url.toString(), url)
|
||||
}
|
||||
|
||||
|
@ -462,7 +448,6 @@ abstract class MMRCMS(
|
|||
*/
|
||||
override fun getFilterList(): FilterList {
|
||||
return when {
|
||||
name == "Mangas.pw" -> FilterList()
|
||||
tagMappings != emptyList<Pair<String, String>>() -> {
|
||||
FilterList(
|
||||
getInitialFilterList() + UriSelectFilter(
|
||||
|
|
|
@ -48,7 +48,6 @@ class MMRCMSSources {
|
|||
SourceData.Single("LeoManga", "https://leomanga.me", "es", overrideVersionCode = 1),
|
||||
SourceData.Single("submanga", "https://submanga.io", "es"),
|
||||
SourceData.Single("Mangadoor", "https://mangadoor.com", "es"),
|
||||
SourceData.Single("Mangas.pw", "https://mangas.in", "es", className = "MangasPw"),
|
||||
SourceData.Single("Utsukushii", "https://manga.utsukushii-bg.com", "bg"),
|
||||
SourceData.Single("Phoenix-Scans", "https://phoenix-scans.pl", "pl", className = "PhoenixScans"),
|
||||
SourceData.Single("Puzzmos", "https://puzzmos.com", "tr"),
|
||||
|
|
Loading…
Reference in New Issue