-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
6 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
ext { | ||
extName = 'Manga Pro' | ||
extClass = '.MangaPro' | ||
themePkg = 'mangathemesia' | ||
themePkg = 'iken' | ||
baseUrl = 'https://promanga.pro' | ||
overrideVersionCode = 3 | ||
overrideVersionCode = 28 | ||
} | ||
|
||
apply from: "$rootDir/common.gradle" |
40 changes: 4 additions & 36 deletions
40
src/ar/mangapro/src/eu/kanade/tachiyomi/extension/ar/mangapro/MangaPro.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,11 @@ | ||
package eu.kanade.tachiyomi.extension.ar.mangapro | ||
|
||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia | ||
import eu.kanade.tachiyomi.source.model.Page | ||
import okhttp3.HttpUrl.Companion.toHttpUrl | ||
import org.jsoup.nodes.Document | ||
import java.text.SimpleDateFormat | ||
import java.util.Locale | ||
import eu.kanade.tachiyomi.multisrc.iken.Iken | ||
|
||
class MangaPro : MangaThemesia( | ||
class MangaPro : Iken( | ||
"Manga Pro", | ||
"https://promanga.pro", | ||
"ar", | ||
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("ar")), | ||
"https://promanga.pro", | ||
) { | ||
override val versionId = 3 | ||
|
||
override fun pageListParse(document: Document): List<Page> { | ||
return super.pageListParse(document).onEach { | ||
val httpUrl = it.imageUrl!!.toHttpUrl() | ||
|
||
if (wpImgRegex.containsMatchIn(httpUrl.host)) { | ||
it.imageUrl = StringBuilder().apply { | ||
val ssl = httpUrl.queryParameter("ssl") | ||
when (ssl) { | ||
null -> append(httpUrl.scheme) | ||
"0" -> append("http") | ||
else -> append("https") | ||
} | ||
append("://") | ||
append(httpUrl.pathSegments.joinToString("/")) | ||
val search = httpUrl.queryParameter("q") | ||
if (search != null) { | ||
append("?q=") | ||
append(search) | ||
} | ||
}.toString() | ||
} | ||
} | ||
} | ||
override val versionId = 4 | ||
} | ||
|
||
private val wpImgRegex = Regex("""i\d+\.wp\.com""") |