MMRCMS - update URLs and generator (#3678)

* MMRCMS - update URLs and generator

* Update build.gradle
This commit is contained in:
Mike 2020-07-03 01:58:56 -04:00 committed by GitHub
parent d4cae5093a
commit ddb0fbacff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 20 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'My Manga Reader CMS (Many sources)' extName = 'My Manga Reader CMS (Many sources)'
pkgNameSuffix = 'all.mmrcms' pkgNameSuffix = 'all.mmrcms'
extClass = '.MyMangaReaderCMSSources' extClass = '.MyMangaReaderCMSSources'
extVersionCode = 43 extVersionCode = 44
libVersion = '1.2' libVersion = '1.2'
} }

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,10 @@ import org.jsoup.nodes.Document
class Generator { class Generator {
init {
System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2,TLSv1.3")
}
@TargetApi(Build.VERSION_CODES.O) @TargetApi(Build.VERSION_CODES.O)
fun generate() { fun generate() {
val buffer = StringBuffer() val buffer = StringBuffer()
@ -49,15 +53,15 @@ class Generator {
parseCategories = parseCategories(advancedSearchDocument) parseCategories = parseCategories(advancedSearchDocument)
} }
val homePageDocument = getDocument(it.third)!! val homePageDocument = getDocument(it.third)
val itemUrl = getItemUrl(homePageDocument) val itemUrl = getItemUrl(homePageDocument, it.third)
var prefix = itemUrl.substringAfterLast("/").substringBeforeLast("/") var prefix = itemUrl.substringAfterLast("/").substringBeforeLast("/")
// Sometimes itemUrl is the root of the website, and thus the prefix found is the website address. // Sometimes itemUrl is the root of the website, and thus the prefix found is the website address.
// In this case, we set the default prefix as "manga". // In this case, we set the default prefix as "manga".
if (prefix.startsWith("www")) { if (prefix.startsWith("www") || prefix.startsWith("wwv")) {
prefix = "manga" prefix = "manga"
} }
@ -151,7 +155,8 @@ class Generator {
return array return array
} }
private fun getItemUrl(document: Document): String { private fun getItemUrl(document: Document?, url: String): String {
document ?: throw Exception("Couldn't get document for: $url")
return document.toString().substringAfter("showURL = \"").substringAfter("showURL=\"").substringBefore("/SELECTION\";") return document.toString().substringAfter("showURL = \"").substringAfter("showURL=\"").substringBefore("/SELECTION\";")
// Some websites like mangasyuri use javascript minifiers, and thus "showURL = " becomes "showURL="https://mangasyuri.net/manga/SELECTION"" // Some websites like mangasyuri use javascript minifiers, and thus "showURL = " becomes "showURL="https://mangasyuri.net/manga/SELECTION""
@ -220,7 +225,7 @@ class Generator {
val sources = listOf( val sources = listOf(
Triple("ar", "مانجا اون لاين", "https://onma.me"), Triple("ar", "مانجا اون لاين", "https://onma.me"),
Triple("en", "Read Comics Online", "https://readcomicsonline.ru"), Triple("en", "Read Comics Online", "https://readcomicsonline.ru"),
Triple("en", "Biamam Scans", "https://biamam.com/"), Triple("en", "Biamam Scans", "https://biamam.com"),
Triple("en", "Fallen Angels", "https://manga.fascans.com"), Triple("en", "Fallen Angels", "https://manga.fascans.com"),
Triple("en", "Mangawww Reader", "https://mangawww.club"), Triple("en", "Mangawww Reader", "https://mangawww.club"),
Triple("en", "White Cloud Pavilion", "https://www.whitecloudpavilion.com/manga/free"), Triple("en", "White Cloud Pavilion", "https://www.whitecloudpavilion.com/manga/free"),
@ -236,7 +241,7 @@ class Generator {
Triple("tr", "MangaHanta", "http://mangahanta.com"), Triple("tr", "MangaHanta", "http://mangahanta.com"),
Triple("vi", "Fallen Angels Scans", "https://truyen.fascans.com"), Triple("vi", "Fallen Angels Scans", "https://truyen.fascans.com"),
Triple("es", "LeoManga", "https://leomanga.me"), Triple("es", "LeoManga", "https://leomanga.me"),
Triple("es", "submanga", "https://submanga.li"), Triple("es", "submanga", "https://submangas.net"),
Triple("es", "Mangadoor", "https://mangadoor.com"), Triple("es", "Mangadoor", "https://mangadoor.com"),
Triple("es", "Mangas.pw", "https://mangas.in"), Triple("es", "Mangas.pw", "https://mangas.in"),
Triple("es", "Tumangaonline.co", "http://tumangaonline.uno"), Triple("es", "Tumangaonline.co", "http://tumangaonline.uno"),
@ -245,9 +250,9 @@ class Generator {
Triple("pl", "Phoenix-Scans", "https://phoenix-scans.pl"), Triple("pl", "Phoenix-Scans", "https://phoenix-scans.pl"),
Triple("ru", "Japit Comics", "https://j-comics.ru"), Triple("ru", "Japit Comics", "https://j-comics.ru"),
Triple("tr", "Puzzmos", "https://puzzmos.com"), Triple("tr", "Puzzmos", "https://puzzmos.com"),
Triple("fr", "Scan-1", "https://www.scan-1.com"), Triple("fr", "Scan-1", "https://wwv.scan-1.com"),
Triple("fr", "Lelscan-VF", "https://www.lelscan-vf.com"), Triple("fr", "Lelscan-VF", "https://www.lelscan-vf.com"),
Triple("id", "MangaSusu", "https://www.mangasusu.mobi"), Triple("id", "MangaSusu", "https://www.mangasusu.site"),
Triple("id", "Komik Manga", "https://adm.komikmanga.com"), Triple("id", "Komik Manga", "https://adm.komikmanga.com"),
Triple("ko", "Mangazuki Raws", "https://raws.mangazuki.co"), Triple("ko", "Mangazuki Raws", "https://raws.mangazuki.co"),
Triple("pt-BR", "Remangas", "https://remangas.top"), Triple("pt-BR", "Remangas", "https://remangas.top"),