Skip to content

Instantly share code, notes, and snippets.

@ArthurBeaulieu
Created August 20, 2025 09:00
Show Gist options
  • Select an option

  • Save ArthurBeaulieu/989d7ce9c81605574d9ca91600ecebbc to your computer and use it in GitHub Desktop.

Select an option

Save ArthurBeaulieu/989d7ce9c81605574d9ca91600ecebbc to your computer and use it in GitHub Desktop.
All-in-one wistia video downloader. Just download the .html file, and paste the link and thumbnail link inside the input to download the video
<!DOCTYPE html>
<html>
<head>
<title>Wistia Video Downloader</title>
</head>
<body>
<input id="to-dl" type="text" placeholder="Your wistia link and thumbnail clipboard">
<button id="submit">Download</button>
<p id="feedback">Paste a wistia video link and thumbnail here : right click on the video you want to download, and select "Copy link and thumbnail" in the contextual menu, then paste it in the input right over here</p>
</body>
<script type="text/javascript">
document.getElementById('submit').addEventListener('click', () => {
document.getElementById('feedback').innerHTML = 'Submission clicked';
const input = document.getElementById('to-dl').value;
if (input) {
const videoId = input.split(`?wvideo=`)[1].split(`"`)[0]
if (videoId) {
fetch(`http://fast.wistia.net/embed/iframe/${videoId}`)
.then(response => response.text())
.then(data => {
let pattern = /http.*?.bin/ig;
const videos = data.match(pattern);
if (videos.length >= 5) {
const videoUrl = videos[5].replace('.bin', '.mp4');
if (videoUrl) {
document.getElementById('feedback').innerHTML = "Processing video please wait, it might take a while depending on the video's length";
// Bruh thx : https://stackoverflow.com/a/68523503
fetch(videoUrl, {
headers: new Headers({
'Origin': location.origin
}),
mode: 'cors'
})
.then(response => response.blob())
.then(blob => {
const a = document.createElement('a');
a.download = 'YourFilename';
a.href = window.URL.createObjectURL(blob);
// For Firefox https://stackoverflow.com/a/32226068
document.body.appendChild(a);
a.click();
a.remove();
document.getElementById('feedback').innerHTML = 'Video downloaded';
})
.catch(e => {
document.getElementById('feedback').innerHTML = `Couldn't fetch ${videoUrl} as a video to download`;
console.warn(`Couldn't fetch ${videoUrl} as a video to download`, e);
});
} else {
document.getElementById('feedback').innerHTML = 'Unable to create the video URL to download. Wistia format might have changed';
console.warn('Unable to create the video URL to download. Wistia format might have changed', data);
}
} else {
document.getElementById('feedback').innerHTML = 'Not enough video extracted from page. Wistia format might have changed';
console.warn('Not enough video extracted from page. Wistia format might have changed', videos);
}
})
.catch(e => {
document.getElementById('feedback').innerHTML = `Couldn't fetch http://fast.wistia.net/embed/iframe/${videoId} as a string`;
console.warn(`Couldn't fetch http://fast.wistia.net/embed/iframe/${videoId} as a string`, e);
});
} else {
document.getElementById('feedback').innerHTML = 'Unable to extract the video ID from the provided input. Make sure you pasted a propre wistia link and thumbnail input.';
console.warn('Unable to extract ID from provided string', input);
}
} else {
document.getElementById('feedback').innerHTML = 'Please fill a wistia link and thumbnail (right click on the video and select "Copy link and thumbnail" in the contextual menu, then paste it in here)';
}
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment