Compare commits

...

2 Commits

Author SHA1 Message Date
j c05d0bbb44 merge conditional subtitle fixup from pandora 2024-02-17 10:54:05 +00:00
j 57a7ad2cc3 merge pandora.resolution 2024-02-17 10:51:40 +00:00
3 changed files with 13 additions and 10 deletions

View File

@ -155,7 +155,7 @@ async function loadEdit(id, args) {
} else {
var video = {}
var oshash = clip.streams[idx]
video.src = getVideoURL(clip.item, 480, idx+1, '', oshash)
video.src = getVideoURL(clip.item, pandora.resolution, idx+1, '', oshash)
/*
if (clip['in'] && clip.out) {
video.src += `#t=${clip['in']},${clip.out}`
@ -255,9 +255,9 @@ async function loadEdit(id, args) {
poster = getClip(data.edit, parseDuration(args.parts[2]))
}
if (poster && poster.item) {
data.poster = `${pandora.proto}://${data.site}/${poster.item}/480p${poster.position}.jpg`
data.poster = `${pandora.proto}://${data.site}/${poster.item}/${pandora.resolution}${poster.position.toFixed(3)}.jpg`
} else {
data.poster = data.videos[0].src.split('/48')[0] + `/480p${data.videos[0].in}.jpg`
data.poster = data.videos[0].src.split('/48')[0] + `/${pandora.resolution}p${data.videos[0].in.toFixed(3)}.jpg`
}
data.aspectratio = data.edit.clips[0].videoRatio
data.duration = data.edit.duration

View File

@ -106,7 +106,7 @@ async function loadData(id, args) {
data.videos = []
data.item.durations.forEach((duration, idx) => {
var oshash = data.item.streams[idx]
var url = getVideoURL(data.item.id, 480, idx+1, '', oshash)
var url = getVideoURL(data.item.id, pandora.resolution, idx+1, '', oshash)
data.videos.push({
src: url,
duration: duration
@ -130,11 +130,13 @@ async function loadData(id, args) {
${layerData.title}
</h3>`)
data.layers[layer].forEach(annotation => {
annotation.value = annotation.value.replace(
/src="\//g, `src="${pandora.url.origin}/`
).replace(
/href="\//g, `href="${pandora.url.origin}/`
)
if (pandora.url) {
annotation.value = annotation.value.replace(
/src="\//g, `src="${pandora.url.origin}/`
).replace(
/href="\//g, `href="${pandora.url.origin}/`
)
}
html.push(`
<div class="annotation ${layerData.type}" data-in="${annotation.in}" data-out="${annotation.out}">
${annotation.value}
@ -161,7 +163,7 @@ async function loadData(id, args) {
data.byline += ' (' + data.item.date.split('-')[0] + ')'
}
data.link = `${pandora.proto}://${data.site}/${data.item.id}/${data["in"]},${data.out}`
data.poster = `${pandora.proto}://${data.site}/${data.item.id}/480p${data["in"]}.jpg`
data.poster = `${pandora.proto}://${data.site}/${data.item.id}/${pandora.resolution}p${data["in"]}.jpg`
data.aspectratio = data.item.videoRatio
if (data['in'] == data['out']) {
data['out'] += 0.04

View File

@ -100,6 +100,7 @@ pandoraAPI("init").then(response => {
...response.data
}
pandora.proto = pandora.site.site.https ? 'https' : 'http'
pandora.resolution = Math.max.apply(null, pandora.site.video.resolutions)
if (pandora.site.site.videoprefix.startsWith('//')) {
pandora.site.site.videoprefix = pandora.proto + ':' + pandora.site.site.videoprefix
}