Add captions to download links

This commit is contained in:
Preston 2020-10-19 11:51:37 -04:00
parent 654c83dc88
commit 1086d7b516
1 changed files with 16 additions and 0 deletions

View File

@ -334,6 +334,22 @@ export default Vue.extend({
return object return object
}) })
let captionLinks = result.playerResponse.captions
if (typeof captionLinks !== 'undefined') {
captionLinks = captionLinks.playerCaptionsTracklistRenderer.captionTracks.map((caption) => {
const label = `${caption.name.simpleText} (${caption.languageCode}) - text/vtt`
const object = {
url: caption.baseUrl,
label: label
}
return object
})
this.downloadLinks = this.downloadLinks.concat(captionLinks)
}
} else { } else {
// video might be region locked or something else. This leads to no formats being available // video might be region locked or something else. This leads to no formats being available
this.showToast({ this.showToast({