|
|
@ -304,6 +304,9 @@ window.addEventListener("DOMContentLoaded", async (event) => {
|
|
|
|
document.getElementById("download-type-select").addEventListener("change", () => {
|
|
|
|
document.getElementById("download-type-select").addEventListener("change", () => {
|
|
|
|
updateDownloadLink();
|
|
|
|
updateDownloadLink();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById("download-crop").addEventListener("change", () => {
|
|
|
|
|
|
|
|
updateDownloadLink();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("download-frame").addEventListener("click", (_event) => {
|
|
|
|
document.getElementById("download-frame").addEventListener("click", (_event) => {
|
|
|
|
downloadFrame();
|
|
|
|
downloadFrame();
|
|
|
@ -1078,8 +1081,11 @@ function handleLeavePageWhilePending(event) {
|
|
|
|
return event.returnValue;
|
|
|
|
return event.returnValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function generateDownloadURL(timeRanges, downloadType, allowHoles, quality) {
|
|
|
|
function generateDownloadURL(timeRanges, downloadType, allowHoles, crop, quality) {
|
|
|
|
const queryParts = [`type=${downloadType}`, `allow_holes=${allowHoles}`];
|
|
|
|
const queryParts = [`type=${downloadType}`, `allow_holes=${allowHoles}`];
|
|
|
|
|
|
|
|
if (crop != "" && downloadType === "mpegts") {
|
|
|
|
|
|
|
|
queryParts.push(`crop=${crop}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
for (const range of timeRanges) {
|
|
|
|
for (const range of timeRanges) {
|
|
|
|
let timeRangeString = "";
|
|
|
|
let timeRangeString = "";
|
|
|
|
if (range.hasOwnProperty("start")) {
|
|
|
|
if (range.hasOwnProperty("start")) {
|
|
|
@ -1099,6 +1105,7 @@ function generateDownloadURL(timeRanges, downloadType, allowHoles, quality) {
|
|
|
|
function updateDownloadLink() {
|
|
|
|
function updateDownloadLink() {
|
|
|
|
const downloadType = document.getElementById("download-type-select").value;
|
|
|
|
const downloadType = document.getElementById("download-type-select").value;
|
|
|
|
const allowHoles = document.getElementById("advanced-submission-option-allow-holes").checked;
|
|
|
|
const allowHoles = document.getElementById("advanced-submission-option-allow-holes").checked;
|
|
|
|
|
|
|
|
const crop = document.getElementById("download-crop").value
|
|
|
|
|
|
|
|
|
|
|
|
const timeRanges = [];
|
|
|
|
const timeRanges = [];
|
|
|
|
for (const rangeContainer of document.getElementById("range-definitions").children) {
|
|
|
|
for (const rangeContainer of document.getElementById("range-definitions").children) {
|
|
|
@ -1120,6 +1127,7 @@ function updateDownloadLink() {
|
|
|
|
timeRanges,
|
|
|
|
timeRanges,
|
|
|
|
downloadType,
|
|
|
|
downloadType,
|
|
|
|
allowHoles,
|
|
|
|
allowHoles,
|
|
|
|
|
|
|
|
crop,
|
|
|
|
videoInfo.video_quality
|
|
|
|
videoInfo.video_quality
|
|
|
|
);
|
|
|
|
);
|
|
|
|
document.getElementById("download-link").href = downloadURL;
|
|
|
|
document.getElementById("download-link").href = downloadURL;
|
|
|
|