···11+<!DOCTYPE html>
22+<html lang="en">
33+<head>
44+ <meta charset="UTF-8">
55+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
66+ <title>pixivembed.py Documentation</title>
77+ <style>
88+ body {
99+ max-width: 480px;
1010+ margin: 48px auto;
1111+ padding: 0 16px;
1212+ line-height: 1.5;
1313+ }
1414+ pre {
1515+ white-space: pre-wrap;
1616+ overflow-x: auto;
1717+ background-color: #ebebeb;
1818+ padding: 8px;
1919+ }
2020+ </style>
2121+</head>
2222+<body>
2323+2424+ <h1>pixivembed.py Documentation</h1>
2525+ <p><b>pixivembed.py</b> is a Python script that fetches metadata from pixiv and generates a static HTML embed card. By default, the script runs silently, automatically copies the generated HTML to your clipboard, and saves it to a file named <code>pixivembed.html</code> in the same directory.</p>
2626+2727+ <p>Maintained by <a href="https://ufal.my.id">Ufal Salman</a>.</p>
2828+2929+ <p>The repository is also available <a href="https://tangled.org/ufal.my.id/pixivembed">here</a>.</p>
3030+3131+ <h2>Output Examples</h2>
3232+ <ul>
3333+ <li><a href="examples/pixivembed-proxy-sfw.html">pixivembed-proxy-sfw.html</a></li>
3434+ <li><a href="examples/pixivembed-proxy-multi-sfw.html">pixivembed-proxy-multi-sfw.html</a></li>
3535+ <li><a href="examples/pixivembed-base64-sfw.html">pixivembed-base64-sfw.html</a></li>
3636+ <li><a href="examples/pixivembed-base64-multi-sfw.html">pixivembed-base64-multi-sfw.html</a></li>
3737+ <li><a href="examples/pixivembed-proxy-r18.html">pixivembed-proxy-r18.html</a></li>
3838+ <li><a href="examples/pixivembed-proxy-multi-r18.html">pixivembed-proxy-multi-r18.html</a></li>
3939+ <li><a href="examples/pixivembed-base64-r18.html">pixivembed-base64-r18.html</a></li>
4040+ <li><a href="examples/pixivembed-base64-multi-r18.html">pixivembed-base64-multi-r18.html</a></li>
4141+ <li><a href="examples/pixivembed-proxy-grid-sfw.html">pixivembed-proxy-grid-sfw.html</a></li>
4242+ <li><a href="examples/pixivembed-proxy-scroll-sfw.html">pixivembed-proxy-scroll-sfw.html</a></li>
4343+ <li><a href="examples/pixivembed-proxy-blur-r18.html">pixivembed-proxy-blur-r18.html</a></li>
4444+ <li><a href="examples/pixivembed-proxy-pages-sfw.html">pixivembed-proxy-pages-sfw.html</a></li>
4545+ <li><a href="examples/pixivembed-proxy-range-sfw.html">pixivembed-proxy-range-sfw.html</a></li>
4646+ <li><a href="examples/pixivembed-lc-sfw.html">pixivembed-lc-sfw.html</a></li>
4747+ </ul>
4848+4949+ <h2>Download</h2>
5050+ <p>Get it <a href="pixivembed.py">here</a>.</p>
5151+5252+ <h2>CSS</h2>
5353+ <p>You can use the CSS template <a href="embed.css">here</a> if you want to modify and host it yourself.</p>
5454+5555+ <h2>Important Notice</h2>
5656+ <p><strong>Note:</strong> You must create a text file named <code>token.txt</code> in the same directory as the script and paste your own pixiv token inside it before running the script, otherwise authentication will fail. See this <a href="https://github.com/eggplants/get-pixivpy-token">guide</a> for further information.</p>
5757+5858+ <h2>Prerequisites</h2>
5959+ <p>Make sure you have the required libraries installed on your system:</p>
6060+ <pre><code>pip install pixivpy3 Pillow</code></pre>
6161+ <p><em>Note: The <code>Pillow</code> library is only required if you plan to use the local image download/conversion option (<code>-l</code>).</em></p>
6262+6363+ <h2>Usage</h2>
6464+ <pre><code>python pixivembed.py <URL-or-ID> [options]</code></pre>
6565+6666+ <h3>Basic Examples</h3>
6767+ <pre><code>python pixivembed.py 11223344
6868+python pixivembed.py https://www.pixiv.net/en/artworks/11223344</code></pre>
6969+7070+ <h3>Available Options</h3>
7171+ <ul>
7272+ <li><code>-nc</code> : Generates raw HTML without the inline <code><style></code> block.</li>
7373+ <li><code>-lc</code> : Replaces the style block with a <code><link rel="stylesheet"></code> tag pointing to an external CSS file from this website.</li>
7474+ <li><code>-l</code> : Downloads the illustrations locally, converts them to WebP format, and embeds them directly into the HTML code as Base64 strings.</li>
7575+ <li><code>-g4</code> : Arranges the images in a grid layout and limits the output to a maximum of 4 images.</li>
7676+ <li><code>-s</code> : Sets a fixed maximum height (400px) and makes the image container scrollable.</li>
7777+ <li><code>-b</code> : Applies a blur effect to all images. Hover over the image to unblur.</li>
7878+ <li><code>-p <pages></code> : Includes only specific page numbers (1-based index, e.g., <code>-p 1,3,4</code>).</li>
7979+ <li><code>-pa <start></code> : Sets the starting page for a range (e.g., <code>-pa 2</code>).</li>
8080+ <li><code>-pb <end></code> : Sets the ending page for a range (e.g., <code>-pb 5</code>).</li>
8181+ </ul>
8282+8383+ <h2>OS-Specific Guidelines</h2>
8484+8585+ <h3>1. Windows</h3>
8686+ <ul>
8787+ <li>Open <strong>Command Prompt (CMD)</strong> or <strong>PowerShell</strong>.</li>
8888+ <li>Run the script using the standard commands.</li>
8989+ <li>The automatic clipboard functionality uses the native Windows API via <code>ctypes</code>, so it works out of the box with no extra software required.</li>
9090+ </ul>
9191+9292+ <h3>2. macOS</h3>
9393+ <ul>
9494+ <li>Open <strong>Terminal</strong>.</li>
9595+ <li>The clipboard functionality automatically channels the output through the native <code>pbcopy</code> command.</li>
9696+ <li>No additional configuration is needed.</li>
9797+ </ul>
9898+9999+ <h3>3. Linux</h3>
100100+ <ul>
101101+ <li>Open your system <strong>Terminal</strong>.</li>
102102+ <li>To allow the script to automatically copy the HTML to your clipboard, your system needs either <code>xclip</code> or <code>xsel</code> installed.</li>
103103+ <li>You can install <code>xclip</code> via your package manager (e.g., on Debian/Ubuntu):</li>
104104+ </ul>
105105+ <pre><code>sudo apt install xclip</code></pre>
106106+107107+ <div>
108108+ <strong>Note for Linux Users:</strong> If neither <code>xclip</code> nor <code>xsel</code> is present, the script will still run perfectly fine and output the code to the terminal, but the automatic copy-to-clipboard step will be skipped.
109109+ </div>
110110+111111+</body>
112112+</html>