@@ -5,12 +5,12 @@ import com.lagradost.quicknovel.MainActivity.Companion.app
5
5
import org.jsoup.Jsoup
6
6
import org.jsoup.nodes.Element
7
7
8
- class ReadNovelFullProvider : AllNovelProvider () { // todo check
8
+ /* class ReadNovelFullProvider : AllNovelProvider() { // todo check
9
9
override val mainUrl = "https://readnovelfull.com"
10
10
override val name = "ReadNovelFull"
11
11
override val ajaxUrl = "ajax/chapter-archive"
12
- }
13
- /*
12
+ }*/
13
+
14
14
class ReadNovelFullProvider : MainAPI () {
15
15
override val mainUrl = " https://readnovelfull.com"
16
16
override val name = " ReadNovelFull"
@@ -22,23 +22,20 @@ class ReadNovelFullProvider : MainAPI() {
22
22
).document
23
23
24
24
val headers = document.select(" div.col-novel-main > div.list-novel > div.row" )
25
- if (headers.size <= 0) return emptyList()
26
25
27
26
return headers.mapNotNull { h ->
28
27
val divs = h.select(" > div > div" )
29
28
val poster = divs[0 ].selectFirst(" > img" )?.attr(" src" )?.replace(" t-200x89" , " t-300x439" )
30
29
val titleHeader = divs[1 ].selectFirst(" > h3.novel-title > a" )
31
30
val href = titleHeader?.attr(" href" )
32
31
val title = titleHeader?.text()
33
- val latestChapter = divs[2].selectFirst("> a > span")?.text()
34
- SearchResponse(
35
- title ?: return@mapNotNull null,
36
- fixUrl(href ?: return@mapNotNull null),
37
- fixUrlNull(poster),
38
- null,
39
- latestChapter,
40
- this.name
41
- )
32
+ // val latestChapter = divs[2].selectFirst("> a > span")?.text()
33
+ newSearchResponse(
34
+ name = title ? : return @mapNotNull null ,
35
+ url = href ? : return @mapNotNull null
36
+ ) {
37
+ posterUrl = fixUrlNull(poster)
38
+ }
42
39
}
43
40
}
44
41
@@ -56,19 +53,15 @@ class ReadNovelFullProvider : MainAPI() {
56
53
val header = document.selectFirst(" div.col-info-desc" )
57
54
val bookInfo = header?.selectFirst(" > div.info-holder > div.books" )
58
55
val title = bookInfo?.selectFirst(" > div.desc > h3.title" )?.text()
59
- val poster = bookInfo?.selectFirst("> div.book > img")?.attr("src")
56
+
60
57
val desc = header?.selectFirst(" > div.desc" )
61
58
val rateInfo = desc?.selectFirst(" > div.rate-info" )
62
- val votes =
63
- rateInfo?.select("> div.small > em > strong > span")?.last()?.text()?.toIntOrNull()
59
+
64
60
val rate = rateInfo?.selectFirst(" > div.rate" )
65
61
66
62
val novelId = rate?.selectFirst(" > div#rating" )?.attr(" data-novel-id" )
67
63
? : throw Exception (" novelId not found" )
68
- val rating = rate.selectFirst("> input")?.attr("value")?.toFloatOrNull()?.times(100)
69
- ?.toInt()
70
64
71
- val syno = document.selectFirst("div.desc-text")?.text()
72
65
73
66
val infoMetas = desc.select(" > ul.info-meta > li" )
74
67
@@ -81,42 +74,37 @@ class ReadNovelFullProvider : MainAPI() {
81
74
return null
82
75
}
83
76
84
- val author = getData("Author:")?.selectFirst("> a")?.text()
85
- val tags = getData("Genre:")?.select("> a")?.map { it.text() }
86
- val statusText = getData("Status:")?.selectFirst("> a")?.text()
87
- val status = when (statusText) {
88
- "Ongoing" -> STATUS_ONGOING
89
- "Completed" -> STATUS_COMPLETE
90
- else -> STATUS_NULL
91
- }
92
-
93
77
val dataUrl = " $mainUrl /ajax/chapter-archive?novelId=$novelId "
94
78
val dataResponse = app.get(dataUrl)
95
79
val dataDocument =
96
80
Jsoup .parse(dataResponse.text) ? : throw ErrorLoadingException (" invalid dataDocument" )
97
81
val items =
98
82
dataDocument.select(" div.panel-body > div.row > div > ul.list-chapter > li > a" )
99
83
.mapNotNull {
100
- ChapterData(
101
- it.selectFirst("> span")?.text() ?: return@mapNotNull null,
102
- fixUrl(it.attr("href")),
103
- null,
104
- null
84
+ newChapterData(
85
+ name = it.selectFirst(" > span" )?.text() ? : return @mapNotNull null ,
86
+ url = it.attr(" href" ) ? : return @mapNotNull null ,
105
87
)
106
88
}
107
- return StreamResponse(
108
- url,
109
- title ?: throw ErrorLoadingException("No name"),
110
- items,
111
- author,
112
- poster,
113
- rating,
114
- votes,
115
- null,
116
- syno,
117
- tags,
118
- status
119
- )
89
+ return newStreamResponse(
90
+ name = title ? : throw ErrorLoadingException (" No name" ),
91
+ url = url,
92
+ data = items
93
+ ) {
94
+ author = getData(" Author:" )?.selectFirst(" > a" )?.text()
95
+ tags = getData(" Genre:" )?.select(" > a" )?.map { it.text() }
96
+ val statusText = getData(" Status:" )?.selectFirst(" > a" )?.text()
97
+ status = when (statusText) {
98
+ " Ongoing" -> STATUS_ONGOING
99
+ " Completed" -> STATUS_COMPLETE
100
+ else -> STATUS_NULL
101
+ }
102
+ synopsis = document.selectFirst(" div.desc-text" )?.text()
103
+ rating = rate.selectFirst(" > input" )?.attr(" value" )?.toFloatOrNull()?.times(100 )
104
+ ?.toInt()
105
+ peopleVoted =
106
+ rateInfo.select(" > div.small > em > strong > span" )?.last()?.text()?.toIntOrNull()
107
+ posterUrl = bookInfo.selectFirst(" > div.book > img" )?.attr(" src" )
108
+ }
120
109
}
121
110
}
122
- */
0 commit comments