Skip to content

Commit

Permalink
Merge pull request #6571 from Bnyro/master
Browse files Browse the repository at this point in the history
fix: crash when importing private videos in watch history
  • Loading branch information
Bnyro authored Oct 2, 2024
2 parents acf05ba + 152012b commit 54ca323
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ object ImportHelper {
JsonHelper.json.decodeFromStream<List<YouTubeWatchHistoryFileItem>>(it)
}
.orEmpty()
.filter { it.activityControls.contains("YouTube watch history") }
.filter { it.activityControls.contains("YouTube watch history") && it.subtitles.isNotEmpty() }
.reversed()
.map {
val videoId = it.titleUrl.substring(it.titleUrl.length - 11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import kotlinx.serialization.Serializable

@Serializable
data class YouTubeWatchHistoryFileItem(
val activityControls: List<String>,
val header: String,
val products: List<String>,
val subtitles: List<YouTubeWatchHistoryChannelInfo>,
val time: String,
val title: String,
val titleUrl: String
val titleUrl: String,
val activityControls: List<String> = emptyList(),
val products: List<String> = emptyList(),
val subtitles: List<YouTubeWatchHistoryChannelInfo> = emptyList()
)

0 comments on commit 54ca323

Please sign in to comment.