Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-02-06 12:50:10 +00:00
Unverified

View File

@@ -98,12 +98,18 @@
});
function downloadVideo() {
var link = document.createElement('a');
link.href = videoUrl;
link.download = videoUrl.split('/').pop();
fetch(videoUrl)
.then(response => response.blob())
.then(blob => {
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = videoTitle + '.mp4'; // 设置下载文件名
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(link.href);
})
.catch(error => console.error('Error downloading the video:', error));
}
</script>
</body>