Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ open class Odnoklassniki : ExtractorApi() {
val embedUrl = url.replace("/video/","/videoembed/")
val videoReq = app.get(embedUrl, headers=headers).text.replace("\\"", "\"").replace("\\\\", "\\")
.replace(Regex("\\\\u([0-9A-Fa-f]{4})")) { matchResult ->
Integer.parseInt(matchResult.groupValues[1], 16).toChar().toString()
matchResult.groupValues[1].toInt(16).toChar().toString()
}
val videosStr = Regex(""""videos":(\[[^]]*])""").find(videoReq)?.groupValues?.get(1) ?: throw ErrorLoadingException("Video not found")
val videos = AppUtils.tryParseJson<List<OkRuVideo>>(videosStr) ?: throw ErrorLoadingException("Video not found")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class Vidsonic() : ExtractorApi() {
.substringBefore(";")
.replace("'", "")

// (improved) Java implementation of the JavaScript code from above
// (improved) Kotlin implementation of the JavaScript code from above
val streamUrl = encodedStreamUrl
.replace("|", "")
// always two base16 digits together build one ASCII char
.chunked(2)
.map {
Integer.parseInt(it, 16).toChar()
it.toInt(16).toChar()
}
.joinToString("")
.reversed()
Expand Down