mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fix(subtitle): subtitle name
feat(subtitle): add hearing impaired option
This commit is contained in:
parent
1ab5236fea
commit
81742de4ef
1 changed files with 9 additions and 5 deletions
|
@ -41,7 +41,8 @@ class Addic7ed : AbstractSubApi {
|
||||||
results: MutableList<AbstractSubtitleEntities.SubtitleEntity>,
|
results: MutableList<AbstractSubtitleEntities.SubtitleEntity>,
|
||||||
name: String,
|
name: String,
|
||||||
link: String,
|
link: String,
|
||||||
headers: Map<String, String>
|
headers: Map<String, String>,
|
||||||
|
isHearingImpaired: Boolean
|
||||||
) {
|
) {
|
||||||
results.add(
|
results.add(
|
||||||
AbstractSubtitleEntities.SubtitleEntity(
|
AbstractSubtitleEntities.SubtitleEntity(
|
||||||
|
@ -54,7 +55,8 @@ class Addic7ed : AbstractSubApi {
|
||||||
epNumber = epNum,
|
epNumber = epNum,
|
||||||
seasonNumber = seasonNum,
|
seasonNumber = seasonNum,
|
||||||
year = yearNum,
|
year = yearNum,
|
||||||
headers = headers
|
headers = headers,
|
||||||
|
isHearingImpaired = isHearingImpaired
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -89,11 +91,13 @@ class Addic7ed : AbstractSubApi {
|
||||||
).document
|
).document
|
||||||
|
|
||||||
document.select(".tabel95 .tabel95 tr:contains($queryLang)").mapNotNull { node ->
|
document.select(".tabel95 .tabel95 tr:contains($queryLang)").mapNotNull { node ->
|
||||||
val name = if (seasonNum > 0) "S${seasonNum}E$epNum${
|
val name = if (seasonNum > 0) "${document.select(".titulo").text().replace("Subtitle","").trim()}${
|
||||||
node.parent()!!.select(".NewsTitle").text().substringAfter("Version").substringBefore(", Duration")
|
node.parent()!!.select(".NewsTitle").text().substringAfter("Version").substringBefore(", Duration")
|
||||||
}" else node.parent()!!.select(".NewsTitle").text()
|
}" else "${document.select(".titulo").text().replace("Subtitle","").trim()}${node.parent()!!.select(".NewsTitle").text().substringAfter("Version").substringBefore(", Duration")}"
|
||||||
val link = fixUrl(node.select("a.buttonDownload").attr("href"))
|
val link = fixUrl(node.select("a.buttonDownload").attr("href"))
|
||||||
cleanResources(results, name, link, mapOf("referer" to "$host/"))
|
val isHearingImpaired =
|
||||||
|
!node.parent()!!.select("tr:last-child [title=\"Hearing Impaired\"]").isNullOrEmpty()
|
||||||
|
cleanResources(results, name, link, mapOf("referer" to "$host/"), isHearingImpaired)
|
||||||
}
|
}
|
||||||
return results
|
return results
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue