merge pandora.resolution

This commit is contained in:
j 2024-02-17 10:51:40 +00:00
parent f139ab79e2
commit 57a7ad2cc3
3 changed files with 6 additions and 5 deletions

View file

@ -155,7 +155,7 @@ async function loadEdit(id, args) {
} else { } else {
var video = {} var video = {}
var oshash = clip.streams[idx] 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) { if (clip['in'] && clip.out) {
video.src += `#t=${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])) poster = getClip(data.edit, parseDuration(args.parts[2]))
} }
if (poster && poster.item) { 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 { } 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.aspectratio = data.edit.clips[0].videoRatio
data.duration = data.edit.duration data.duration = data.edit.duration

View file

@ -106,7 +106,7 @@ async function loadData(id, args) {
data.videos = [] data.videos = []
data.item.durations.forEach((duration, idx) => { data.item.durations.forEach((duration, idx) => {
var oshash = data.item.streams[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({ data.videos.push({
src: url, src: url,
duration: duration duration: duration
@ -161,7 +161,7 @@ async function loadData(id, args) {
data.byline += ' (' + data.item.date.split('-')[0] + ')' data.byline += ' (' + data.item.date.split('-')[0] + ')'
} }
data.link = `${pandora.proto}://${data.site}/${data.item.id}/${data["in"]},${data.out}` 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 data.aspectratio = data.item.videoRatio
if (data['in'] == data['out']) { if (data['in'] == data['out']) {
data['out'] += 0.04 data['out'] += 0.04

View file

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