mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
small fix to test and m3u8
This commit is contained in:
parent
88e1719085
commit
670c613f71
2 changed files with 7 additions and 6 deletions
|
@ -24,9 +24,7 @@ class ExampleInstrumentedTest {
|
||||||
//}
|
//}
|
||||||
|
|
||||||
private fun getAllProviders(): List<MainAPI> {
|
private fun getAllProviders(): List<MainAPI> {
|
||||||
val allApis = APIHolder.apis
|
return APIHolder.allProviders //.filter { !it.usesWebView }
|
||||||
allApis.addAll(APIHolder.restrictedApis)
|
|
||||||
return allApis //.filter { !it.usesWebView }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun loadLinks(api: MainAPI, url: String?): Boolean {
|
private suspend fun loadLinks(api: MainAPI, url: String?): Boolean {
|
||||||
|
@ -113,7 +111,7 @@ class ExampleInstrumentedTest {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
val url = (load.episodes[load.episodes.keys.first()])?.first()?.url
|
val url = (load.episodes[load.episodes.keys.first()])?.first()?.data
|
||||||
validResults = loadLinks(api, url)
|
validResults = loadLinks(api, url)
|
||||||
if (!validResults) continue
|
if (!validResults) continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,10 @@ class M3u8Helper {
|
||||||
app.get(m3u8.streamUrl, headers = m3u8.headers).text
|
app.get(m3u8.streamUrl, headers = m3u8.headers).text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var hasAnyContent = false
|
||||||
for (match in QUALITY_REGEX.findAll(response)) {
|
for (match in QUALITY_REGEX.findAll(response)) {
|
||||||
|
hasAnyContent = true
|
||||||
|
|
||||||
var (quality, m3u8Link, m3u8Link2) = match.destructured
|
var (quality, m3u8Link, m3u8Link2) = match.destructured
|
||||||
if (m3u8Link.isEmpty()) m3u8Link = m3u8Link2
|
if (m3u8Link.isEmpty()) m3u8Link = m3u8Link2
|
||||||
if (absoluteExtensionDetermination(m3u8Link) == "m3u8") {
|
if (absoluteExtensionDetermination(m3u8Link) == "m3u8") {
|
||||||
|
@ -152,11 +155,11 @@ class M3u8Helper {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (returnThis) {
|
if (returnThis || !hasAnyContent) {
|
||||||
yield(
|
yield(
|
||||||
M3u8Stream(
|
M3u8Stream(
|
||||||
m3u8.streamUrl,
|
m3u8.streamUrl,
|
||||||
0,
|
Qualities.Unknown.value,
|
||||||
m3u8.headers
|
m3u8.headers
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue