Storyboards:
Added: Storyboards - Added the storyboards URL generation and extarction
This commit is contained in:
parent
07db5c5759
commit
b0e75f2e44
|
@ -1,6 +0,0 @@
|
||||||
https://i9.ytimg.com/sb/H8Gd9t7FQqI/storyboard3_L$L/$N.jpg?sqp=-oaymwGBQ7gymY2Drpcg|
|
|
||||||
80#45#158#10#10#10000#M$M#rs$AOn4CLBmFesZLLYKWd0UNT36Xx79Glm1zQ|
|
|
||||||
160#90#158#5#5#10000#M$M#rs$AOn4CLAMIjIKYqm6PxJnW7fSiydSpGJl5A'
|
|
||||||
|
|
||||||
full:
|
|
||||||
https://i9.ytimg.com/sb/H8Gd9t7FQqI/storyboard3_L0/M$M.jpg?sqp=-oaymwGBQ7gymY2Drpcg&sigh=rs$AOn4CLBmFesZLLYKWd0UNT36Xx79Glm1zQ
|
|
|
@ -1 +0,0 @@
|
||||||
undefined
|
|
|
@ -294,40 +294,20 @@ export default Vue.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The response provides a storyboard, however it returns a 403 error.
|
const templateUrl = result.player_response.storyboards.playerStoryboardSpecRenderer.spec
|
||||||
// Uncomment this line if that ever changes.
|
const storyboards = templateUrl.split('|')
|
||||||
const TemplateUrl = result.player_response.storyboards.playerStoryboardSpecRenderer.spec
|
const storyboardArray = []
|
||||||
const Storyboards = TemplateUrl.split('|')
|
// Second storyboard: L1/M0 - Third storyboard: L2/M0 - Fourth: L3/M0
|
||||||
console.log('AAAAAAAAAAAAAAAAAAAAAAAAA')
|
|
||||||
const BaseUrl = new Url.URL(Storyboards.shift())
|
const baseUrl = storyboards.shift()
|
||||||
const items = []
|
// remove the first link because it does not work
|
||||||
FileWriter.writeFile('D:\\Workspace\\JavaScript\\FreeTube-Vue\\Debug-Log\\log.txt', BaseUrl.URLS, (err) => {
|
storyboards.splice(0, 1)
|
||||||
if (err) {
|
storyboards.forEach((storyboard, i) => {
|
||||||
console.log(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Storyboards.forEach((storyboard, i) => {
|
|
||||||
const [width, height, count, sWidth, sHeight, interval, _, sigh] = storyboard.split('#')
|
const [width, height, count, sWidth, sHeight, interval, _, sigh] = storyboard.split('#')
|
||||||
const BaseStoryboardUrl = new URL(BaseUrl.toString().replace('$L', i).replace('$N', 'M$M'))
|
storyboardArray.push(baseUrl.replace('$L', i + 1).replace('$N', 'M0').replace(/<\/?sub>/g, '') + '&sigh=' + sigh)
|
||||||
BaseStoryboardUrl.searchParams.append('sigh', sigh)
|
|
||||||
items.push(
|
|
||||||
{
|
|
||||||
Url: BaseStoryboardUrl.toString(),
|
|
||||||
Width: Number(width),
|
|
||||||
Height: Number(height),
|
|
||||||
Count: Number(count),
|
|
||||||
Interval: Number(interval),
|
|
||||||
StoryboardWidth: Number(sWidth),
|
|
||||||
StoryboardHeight: Number(sHeight),
|
|
||||||
StoryboardCount: Math.ceil((Number(count) / (Number(sHeight) * Number(sWidth))))
|
|
||||||
}
|
|
||||||
)
|
|
||||||
console.log('URL: ', items[items.length - 1].Url)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// this.videoStoryboardSrc = result.player_response.storyboards.playerStoryboardSpecRenderer.spec
|
this.videoStoryboardSrc = storyboardArray[0]
|
||||||
this.videoStoryboardSrc = items[0].Url
|
|
||||||
|
|
||||||
this.captionSourceList =
|
this.captionSourceList =
|
||||||
result.player_response.captions &&
|
result.player_response.captions &&
|
||||||
result.player_response.captions.playerCaptionsTracklistRenderer
|
result.player_response.captions.playerCaptionsTracklistRenderer
|
||||||
|
|
Loading…
Reference in New Issue