JQUERY Téléchargez la vidéo à partir de l'URL
fetch('http://127.0.0.1:8000/watch/2DPdo74U-zs')
.then(resp => resp.blob())
.then(blob => {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
// the filename you want
a.download = 'todo-1.json';
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
alert('your file has downloaded!'); // or you know, something with better UX...
})
.catch(() => alert('oh no!'));
Run code snippetHide results
Joyous Jaguar