40 lines
1.1 KiB
HTML
40 lines
1.1 KiB
HTML
|
|
<!DOCTYPE html><html style="background-color:black;color:white"><head>
|
|
<title>Video Download Helper</title>
|
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
<style>
|
|
video {max-width: 100%}
|
|
</style>
|
|
</head><body>
|
|
<noscript>need javascript bruh</noscript>
|
|
<div id="txt" style="white-space:pre"></div>
|
|
<script>
|
|
var params = new URLSearchParams(location.search);
|
|
var url = params.get("url");
|
|
if (url) {
|
|
var filename = params.get("filename") || "download.mp4";
|
|
txt.innerText = "downloading video blob, please wait...";
|
|
fetch(url).then(res => res.blob()).then(blob => {
|
|
var burl = URL.createObjectURL(blob);
|
|
var a = document.createElement("a");
|
|
a.href = burl;
|
|
a.download = filename;
|
|
a.innerText = "click or tap to save video";
|
|
txt.replaceWith(a);
|
|
a.click();
|
|
/*var video = document.createElement("video");
|
|
video.controls = true;
|
|
var source = document.createElement("source");
|
|
source.src = burl;
|
|
source.type = "video/mp4";
|
|
video.appendChild(source);
|
|
document.body.appendChild(video);*/
|
|
}).catch(error => {
|
|
txt.innerText = error.stack;
|
|
txt.style.color = "red";
|
|
});
|
|
}
|
|
</script>
|
|
</body></html>
|
|
|