Skip to content

Instantly share code, notes, and snippets.

/**
* 使用步驟:
* 瀏覽器新增書籤,並在網址欄位放入以下程式碼
* 後續只要在 risu 播放影片的頁面點擊書籤即可自動下載
* 若有密碼,須先自行輸入密碼後,進入播放影片的頁面方可有效
*/
javascript: function downloadBlobs(blob){const blobUrl=new URL(blob);const url=new URL(blobUrl.pathname);const fileName=url.pathname.replace(/^\//g,"")||"video";const a=document.createElement("a");a.href=blob;a.download=`${fileName}.mp4`;a.click()}downloadBlobs(document.getElementsByTagName("video")[0].src);