Skip to content

Conversation

@Kraptor123
Copy link
Contributor

Trailers now play in 1080P
resim

resim

@saimuelbr
Copy link
Contributor

Hey, You could use newExtractorLink to organize the qualities in a better way.

import com.lagradost.cloudstream3.utils.ExtractorLinkType
import com.lagradost.cloudstream3.utils.newExtractorLink
import com.lagradost.cloudstream3.utils.Qualities

val streamingData = jsonResponse.optJSONObject("streamingData")
val hlsUrl = streamingData?.optString("hlsManifestUrl")

    if (!hlsUrl.isNullOrBlank()) {
        callback.invoke(
            newExtractorLink(
                source = this.name,
                name = this.name,
                url = hlsUrl,
                type = ExtractorLinkType.M3U8
            ) {
                this.referer = url
                this.quality = Qualities.Unknown.value
            }
        )
    }
    } catch (e: Exception) {
        logError(e)
    }

It's my suggestion. I think it could be better this way. Ex:

20260103_16h35m47s_grim 20260103_16h35m52s_grim

@Kraptor123
Copy link
Contributor Author

Kraptor123 commented Jan 3, 2026

Hey, You could use newExtractorLink to organize the qualities in a better way.

import com.lagradost.cloudstream3.utils.ExtractorLinkType import com.lagradost.cloudstream3.utils.newExtractorLink import com.lagradost.cloudstream3.utils.Qualities

val streamingData = jsonResponse.optJSONObject("streamingData") val hlsUrl = streamingData?.optString("hlsManifestUrl")

    if (!hlsUrl.isNullOrBlank()) {
        callback.invoke(
            newExtractorLink(
                source = this.name,
                name = this.name,
                url = hlsUrl,
                type = ExtractorLinkType.M3U8
            ) {
                this.referer = url
                this.quality = Qualities.Unknown.value
            }
        )
    }
    } catch (e: Exception) {
        logError(e)
    }

It's my suggestion. I think it could be better this way. Ex:

Previously I had it configured that way, so trailer videos often played at low quality. I’ve therefore adjusted it to use the logic in the code so it automatically detects the available quality options and selects the highest one available for trailers.

@saimuelbr
Copy link
Contributor

Hey, You could use newExtractorLink to organize the qualities in a better way.
import com.lagradost.cloudstream3.utils.ExtractorLinkType import com.lagradost.cloudstream3.utils.newExtractorLink import com.lagradost.cloudstream3.utils.Qualities
val streamingData = jsonResponse.optJSONObject("streamingData") val hlsUrl = streamingData?.optString("hlsManifestUrl")

    if (!hlsUrl.isNullOrBlank()) {
        callback.invoke(
            newExtractorLink(
                source = this.name,
                name = this.name,
                url = hlsUrl,
                type = ExtractorLinkType.M3U8
            ) {
                this.referer = url
                this.quality = Qualities.Unknown.value
            }
        )
    }
    } catch (e: Exception) {
        logError(e)
    }

It's my suggestion. I think it could be better this way. Ex:

Previously I had it configured that way, so trailer videos often played at low quality. I’ve therefore adjusted it to use the logic in the code so it automatically detects the available quality options and selects the highest one available for trailers.

I understand, thank you very much anyway.

@Kraptor123
Copy link
Contributor Author

resim Langage Strings added

Copy link
Collaborator

@fire-light42 fire-light42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested, so a more detailed review may come at a later time.

it.content ?: return@mapNotNull null
)
}?.forEach(subtitleCallback)
val lines = getHls.lines()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to HlsPlaylistParser instead of manual parsing, as I couldn’t achieve the same result using M3u8Helper.

https://github.com/recloudstream/cloudstream/blob/master/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/HlsPlaylistParser.kt

@fire-light42 fire-light42 merged commit 2aaf99b into recloudstream:master Jan 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants