// ==UserScript== // @name 動畫瘋下載器 // @namespace // @description 取得動畫的 m3u8 網址,並可使用 PotPlayer、MPV 播放,ffmpeg下載 // @version 1.7.5 // @author XPRAMT // @match https://ani.gamer.com.tw/animeVideo.php?sn=* // @connect ani.gamer.com.tw // @grant none // @namespace // @downloadURL https://update.greasyfork.icu/scripts/451695/%E5%8B%95%E7%95%AB%E7%98%8B%E4%B8%8B%E8%BC%89%E5%99%A8.user.js // @updateURL https://update.greasyfork.icu/scripts/451695/%E5%8B%95%E7%95%AB%E7%98%8B%E4%B8%8B%E8%BC%89%E5%99%A8.meta.js // ==/UserScript== (function () { 'use strict'; ///////////全域變數/////////// const mode = 0; //複製模式(0:複製完整指令|1:複製URL+名稱) const timeOut = 600; let m3u8_url = ''; let Name = ''; // 讀取已儲存的路徑,若無則使用預設 let downloadPath = localStorage.getItem('anig_download_path') || '%USERPROFILE%/Downloads'; // 從 URL 中獲取動畫的編號(AniVideoSn) let AniVideoSn = new URLSearchParams(window.location.search).get('sn'); //////////////////////////// // 注入樣式到頁面中 function injectStyles() { // 定義樣式 const css =` .anig-ct { margin:5px; margin-left:17px; font-size: 14px; } .anig-tb { display: inline-block; padding: 5px; background: #50b2d7; color: #FFF; margin-right: 5px; cursor: pointer; border-radius: 2px; }`; const style = document.createElement('style'); // 創建