Since you already have the direct .mp4 URL from the Twitter CDN, adding a download button on your page is pretty straightforward using plain HTML.
Here’s a simple way to do it:
<a href="https://video.twimg.com/ext_tw_video/1735368028454567940/pu/vid/avc1/720x1280/K1xz9gR_dzGv3ad2.mp4?tag=12" download>
<button>Download Video</button>
</a>
This will prompt the browser to download the video when the user clicks the button.
The download
attribute in the <a>
tag is what tells the browser to treat it as a file download rather than opening it.
If you're dynamically fetching the video URL via JavaScript, you can also set the href
of the <a>
element with JS.
Let me know if you're working with a framework or want to trigger this with a custom player!
You can check my work on https://twvideodownloader.net/ website i develop this tool.
Thanks