Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user