From ce844d5068f2ec0beee043b16288a39ab8d526af Mon Sep 17 00:00:00 2001 From: Arjix <53124886+ArjixWasTaken@users.noreply.github.com> Date: Sun, 26 Sep 2021 23:22:42 +0300 Subject: [PATCH] wcostream - parsing qualities from m3u8 --- .../cloudstream3/extractors/WcoStream.kt | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt index c7bb5ab7..d2f04505 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt @@ -41,16 +41,31 @@ class WcoStream : ExtractorApi() { if (mapped.success) { mapped.media.sources.forEach { - sources.add( - ExtractorLink( - name, - name + if (it.label != null) "- ${it.label}" else "", - it.file, - "", - Qualities.P720.value, - it.file.contains(".m3u8") + if (it.file.contains("m3u8")) { + hlsHelper.m3u8Generation(M3u8Helper.M3u8Stream(it.file, null)).forEach { stream -> + sources.add( + ExtractorLink( + name, + name + if (stream.quality != null) " - ${stream.quality}" else "", + stream.streamUrl, + "", + getQualityFromName(stream.quality.toString()), + true + ) + ) + } + } else { + sources.add( + ExtractorLink( + name, + name + if (it.label != null) " - ${it.label}" else "", + it.file, + "", + Qualities.P720.value, + false + ) ) - ) + } } } return sources