Fix incorrect thumbnail url and song metadata inference

This commit is contained in:
vfsfitvnm
2022-06-16 15:25:14 +02:00
parent abf2be6c9a
commit 6dbc57aa53
9 changed files with 64 additions and 21 deletions

View File

@@ -56,10 +56,8 @@ data class NavigationEndpoint(
val endpoint: Endpoint?
get() = watchEndpoint ?: browseEndpoint ?: watchPlaylistEndpoint ?: searchEndpoint
@Serializable
sealed class Endpoint {
@Serializable
data class Watch(
val params: String? = null,
@@ -69,6 +67,10 @@ data class NavigationEndpoint(
val playlistSetVideoId: String? = null,
val watchEndpointMusicSupportedConfigs: WatchEndpointMusicSupportedConfigs? = null,
) : Endpoint() {
val type: String?
get() = watchEndpointMusicSupportedConfigs
?.watchEndpointMusicConfig
?.musicVideoType
@Serializable
data class WatchEndpointMusicSupportedConfigs(
@@ -82,7 +84,6 @@ data class NavigationEndpoint(
}
}
@Serializable
data class WatchPlaylist(
val params: String?,
@@ -96,6 +97,10 @@ data class NavigationEndpoint(
val browseId: String,
val browseEndpointContextSupportedConfigs: BrowseEndpointContextSupportedConfigs?,
) : Endpoint() {
val type: String?
get() = browseEndpointContextSupportedConfigs
?.browseEndpointContextMusicConfig
?.pageType
@Serializable
data class BrowseEndpointContextSupportedConfigs(

View File

@@ -16,7 +16,11 @@ data class Runs(
run.text == "" -> listOf(index - 1, index + 1)
else -> emptyList()
}
}.windowed(size = 2, step = 2) { (from, to) -> runs.slice(from..to) }
}.windowed(size = 2, step = 2) { (from, to) -> runs.slice(from..to) }.let {
it.ifEmpty {
listOf(runs)
}
}
}
@Serializable

View File

@@ -45,3 +45,4 @@ data class ThumbnailRenderer(
}
}
}