(function() { // 優先尋找 hd 版本,如果沒有則取第一個 let source = fs.video.media.src.find(s => s.src.includes('video_hd.mp4')) || fs.video.media.src[0]; const videoSrc = source.src; const referer = location.href; const cookie = document.cookie; const userAgent = navigator.userAgent; const fileName = (document.title.split('|')[0].trim() || 'video').replace(/[\\/:*?"<>|]/g, '_') + '.mp4'; const output = ` # === 從 GetEnv.js 複製的內容開始 === url = "${videoSrc}" headers = { "Referer": "${referer}", "User-Agent": "${userAgent}", "Cookie": "${cookie}" } filename = "${fileName}" # === 從 GetEnv.js 複製的內容結束 === `.trim(); console.log("%c已產生 Python 配置資訊:", "color: #28a745; font-weight: bold; font-size: 1.2em;"); console.log(output); console.log("%c請直接複製上方內容,覆蓋 download.py 的配置區域。", "color: #007bff;"); })();