Created
October 10, 2025 18:58
-
-
Save geminixiang/0747e3115e57df3a5ea4d8faf1e3d774 to your computer and use it in GitHub Desktop.
繞過 cloudflare 檢查下載影片
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 找到 video 元素 | |
| const video = document.querySelector('video'); | |
| // 取得影片 URL | |
| const videoSrc = video.src || video.currentSrc; | |
| console.log('影片 URL:', videoSrc); | |
| // 建立下載 | |
| fetch(videoSrc) | |
| .then(response => response.blob()) | |
| .then(blob => { | |
| const url = window.URL.createObjectURL(blob); | |
| const a = document.createElement('a'); | |
| a.href = url; | |
| a.download = 'video.mp4'; | |
| document.body.appendChild(a); | |
| a.click(); | |
| window.URL.revokeObjectURL(url); | |
| document.body.removeChild(a); | |
| }) | |
| .catch(err => console.error('下載失敗:', err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment