- Try to fix genre all VI sites (#950)

Try to fix error and update old source
This commit is contained in:
Nam Nguyễn 2019-03-21 01:37:56 +07:00 committed by Carlos
parent 5a6ff3fa78
commit 49ab09180d
8 changed files with 27 additions and 26 deletions

View File

@ -2,10 +2,10 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
appName = 'Tachiyomi: AcademyVN'
appName = 'Tachiyomi: HocVienTruyenTranh'
pkgNameSuffix = 'vi.academyvn'
extClass = '.Academyvn'
extVersionCode = 4
extClass = '.HocVienTruyenTranh'
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -10,11 +10,11 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.*
class Academyvn : ParsedHttpSource() {
class HocVienTruyenTranh : ParsedHttpSource() {
override val name = "HocVienTruyenTranh"
override val baseUrl = "http://hocvientruyentranh.com"
override val baseUrl = "https://hocvientruyentranh.net"
override val lang = "vi"
@ -80,7 +80,7 @@ class Academyvn : ParsedHttpSource() {
val manga = SManga.create()
manga.author = infoElement.select("p:has(strong:contains(Tác giả:)) > a").first()?.text()
manga.genre = infoElement.select("p:has(strong:contains(Thể loại:)) > *:gt(0)").text()
manga.genre = infoElement.select("p:has(strong:contains(Thể loại:)) > *:gt(0)").joinToString { it.text() }
manga.description = infoElement.select("div.__description > p").text()
manga.status = infoElement.select("p:has(strong:contains(Tình trạng:))").first()?.text().orEmpty().let { parseStatus(it) }
manga.thumbnail_url = document.select("div.__left img").first()?.attr("src")

View File

@ -2,10 +2,10 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
appName = 'Tachiyomi: Blogtruyen'
appName = 'Tachiyomi: BlogTruyen'
pkgNameSuffix = 'vi.blogtruyen'
extClass = '.Blogtruyen'
extVersionCode = 2
extClass = '.BlogTruyen'
extVersionCode = 3
libVersion = '1.2'
}

View File

@ -15,11 +15,11 @@ import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
class Blogtruyen : ParsedHttpSource() {
class BlogTruyen : ParsedHttpSource() {
override val name = "Blogtruyen"
override val name = "BlogTruyen"
override val baseUrl = "http://blogtruyen.com"
override val baseUrl = "https://blogtruyen.com"
override val lang = "vi"
@ -107,7 +107,7 @@ class Blogtruyen : ParsedHttpSource() {
val manga = SManga.create()
manga.author = infoElement.select("p:contains(Tác giả) > a").first()?.text()
manga.genre = infoElement.select("p:contains(Thể loại) > span.category > a").text()
manga.genre = infoElement.select("p:contains(Thể loại) > span.category > a").joinToString { it.text() }
manga.description = document.select("div.detail > div.content").text()
manga.status = infoElement.select("p:contains(Trạng thái) > span.color-red").first()?.text().orEmpty().let { parseStatus(it) }
manga.thumbnail_url = document.select("div.thumbnail > img").first()?.attr("src")

View File

@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
ext {
appName = 'Tachiyomi: IuTruyenTranh'
pkgNameSuffix = 'vi.iutruyentranh'
extClass = '.Iutruyentranh'
extClass = '.IuTruyenTranh'
extVersionCode = 4
libVersion = '1.2'
}

View File

@ -14,11 +14,7 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
/**
* Created by Nam Nguyen on 29/4/2017.
*/
class Iutruyentranh : ParsedHttpSource() {
class IuTruyenTranh : ParsedHttpSource() {
override val name = "IuTruyenTranh"

View File

@ -2,10 +2,10 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
appName = 'Tachiyomi: TruyenTranhLh'
appName = 'Tachiyomi: TruyenTranhLH'
pkgNameSuffix = 'vi.truyentranhlh'
extClass = '.Truyentranhlh'
extVersionCode = 4
extClass = '.TruyenTranhLH'
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -9,14 +9,15 @@ import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.helper.StringUtil
import org.jsoup.nodes.Element
import java.util.*
class Truyentranhlh : HttpSource() {
class TruyenTranhLH : HttpSource() {
override val name = "TruyenTranhLH"
override val baseUrl = "http://truyentranhlh.com"
override val baseUrl = "https://truyentranhlh.net"
override val lang = "vi"
@ -112,7 +113,7 @@ class Truyentranhlh : HttpSource() {
val manga = SManga.create()
manga.author = infoElement.select("a.btn.btn-xs.btn-info").first()?.text()
manga.genre = infoElement.select("a.btn.btn-xs.btn-danger").text()
manga.genre = infoElement.select("a.btn.btn-xs.btn-danger").joinToString { it.text() }
manga.description = document.select("h3:contains(Sơ lược) + p").text()
manga.status = infoElement.select("a.btn.btn-xs.btn-success").last()?.text().orEmpty().let { parseStatus(it) }
manga.thumbnail_url = document.select("img.thumbnail").first()?.attr("src")
@ -178,7 +179,11 @@ class Truyentranhlh : HttpSource() {
val pages = mutableListOf<Page>()
var i = 0
document.select("div.chapter-content > img").forEach {
pages.add(Page(i++, "", it.attr("src")))
var url = it.attr("src")
if (StringUtil.isBlank(url)) {
url = it.attr("data-original")
}
pages.add(Page(i++, "", url))
}
return pages
}