From 1086d7b5163205838fa93190801497fe79a17b3b Mon Sep 17 00:00:00 2001 From: Preston Date: Mon, 19 Oct 2020 11:51:37 -0400 Subject: [PATCH] Add captions to download links --- src/renderer/views/Watch/Watch.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 048dbfa1..7c749e66 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -334,6 +334,22 @@ export default Vue.extend({ 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 { // video might be region locked or something else. This leads to no formats being available this.showToast({