From 90eb12294cde7badc515fcce74b73651e76487f2 Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Mon, 9 Sep 2024 14:16:21 +0200 Subject: [PATCH] Remove A Pair Of 2+, migrate Sadscans from old multisrc (#4955) * Remove A Pair Of 2+ * move Sadscans from multisrc --- lib-multisrc/po2scans/build.gradle.kts | 9 -- .../tachiyomi/multisrc/po2scans/PO2Scans.kt | 141 ----------------- src/en/apairof2/build.gradle | 9 -- .../apairof2/res/mipmap-hdpi/ic_launcher.png | Bin 2277 -> 0 bytes .../apairof2/res/mipmap-mdpi/ic_launcher.png | Bin 1307 -> 0 bytes .../apairof2/res/mipmap-xhdpi/ic_launcher.png | Bin 2909 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher.png | Bin 5352 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher.png | Bin 7746 -> 0 bytes .../extension/en/apairof2/APairOf2.kt | 12 -- .../tr/sadscans}/AndroidManifest.xml | 6 +- src/tr/sadscans/build.gradle | 8 +- .../extension/tr/sadscans/Sadscans.kt | 143 +++++++++++++++++- .../tr/sadscans/SadscansUrlActivity.kt | 10 +- 13 files changed, 154 insertions(+), 184 deletions(-) delete mode 100644 lib-multisrc/po2scans/build.gradle.kts delete mode 100644 lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2Scans.kt delete mode 100644 src/en/apairof2/build.gradle delete mode 100644 src/en/apairof2/res/mipmap-hdpi/ic_launcher.png delete mode 100644 src/en/apairof2/res/mipmap-mdpi/ic_launcher.png delete mode 100644 src/en/apairof2/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 src/en/apairof2/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 src/en/apairof2/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 src/en/apairof2/src/eu/kanade/tachiyomi/extension/en/apairof2/APairOf2.kt rename {lib-multisrc/po2scans => src/tr/sadscans}/AndroidManifest.xml (78%) rename lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2ScansUrlActivity.kt => src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/SadscansUrlActivity.kt (75%) diff --git a/lib-multisrc/po2scans/build.gradle.kts b/lib-multisrc/po2scans/build.gradle.kts deleted file mode 100644 index cc2397918..000000000 --- a/lib-multisrc/po2scans/build.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -plugins { - id("lib-multisrc") -} - -baseVersionCode = 1 - -dependencies { - api(project(":lib:dataimage")) -} diff --git a/lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2Scans.kt b/lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2Scans.kt deleted file mode 100644 index aa8fb72ed..000000000 --- a/lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2Scans.kt +++ /dev/null @@ -1,141 +0,0 @@ -package eu.kanade.tachiyomi.multisrc.po2scans - -import eu.kanade.tachiyomi.lib.dataimage.DataImageInterceptor -import eu.kanade.tachiyomi.lib.dataimage.dataImageAsUrl -import eu.kanade.tachiyomi.network.GET -import eu.kanade.tachiyomi.source.model.FilterList -import eu.kanade.tachiyomi.source.model.MangasPage -import eu.kanade.tachiyomi.source.model.Page -import eu.kanade.tachiyomi.source.model.SChapter -import eu.kanade.tachiyomi.source.model.SManga -import eu.kanade.tachiyomi.source.online.ParsedHttpSource -import org.jsoup.nodes.Document -import org.jsoup.nodes.Element -import rx.Observable -import java.text.SimpleDateFormat -import java.util.Locale - -abstract class PO2Scans( - override val name: String, - override val baseUrl: String, - override val lang: String, - private val dateFormat: SimpleDateFormat = SimpleDateFormat("dd MMMM, yy", Locale.ENGLISH), -) : ParsedHttpSource() { - - override val supportsLatest = true - - override val client = network.cloudflareClient.newBuilder() - .addInterceptor(DataImageInterceptor()) - .build() - - override fun headersBuilder() = super.headersBuilder() - .add("Referer", "$baseUrl/") - - // popular - override fun popularMangaRequest(page: Int) = GET("$baseUrl/series", headers) - - override fun popularMangaSelector() = "div.series-list" - - override fun popularMangaFromElement(element: Element) = SManga.create().apply { - setUrlWithoutDomain(element.selectFirst("div > a")!!.absUrl("href")) - title = element.selectFirst("div > h2")!!.text() - thumbnail_url = element.selectFirst("img")?.absUrl("data-src") - } - - // TODO: add page selectors & url parameters when site have enough series for pagination - override fun popularMangaNextPageSelector() = null - - // latest - override fun latestUpdatesRequest(page: Int) = GET(baseUrl, headers) - - override fun latestUpdatesSelector() = "div.chap" - - override fun latestUpdatesFromElement(element: Element) = SManga.create().apply { - element.selectFirst("div.chap-title a")!!.let { - setUrlWithoutDomain(it.absUrl("href")) - title = it.text() - } - thumbnail_url = element.selectFirst("img")?.absUrl("data-src") - } - - override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() - - // search - override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable { - if (!query.startsWith(SLUG_SEARCH_PREFIX)) { - return super.fetchSearchManga(page, query, filters) - } - - val url = "/series/${query.substringAfter(SLUG_SEARCH_PREFIX)}" - return fetchMangaDetails(SManga.create().apply { this.url = url }) - .map { - it.url = url - MangasPage(listOf(it), false) - } - } - - override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = - GET("$baseUrl/series?search=$query", headers) - - override fun searchMangaSelector() = popularMangaSelector() - - override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element) - - override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() - - // manga details - override fun mangaDetailsParse(document: Document): SManga { - return SManga.create().apply { - title = document.selectFirst(".title")!!.text() - author = document.select(".author > span:nth-child(2)").text() - artist = author - status = document.select(".status > span:nth-child(2)").text().parseStatus() - description = document.select(".summary p").text() - thumbnail_url = document.select("div.series-image img").attr("abs:src") - } - } - - // chapter list - override fun chapterListSelector() = "div.chap" - - override fun chapterFromElement(element: Element) = SChapter.create().apply { - element.selectFirst("a")!!.let { - setUrlWithoutDomain(it.absUrl("href")) - name = it.text() - } - date_upload = parseDate(element.select("div > div > span:nth-child(2)").text()) - } - - // page list - override fun pageListParse(document: Document) = - document.select(".swiper-slide img").mapIndexed { index, img -> - Page(index, imageUrl = img.imgAttr()) - } - - override fun imageUrlParse(document: Document) = throw UnsupportedOperationException() - - private val statusOngoing = listOf("ongoing", "devam ediyor") - private val statusCompleted = listOf("complete", "tamamlandı", "bitti") - - private fun String.parseStatus(): Int { - return when (this.lowercase()) { - in statusOngoing -> SManga.ONGOING - in statusCompleted -> SManga.COMPLETED - else -> SManga.UNKNOWN - } - } - - private fun Element.imgAttr(): String = when { - hasAttr("data-pagespeed-high-res-src") -> dataImageAsUrl("data-pagespeed-high-res-src") - hasAttr("data-pagespeed-lazy-src") -> dataImageAsUrl("data-pagespeed-lazy-src") - else -> dataImageAsUrl("src") - } - - private fun parseDate(dateStr: String) = - runCatching { dateFormat.parse(dateStr)!!.time } - .getOrDefault(0L) - - companion object { - const val SLUG_SEARCH_PREFIX = "slug:" - } -} diff --git a/src/en/apairof2/build.gradle b/src/en/apairof2/build.gradle deleted file mode 100644 index caae4a711..000000000 --- a/src/en/apairof2/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -ext { - extName = 'A Pair Of 2+' - extClass = '.APairOf2' - themePkg = 'po2scans' - baseUrl = 'https://po2scans.com' - overrideVersionCode = 31 -} - -apply from: "$rootDir/common.gradle" diff --git a/src/en/apairof2/res/mipmap-hdpi/ic_launcher.png b/src/en/apairof2/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 228282d2f1b5fa0d8588e7fe0de43f76989c2f39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2277 zcmV!26U@$1a=N{;Ex*ORheTK%gp&6q&O(5jR3PQFj2yP$2d$mPY znJ?t;5WWL)#wdn>TMjJ<<**6@#&EqOvab8Z{Q>v|AGC`ySXT>$tSU!d5G@DMXf$2O z`WyJLuAo2gVS6jKN9xNK;1DF!9z?BH_e54{LGr7$eL=wX1wnY}=J2l<3L)j}zCpB{ z-M44=f=~`adv?BF{3`}*qd9!*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oGYQ4<9B`T>99tV-T;atE2nxzaQg0;w;nVTgt?LXxwN`)~JHKVgMasaSaPbj~>mt z3t3S|jvS%d+FF`Ddp14`am^{R#W9NP;it(N{|M{9g1mYFt+aq`A2?wH|?NkXD!P zt^kl$5LfPe=LdkGgtUsdae3nb^o5O!tI8V>pdc;8Rph%hfROA-arFQS!V2=;7=Q^J z(FpgXIH;_wJR&>1RDHuBD`;ph7AA! diff --git a/src/en/apairof2/res/mipmap-xhdpi/ic_launcher.png b/src/en/apairof2/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index e80a721cfb7b75fa44d3f6a05f178e34d4f658d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2909 zcmV-j3!?OiP)L-x$vSfCLKmVzP z3m4w@`RAWE0>*5=Ny%l zmH)WM9p8B4jXD69h!VJ{k*^bXvV4G+i*=~>7xMjqxU6WN#6_?*pPQE>3=o z9DD$^C_=k9PY6XTJs=vA>H~6e&e0H`dempq>PLVq@?}IuJ`_Yl3Y@Tt5y2RfolA7v z2u_zmdhQXB$a;c|5hOd4mS!Nl3&~etr7Emny${GCLl(1I`MyAR&!zefrFlROen763 z(lx|Cm%%9C8%D`?;KpF@Tt2*eQj!PwP@N}4%kX0GL>07xX-HHYP5mq&8JJvX$|0KfhA8@~MVOT72qdsw=3sc_8C zv?6e=0>RgU3b4}i0LK=$WQk$8p2G#CkO1J@S3|=H_NR{`liK>Zqe|$t9QInP;BCKmYs#A0;IvIOUX6FnaW8Ap_vX0MbIo zBgSrlomnm%U5V!&>V1H3ksoRIbVuxb9co4ZvlNJ42jIyk8*cENZAU07DhhpmVPRpX*90#C(@GIBLBb{n98Ip$5g^6lgEG7Bx+__2 z=)I3V`UuxucOBgQryYLrL?VIy{riV3y{W0GQ_{H64-T}j^?S{NZ7vM=W12?|V+O#J z?lIZ!C!99vnX)e5;-eK*Q&WT0K@OK3F_9mIii!%#1wz-N=%^D=-6u?b@E0ff6Tnyk zVEJIYpgmfma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FfVsX#8&ya26OA zMmDu zhcr{Hvv?clo^!h$Yf zy1p9&d*f0v3H-fTOET?z-iCW76tO(<@xs?D4!yWr>nElwG z_A?)(Bx?96M6OA(=U%Xv>;nyUCte~Z1U-ROnTzeRJyaVx>~%k4+Ymg}m_9Fz(x1~b zeMeeWrlgIgaWv}PqH2sF`!cl%ELg$5`9sfH;R+!$k)8o&XR^ z+d?Y$2;e(f#i1ysYDyu1wGiwDS-)L3Q&0E;VxkIM^|MYa1=W9z+OVTGm;Xie(xEJ| zETXg&2HquBkRc^jQMthv&<`8z(00&&cMMzVxY!!=|56tXVB_AHX?3j6asD?9Fw!^G KtI&BE{eJ+ClR?7( diff --git a/src/en/apairof2/src/eu/kanade/tachiyomi/extension/en/apairof2/APairOf2.kt b/src/en/apairof2/src/eu/kanade/tachiyomi/extension/en/apairof2/APairOf2.kt deleted file mode 100644 index a7fc0e2eb..000000000 --- a/src/en/apairof2/src/eu/kanade/tachiyomi/extension/en/apairof2/APairOf2.kt +++ /dev/null @@ -1,12 +0,0 @@ -package eu.kanade.tachiyomi.extension.en.apairof2 - -import eu.kanade.tachiyomi.multisrc.po2scans.PO2Scans -import eu.kanade.tachiyomi.network.interceptor.rateLimit - -class APairOf2 : PO2Scans("A Pair Of 2+", "https://po2scans.com", "en") { - override val versionId = 2 - - override val client = super.client.newBuilder() - .rateLimit(4) - .build() -} diff --git a/lib-multisrc/po2scans/AndroidManifest.xml b/src/tr/sadscans/AndroidManifest.xml similarity index 78% rename from lib-multisrc/po2scans/AndroidManifest.xml rename to src/tr/sadscans/AndroidManifest.xml index 4a90e33e8..731f3c27e 100644 --- a/lib-multisrc/po2scans/AndroidManifest.xml +++ b/src/tr/sadscans/AndroidManifest.xml @@ -3,7 +3,7 @@ @@ -14,9 +14,9 @@ + android:scheme="https" /> diff --git a/src/tr/sadscans/build.gradle b/src/tr/sadscans/build.gradle index 941a3e02d..b3b5363a6 100644 --- a/src/tr/sadscans/build.gradle +++ b/src/tr/sadscans/build.gradle @@ -1,9 +1,11 @@ ext { extName = 'Sadscans' extClass = '.Sadscans' - themePkg = 'po2scans' - baseUrl = 'https://sadscans.com' - overrideVersionCode = 0 + extVersionCode = 2 } apply from: "$rootDir/common.gradle" + +dependencies { + api(project(":lib:dataimage")) +} diff --git a/src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/Sadscans.kt b/src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/Sadscans.kt index 773e94b8b..2627416fe 100644 --- a/src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/Sadscans.kt +++ b/src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/Sadscans.kt @@ -1,5 +1,144 @@ package eu.kanade.tachiyomi.extension.tr.sadscans -import eu.kanade.tachiyomi.multisrc.po2scans.PO2Scans +import eu.kanade.tachiyomi.lib.dataimage.DataImageInterceptor +import eu.kanade.tachiyomi.lib.dataimage.dataImageAsUrl +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.MangasPage +import eu.kanade.tachiyomi.source.model.Page +import eu.kanade.tachiyomi.source.model.SChapter +import eu.kanade.tachiyomi.source.model.SManga +import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import rx.Observable +import java.text.SimpleDateFormat +import java.util.Locale -class Sadscans : PO2Scans("Sadscans", "https://sadscans.com", "tr") +class Sadscans : ParsedHttpSource() { + + override val name = "Sadscans" + + override val baseUrl = "https://sadscans.com" + + override val lang = "tr" + + private val dateFormat = SimpleDateFormat("dd MMMM, yy", Locale.ENGLISH) + + override val supportsLatest = true + + override val client = network.cloudflareClient.newBuilder() + .addInterceptor(DataImageInterceptor()) + .build() + + override fun headersBuilder() = super.headersBuilder() + .add("Referer", "$baseUrl/") + + // popular + override fun popularMangaRequest(page: Int) = GET("$baseUrl/series", headers) + + override fun popularMangaSelector() = "div.series-list" + + override fun popularMangaFromElement(element: Element) = SManga.create().apply { + setUrlWithoutDomain(element.selectFirst("div > a")!!.absUrl("href")) + title = element.selectFirst("div > h2")!!.text() + thumbnail_url = element.selectFirst("img")?.absUrl("data-src") + } + + // TODO: add page selectors & url parameters when site have enough series for pagination + override fun popularMangaNextPageSelector() = null + + // latest + override fun latestUpdatesRequest(page: Int) = GET(baseUrl, headers) + + override fun latestUpdatesSelector() = "div.chap" + + override fun latestUpdatesFromElement(element: Element) = SManga.create().apply { + element.selectFirst("div.chap-title a")!!.let { + setUrlWithoutDomain(it.absUrl("href")) + title = it.text() + } + thumbnail_url = element.selectFirst("img")?.absUrl("data-src") + } + + override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() + + // search + override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable { + if (!query.startsWith(SLUG_SEARCH_PREFIX)) { + return super.fetchSearchManga(page, query, filters) + } + + val url = "/series/${query.substringAfter(SLUG_SEARCH_PREFIX)}" + return fetchMangaDetails(SManga.create().apply { this.url = url }) + .map { + it.url = url + MangasPage(listOf(it), false) + } + } + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = + GET("$baseUrl/series?search=$query", headers) + + override fun searchMangaSelector() = popularMangaSelector() + + override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element) + + override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() + + // manga details + override fun mangaDetailsParse(document: Document): SManga { + return SManga.create().apply { + title = document.selectFirst(".title")!!.text() + author = document.select(".author > span:nth-child(2)").text() + artist = author + status = document.select(".status > span:nth-child(2)").text().parseStatus() + description = document.select(".summary p").text() + thumbnail_url = document.select("div.series-image img").attr("abs:src") + } + } + + // chapter list + override fun chapterListSelector() = "div.chap" + + override fun chapterFromElement(element: Element) = SChapter.create().apply { + element.selectFirst("a")!!.let { + setUrlWithoutDomain(it.absUrl("href")) + name = it.text() + } + date_upload = parseDate(element.select("div > div > span:nth-child(2)").text()) + } + + // page list + override fun pageListParse(document: Document) = + document.select(".swiper-slide img").mapIndexed { index, img -> + Page(index, imageUrl = img.imgAttr()) + } + + override fun imageUrlParse(document: Document) = throw UnsupportedOperationException() + + private val statusOngoing = listOf("ongoing", "devam ediyor") + private val statusCompleted = listOf("complete", "tamamlandı", "bitti") + + private fun String.parseStatus(): Int { + return when (this.lowercase()) { + in statusOngoing -> SManga.ONGOING + in statusCompleted -> SManga.COMPLETED + else -> SManga.UNKNOWN + } + } + + private fun Element.imgAttr(): String = when { + hasAttr("data-pagespeed-high-res-src") -> dataImageAsUrl("data-pagespeed-high-res-src") + hasAttr("data-pagespeed-lazy-src") -> dataImageAsUrl("data-pagespeed-lazy-src") + else -> dataImageAsUrl("src") + } + + private fun parseDate(dateStr: String) = + runCatching { dateFormat.parse(dateStr)!!.time } + .getOrDefault(0L) + + companion object { + const val SLUG_SEARCH_PREFIX = "slug:" + } +} diff --git a/lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2ScansUrlActivity.kt b/src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/SadscansUrlActivity.kt similarity index 75% rename from lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2ScansUrlActivity.kt rename to src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/SadscansUrlActivity.kt index f260ea234..beddb6052 100644 --- a/lib-multisrc/po2scans/src/eu/kanade/tachiyomi/multisrc/po2scans/PO2ScansUrlActivity.kt +++ b/src/tr/sadscans/src/eu/kanade/tachiyomi/extension/tr/sadscans/SadscansUrlActivity.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.multisrc.po2scans +package eu.kanade.tachiyomi.extension.tr.sadscans import android.app.Activity import android.content.ActivityNotFoundException @@ -7,7 +7,7 @@ import android.os.Bundle import android.util.Log import kotlin.system.exitProcess -class PO2ScansUrlActivity : Activity() { +class SadscansUrlActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val pathSegments = intent?.data?.pathSegments @@ -15,17 +15,17 @@ class PO2ScansUrlActivity : Activity() { val slug = pathSegments[1] val mainIntent = Intent().apply { action = "eu.kanade.tachiyomi.SEARCH" - putExtra("query", "${PO2Scans.SLUG_SEARCH_PREFIX}$slug") + putExtra("query", "${Sadscans.SLUG_SEARCH_PREFIX}$slug") putExtra("filter", packageName) } try { startActivity(mainIntent) } catch (e: ActivityNotFoundException) { - Log.e("PO2ScansUrlActivity", "Could not start activity", e) + Log.e("SadscansUrlActivity", "Could not start activity", e) } } else { - Log.e("PO2ScansUrlActivity", "could not parse URI from intent $intent") + Log.e("SadscansUrlActivity", "could not parse URI from intent $intent") } finish()