fix episodes without a streaming link make AoDParser crash
This commit is contained in:
parent
dfaf359952
commit
3ed55ca3c9
|
@ -235,7 +235,6 @@ object AoDParser {
|
||||||
//Log.i(javaClass.name, "New csrf token is $csrfToken")
|
//Log.i(javaClass.name, "New csrf token is $csrfToken")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val pl = res.select("input.streamstarter_html5").first()
|
val pl = res.select("input.streamstarter_html5").first()
|
||||||
val primary = pl.attr("data-playlist")
|
val primary = pl.attr("data-playlist")
|
||||||
val secondary = pl.attr("data-otherplaylist")
|
val secondary = pl.attr("data-otherplaylist")
|
||||||
|
@ -291,7 +290,7 @@ object AoDParser {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.i(javaClass.name, "Loading secondary plalyist finished")
|
Log.i(javaClass.name, "Loading secondary playlist finished")
|
||||||
|
|
||||||
// parse additional info from the media page
|
// parse additional info from the media page
|
||||||
res.select("table.vertical-table").select("tr").forEach { row ->
|
res.select("table.vertical-table").select("tr").forEach { row ->
|
||||||
|
@ -310,6 +309,8 @@ object AoDParser {
|
||||||
// parse additional information for tv shows
|
// parse additional information for tv shows
|
||||||
if (media.type == MediaType.TVSHOW) {
|
if (media.type == MediaType.TVSHOW) {
|
||||||
res.select("div.three-box-container > div.episodebox").forEach { episodebox ->
|
res.select("div.three-box-container > div.episodebox").forEach { episodebox ->
|
||||||
|
// make sure the episode has a streaming link
|
||||||
|
if (episodebox.select("input.streamstarter_html5").isNotEmpty()) {
|
||||||
val episodeId = episodebox.select("div.flip-front").attr("id").substringAfter("-").toInt()
|
val episodeId = episodebox.select("div.flip-front").attr("id").substringAfter("-").toInt()
|
||||||
val episodeShortDesc = episodebox.select("p.episodebox-shorttext").text()
|
val episodeShortDesc = episodebox.select("p.episodebox-shorttext").text()
|
||||||
val episodeWatched = episodebox.select("div.episodebox-icons > div").hasClass("status-icon-orange")
|
val episodeWatched = episodebox.select("div.episodebox-icons > div").hasClass("status-icon-orange")
|
||||||
|
@ -322,6 +323,7 @@ object AoDParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue