Civitai Text Downloader

Make Donload button click to save a description text file.

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
  1. // ==UserScript==
  2. // @name Civitai Text Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 6
  5. // @description Make Donload button click to save a description text file.
  6. // @author SenY
  7. // @match https://civitai.com/*
  8. // @icon https://civitai.com/favicon.ico
  9. // @grant none
  10. // @license BSD
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // 非メンテナンス警告用のHTMLを作成
  17. const warningHTML = `
  18. <div style="padding: 20px; background-color: #fff3cd; border: 1px solid #ffeeba; border-radius: 4px; margin: 10px; font-family: Arial, sans-serif;">
  19. <h2 style="color: #856404; margin-bottom: 20px;">⚠️ End of Maintenance Notice / 更新終了のお知らせ</h2>
  20. <div style="color: #856404; margin-bottom: 20px;">
  21. <p style="margin-bottom: 10px;">
  22. This userscript "Civitai Text Downloader" is no longer maintained.<br>
  23. Please consider switching to the actively maintained fork "Civitai Text Downloader Mod".
  24. </p>
  25. <p style="margin-bottom: 20px;">
  26. Civitai Text Downloader」は現在メンテナンスされていません。<br>
  27. 活発にメンテナンスされているフォーク「Civitai Text Downloader Mod」への移行をご検討ください。
  28. </p>
  29. </div>
  30.  
  31. <div style="text-align: center;">
  32. <a href="https://sleazyfork.org/en/scripts/501321-civitai-text-downloader-mod"
  33. target="_blank"
  34. style="display: inline-block; padding: 10px 20px; background-color: #856404; color: white; text-decoration: none; border-radius: 4px; font-weight: bold;">
  35. Go to Civitai Text Downloader Mod
  36. </a>
  37. </div>
  38. </div>
  39. `;
  40.  
  41. // HTMLをBlobに変換
  42. const blob = new Blob([warningHTML], { type: 'text/html' });
  43. // Blobからbase64エンコードされたURLを作成
  44. const blobUrl = URL.createObjectURL(blob);
  45. // 新しいウィンドウでメッセージを表示
  46. window.open(blobUrl, '_blank', 'width=700,height=400');
  47.  
  48. // メモリリーク防止のためにURLを解放
  49. setTimeout(() => {
  50. URL.revokeObjectURL(blobUrl);
  51. }, 1000);
  52. })();