Skip to content

Commit

Permalink
improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
gechoto authored Dec 24, 2024
1 parent ec89269 commit 8f8331f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ data class PlayerResponse(

fun findUrl(itag: Int): String? {
this.streamingData?.adaptiveFormats?.find { it.itag == itag }?.let { format ->
if (format.url != null) {
return format.url
format.url?.let {
return it
}
if (format.signatureCipher != null) {
val params = parseQueryString(format.signatureCipher)
format.signatureCipher?.let { signatureCipher ->
val params = parseQueryString(signatureCipher)
val obfuscatedSignature = params["s"] ?: return null
val signatureParam = params["sp"] ?: return null
val url = params["url"]?.let { URLBuilder(it) } ?: return null
Expand Down

0 comments on commit 8f8331f

Please # to comment.