<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="rss.xsl"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>mijeq95's blog Blog</title>
        <link>https://mikeQ95.github.io/en/blog</link>
        <description>mijeq95's blog Blog</description>
        <lastBuildDate>Fri, 29 May 2026 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[Download YouTube Videos Using a Python Script]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script</guid>
            <pubDate>Fri, 29 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Want to save YouTube videos locally? This post walks through a Python script that handles everything for you — set it up once, then just swap the URL each time.]]></description>
            <content:encoded><![CDATA[<p>Want to save YouTube videos locally? This post walks through a Python script that handles everything for you — set it up once, then just swap the URL each time.</p>
<!-- -->
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="setting-up-the-environment">Setting Up the Environment<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#setting-up-the-environment" class="hash-link" aria-label="Direct link to Setting Up the Environment" title="Direct link to Setting Up the Environment" translate="no">​</a></h2>
<p>Your Mac needs the following four tools. Install them in order.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="homebrew">Homebrew<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#homebrew" class="hash-link" aria-label="Direct link to Homebrew" title="Direct link to Homebrew" translate="no">​</a></h3>
<p>macOS package manager — the foundation for installing everything else.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</span><br></div></code></pre></div></div>
<p>Verify:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew --version</span><br></div></code></pre></div></div>
<p>✅ Success: shows <code>Homebrew 4.x.x</code> ❌ Failure: shows <code>command not found</code></p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="ffmpeg">ffmpeg<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#ffmpeg" class="hash-link" aria-label="Direct link to ffmpeg" title="Direct link to ffmpeg" translate="no">​</a></h3>
<p>Merges audio and video streams — without it you'll only get a silent video.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew install ffmpeg</span><br></div></code></pre></div></div>
<p>Verify:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">ffmpeg -version</span><br></div></code></pre></div></div>
<p>✅ Success: shows <code>ffmpeg version 7.x.x</code> ❌ Failure: shows <code>command not found</code></p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="nodejs">Node.js<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#nodejs" class="hash-link" aria-label="Direct link to Node.js" title="Direct link to Node.js" translate="no">​</a></h3>
<p>Solves YouTube's JS encryption challenge — without it all format options are lost.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew install node</span><br></div></code></pre></div></div>
<p>Verify:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">node --version</span><br></div></code></pre></div></div>
<p>✅ Success: shows <code>v26.x.x</code> ❌ Failure: shows <code>command not found</code></p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="yt-dlp">yt-dlp<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#yt-dlp" class="hash-link" aria-label="Direct link to yt-dlp" title="Direct link to yt-dlp" translate="no">​</a></h3>
<p>The core download library.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">pip3 install yt-dlp --break-system-packages</span><br></div></code></pre></div></div>
<p>Verify:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">yt-dlp --version</span><br></div></code></pre></div></div>
<p>✅ Success: shows <code>2026.x.xx</code> ❌ Failure: shows <code>command not found</code></p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="two-extra-configuration-steps">Two Extra Configuration Steps<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#two-extra-configuration-steps" class="hash-link" aria-label="Direct link to Two Extra Configuration Steps" title="Direct link to Two Extra Configuration Steps" translate="no">​</a></h3>
<p><strong>Grant Terminal Full Disk Access</strong> (needed to read Safari cookies)</p>
<p>System Settings → Privacy &amp; Security → Full Disk Access → Add "Terminal"</p>
<p><strong>Enable a proxy</strong> (required to access YouTube outside China)</p>
<blockquote>
<p>I'm definitely not going to teach you that one!</p>
</blockquote>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="get-the-code">Get the Code<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#get-the-code" class="hash-link" aria-label="Direct link to Get the Code" title="Direct link to Get the Code" translate="no">​</a></h2>
<p>You can download the script I wrote, or write it yourself (or have AI write it — see the next section).</p>
<p><a href="https://drive.google.com/file/d/14lFupv6bSw-cicSJ2KxoWYJgkII1uHeZ/view?usp=share_link" target="_blank" rel="noopener noreferrer" class="">Download main.py</a></p>
<p>Script contents:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> subprocess</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> sys</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> os</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># ── Configuration ────────────────────────────────────────────────────────────</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">VIDEO_URL  </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"XXXX"</span><span class="token plain">                           </span><span class="token comment" style="color:#999988;font-style:italic"># Replace with a real YouTube URL</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">OUTPUT_DIR </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">path</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">expanduser</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">"~/Desktop"</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Output to Desktop</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">NODE_PATH  </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/opt/homebrew/bin/node"</span><span class="token plain">         </span><span class="token comment" style="color:#999988;font-style:italic"># Node.js path (installed via Homebrew)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># ─────────────────────────────────────────────────────────────────────────────</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">def</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">download_video</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">url</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token builtin">str</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> output_dir</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token builtin">str</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">-</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">None</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token triple-quoted-string string" style="color:#e3116c">"""</span><br></div><div class="token-line" style="color:#393A34"><span class="token triple-quoted-string string" style="color:#e3116c">    Calls the yt-dlp CLI to download a YouTube video in H.264 MP4 format.</span><br></div><div class="token-line" style="color:#393A34"><span class="token triple-quoted-string string" style="color:#e3116c">    """</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    output_template </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">path</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">join</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">output_dir</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"%(title)s.%(ext)s"</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    cmd </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token string" style="color:#e3116c">"yt-dlp"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># Prefer H.264 video stream + best audio</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token string" style="color:#e3116c">"--format"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"bestvideo[vcodec^=avc1]+bestaudio/bestvideo[ext=mp4]+bestaudio/best"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># Force MP4 container</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token string" style="color:#e3116c">"--merge-output-format"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"mp4"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># Specify Node.js path for solving YouTube's JS encryption</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token string" style="color:#e3116c">"--js-runtimes"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string-interpolation string" style="color:#e3116c">f"node:</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">{</span><span class="token string-interpolation interpolation">NODE_PATH</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">}</span><span class="token string-interpolation string" style="color:#e3116c">"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># Download JS challenge decryption script from GitHub (requires internet on first run)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token string" style="color:#e3116c">"--remote-components"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"ejs:github"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># Read Safari cookies to bypass bot detection</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token string" style="color:#e3116c">"--cookies-from-browser"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"safari"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># Output file path template</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token string" style="color:#e3116c">"--output"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> output_template</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        url</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string-interpolation string" style="color:#e3116c">f"[INFO] Starting download: </span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">{</span><span class="token string-interpolation interpolation">url</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">}</span><span class="token string-interpolation string" style="color:#e3116c">"</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string-interpolation string" style="color:#e3116c">f"[INFO] Output directory: </span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">{</span><span class="token string-interpolation interpolation">output_dir</span><span class="token string-interpolation interpolation punctuation" style="color:#393A34">}</span><span class="token string-interpolation string" style="color:#e3116c">\n"</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    result </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> subprocess</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">run</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">cmd</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">if</span><span class="token plain"> result</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">returncode </span><span class="token operator" style="color:#393A34">==</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">"\n[✓] Download complete! Video saved to Desktop."</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">else</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">"\n[✗] Download failed. Check the error output above."</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token builtin">file</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">sys</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">stderr</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        sys</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">exit</span><span class="token punctuation" style="color:#393A34">(</span><span class="token number" style="color:#36acaa">1</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">if</span><span class="token plain"> __name__ </span><span class="token operator" style="color:#393A34">==</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"__main__"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token comment" style="color:#999988;font-style:italic"># Supports passing a URL as a command-line argument: python3 main.py &lt;url&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    url </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> sys</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">argv</span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">1</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">if</span><span class="token plain"> </span><span class="token builtin">len</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">sys</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">argv</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">else</span><span class="token plain"> VIDEO_URL</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">if</span><span class="token plain"> url </span><span class="token operator" style="color:#393A34">==</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"XXXX"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">"[✗] Please replace VIDEO_URL with a real URL, or pass it as a command-line argument."</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token builtin">file</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">sys</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">stderr</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token keyword" style="color:#00009f">print</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">"    Usage: python3 main.py \"YouTube URL\""</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token builtin">file</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">sys</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">stderr</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        sys</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">exit</span><span class="token punctuation" style="color:#393A34">(</span><span class="token number" style="color:#36acaa">1</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    download_video</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">url</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> OUTPUT_DIR</span><span class="token punctuation" style="color:#393A34">)</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-lazy-approach-let-ai-write-the-code">The Lazy Approach: Let AI Write the Code<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#the-lazy-approach-let-ai-write-the-code" class="hash-link" aria-label="Direct link to The Lazy Approach: Let AI Write the Code" title="Direct link to The Lazy Approach: Let AI Write the Code" translate="no">​</a></h2>
<p>Don't want to write the code yourself? Just paste one of these prompts into ChatGPT, DeepSeek, or Claude and they'll output a working script.</p>
<p><strong>English prompt (recommended — more stable output):</strong></p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">I need you to help me set up a YouTube video download environment on macOS and write a complete Python script.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">## My Environment</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Device: MacBook (Apple Silicon, M-series chip)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- OS: macOS</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">## What I Need You To Do</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">### Step 1 — Check and Install Dependencies</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Check whether the following tools are installed one by one. If not, provide the install command:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">1. Homebrew: via https://brew.sh/</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">2. ffmpeg: via brew install ffmpeg</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">3. Node.js: via brew install node</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">4. yt-dlp: via pip3 install yt-dlp --break-system-packages</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">### Step 2 — Write the Python Script</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Filename: youtube_downloader.py</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Requirements:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Use subprocess to call the yt-dlp CLI (do NOT use the yt_dlp Python API)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Video format: H.264 codec, MP4 container</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Quality: automatically select the highest available quality</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Cookies: read from Safari (--cookies-from-browser safari)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Node.js path: /opt/homebrew/bin/node</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Include --remote-components ejs:github to solve JS challenges</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Output directory: Desktop (~/Desktop)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Accept video URL as a command-line argument: python3 youtube_downloader.py "YouTube URL"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Add comments in English</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">### Step 3 — Tell Me How To Use It</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Explain how to run the script in one sentence.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">## Important Notes</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- macOS root directory / is read-only — do NOT output files there</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Terminal needs Full Disk Access enabled in System Settings to read Safari cookies — please remind me to do this</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">- Do NOT use "ios" as the player_client — it does not support cookies</span><br></div></code></pre></div></div>
<blockquote>
<p>AI can write the code for you, but <strong>you still need to set up the environment yourself</strong> (the four tools above). If you don't want to do that manually either, use Claude Code or Codex to run the install commands automatically — just keep clicking yes.</p>
</blockquote>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="usage">Usage<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#usage" class="hash-link" aria-label="Direct link to Usage" title="Direct link to Usage" translate="no">​</a></h2>
<p>Once the environment is set up, every download only takes one command.</p>
<p>Open Terminal and run:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">python3 ~/Downloads/main.py "paste your YouTube URL here"</span><br></div></code></pre></div></div>
<blockquote>
<p>If you saved <code>main.py</code> somewhere else, replace <code>~/Downloads/main.py</code> with the actual path. <code>~/Downloads</code> refers to your Downloads folder — no need to substitute your username.</p>
</blockquote>
<p>Example:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">python3 ~/Downloads/main.py "https://www.youtube.com/watch?v=5wvq8w7YBXU"</span><br></div></code></pre></div></div>
<p>Press Enter and wait — the video will appear on your <strong>Desktop</strong> when done.</p>
<hr>
<p><strong>Two things to check before each use:</strong></p>
<p>① Your proxy is active (e.g. Shadowrocket is connected)</p>
<p>② You're using a freshly opened Terminal window (not one that's been open for days)</p>
<p>You only need to set up the environment once. After that, any YouTube URL works.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">FAQ<a href="https://mikeq95.github.io/en/blog/2026/05/29/download-youtube-videos-using-a-python-script#faq" class="hash-link" aria-label="Direct link to FAQ" title="Direct link to FAQ" translate="no">​</a></h2>
<p><strong>What is Homebrew?</strong> I wrote a separate post about it — check that out.</p>
<p><strong>What video quality will I get?</strong> The highest available by default. This line in the script controls the resolution selection logic:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token string" style="color:#e3116c">"bestvideo[vcodec^=avc1]+bestaudio/bestvideo[ext=mp4]+bestaudio/best"</span><br></div></code></pre></div></div>
<p>It selects the highest-quality stream among all H.264-encoded video tracks.</p>
<p><strong>Terminal is stuck and nothing's happening?</strong> The first run downloads a decryption script from the internet, which can be slow on some networks. Make sure your proxy is active, or wait 1–2 minutes.</p>
<p><strong><code>command not found</code> error?</strong> A dependency didn't install correctly. Go back to the "Setting Up the Environment" section and verify each tool one by one.</p>
<p><strong><code>permission denied</code> or cookie read failure?</strong> Terminal doesn't have Full Disk Access. Go to System Settings → Privacy &amp; Security → Full Disk Access → Add "Terminal", then open a new Terminal window and try again.</p>
<p><strong>Download failed and you can't read the error?</strong> Check in order: ① Is your proxy on? ② Is yt-dlp up to date? (<code>pip3 install -U yt-dlp --break-system-packages</code>) ③ Is the URL complete and wrapped in quotes?</p>]]></content:encoded>
            <category>macOS</category>
        </item>
        <item>
            <title><![CDATA[Introduction to Homebrew]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/05/28/homebrew-tutorials</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/05/28/homebrew-tutorials</guid>
            <pubDate>Thu, 28 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA["The most popular command-line package manager for macOS."]]></description>
            <content:encoded><![CDATA[<blockquote>
<p>"The most popular command-line package manager for macOS."</p>
</blockquote>
<p>Still hunting down installers one by one on official websites? With Homebrew, one command handles everything — install, update, uninstall — all managed in one place. Say goodbye to manual downloads.</p>
<p>Homebrew is a package manager for macOS and Linux. Its core value in one sentence: <strong>manage all your software from the command line, unified.</strong></p>
<!-- -->
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="installing-homebrew">Installing Homebrew<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#installing-homebrew" class="hash-link" aria-label="Direct link to Installing Homebrew" title="Direct link to Installing Homebrew" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="in-china">In China<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#in-china" class="hash-link" aria-label="Direct link to In China" title="Direct link to In China" translate="no">​</a></h3>
<p>Due to network restrictions, using a domestic mirror is recommended: <a href="https://github.com/ineo6/homebrew-install" target="_blank" rel="noopener noreferrer" class="">source</a></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="outside-china">Outside China<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#outside-china" class="hash-link" aria-label="Direct link to Outside China" title="Direct link to Outside China" translate="no">​</a></h3>
<p>Use the official script: <a href="https://brew.sh/" target="_blank" rel="noopener noreferrer" class="">source</a></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="core-concepts-formula-and-cask">Core Concepts: formula and cask<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#core-concepts-formula-and-cask" class="hash-link" aria-label="Direct link to Core Concepts: formula and cask" title="Direct link to Core Concepts: formula and cask" translate="no">​</a></h2>
<p>Before using Homebrew, understand two key concepts:</p>
<ul>
<li class=""><strong>formula</strong>: installs <strong>command-line tools</strong> like <code>git</code> or <code>python</code> — no graphical interface</li>
<li class=""><strong>cask</strong>: installs <strong>GUI apps</strong> like Firefox or VS Code</li>
</ul>
<p>Simple rule: <strong>App with an icon → cask; command-line only → formula</strong>.</p>
<blockquote>
<p>Not talking about Gragas from League of Legends 😂</p>
</blockquote>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="installing-software">Installing Software<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#installing-software" class="hash-link" aria-label="Direct link to Installing Software" title="Direct link to Installing Software" translate="no">​</a></h2>
<p>Install a command-line tool (formula), e.g. git:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew install git</span><br></div></code></pre></div></div>
<p>Install a GUI app (cask), e.g. Firefox:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew install --cask firefox</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="updating-software">Updating Software<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#updating-software" class="hash-link" aria-label="Direct link to Updating Software" title="Direct link to Updating Software" translate="no">​</a></h2>
<p>Before upgrading, refresh Homebrew's package list to get the latest versions:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew update  # refresh the package list (like refreshing the App Store)</span><br></div></code></pre></div></div>
<p>Then upgrade a specific package, e.g. Python:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew upgrade python</span><br></div></code></pre></div></div>
<blockquote>
<p><strong>Note:</strong> <code>brew update</code> updates Homebrew's own package index; <code>brew upgrade</code> actually upgrades the software. They are different.</p>
</blockquote>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="pinning-a-version">Pinning a Version<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#pinning-a-version" class="hash-link" aria-label="Direct link to Pinning a Version" title="Direct link to Pinning a Version" translate="no">​</a></h2>
<p>Sometimes you don't want a package to be auto-upgraded — for example, your project depends on a specific version of Python and upgrading would break things. Use <code>pin</code> to lock the version:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew pin python  # lock python, prevent auto-upgrade</span><br></div></code></pre></div></div>
<p>List pinned packages:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew list --pinned</span><br></div></code></pre></div></div>
<p>Unpin to allow upgrades again:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew unpin python</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="uninstalling-software">Uninstalling Software<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#uninstalling-software" class="hash-link" aria-label="Direct link to Uninstalling Software" title="Direct link to Uninstalling Software" translate="no">​</a></h2>
<p>Uninstall a command-line tool:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew uninstall node</span><br></div></code></pre></div></div>
<p>Uninstall a GUI app:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">brew uninstall --cask firefox</span><br></div></code></pre></div></div>
<p>Uninstall Homebrew itself:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/uninstall.sh)"</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary">Summary<a href="https://mikeq95.github.io/en/blog/2026/05/28/homebrew-tutorials#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary" translate="no">​</a></h2>
<table><thead><tr><th>Operation</th><th>Command</th></tr></thead><tbody><tr><td>Install CLI tool</td><td><code>brew install &lt;name&gt;</code></td></tr><tr><td>Install GUI app</td><td><code>brew install --cask &lt;name&gt;</code></td></tr><tr><td>Refresh package list</td><td><code>brew update</code></td></tr><tr><td>Upgrade software</td><td><code>brew upgrade &lt;name&gt;</code></td></tr><tr><td>Pin version</td><td><code>brew pin &lt;name&gt;</code></td></tr><tr><td>List pinned</td><td><code>brew list --pinned</code></td></tr><tr><td>Unpin version</td><td><code>brew unpin &lt;name&gt;</code></td></tr><tr><td>Uninstall</td><td><code>brew uninstall &lt;name&gt;</code></td></tr></tbody></table>
<p>These commands cover the vast majority of everyday Homebrew usage. In my opinion, Homebrew is an essential tool for every Mac — it's simply too convenient to go without.</p>]]></content:encoded>
            <category>macOS</category>
        </item>
        <item>
            <title><![CDATA[Marker Tutorial]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/05/28/marker-github-project-tutorial</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/05/28/marker-github-project-tutorial</guid>
            <pubDate>Thu, 28 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[I personally enjoy browsing instructables — the site helpfully provides a "Export article as PDF" button in the top right, but no "Export as Markdown" option. I really wanted Markdown format, since AI tools prefer reading .md over PDF. After searching online, I found this GitHub project.]]></description>
            <content:encoded><![CDATA[<p>I personally enjoy browsing <a href="https://www.instructables.com/" target="_blank" rel="noopener noreferrer" class="">instructables</a> — the site helpfully provides a "Export article as PDF" button in the top right, but no "Export as Markdown" option. I really wanted Markdown format, since AI tools prefer reading <code>.md</code> over PDF. After searching online, I found this GitHub project.</p>
<p>Marker is an open-source tool that converts PDF, Word, PPT, and other file formats into Markdown. It's fast, and accuracy is pretty solid. This post documents how to get it running.</p>
<!-- -->
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="setting-up-the-environment">Setting Up the Environment<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#setting-up-the-environment" class="hash-link" aria-label="Direct link to Setting Up the Environment" title="Direct link to Setting Up the Environment" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="prerequisites">Prerequisites<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#prerequisites" class="hash-link" aria-label="Direct link to Prerequisites" title="Direct link to Prerequisites" translate="no">​</a></h3>
<ul>
<li class="">Python 3.10 or higher</li>
<li class="">Conda is recommended for environment management (explained below)</li>
</ul>
<p>If you're on a Mac M1/M2/M3, no extra configuration is needed — PyTorch natively supports Apple Silicon.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="install-conda">Install Conda<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#install-conda" class="hash-link" aria-label="Direct link to Install Conda" title="Direct link to Install Conda" translate="no">​</a></h3>
<p>Miniforge is recommended: lightweight and well-supported on Apple Silicon.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># macOS Apple Silicon</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">bash Miniforge3-MacOSX-arm64.sh</span><br></div></code></pre></div></div>
<p>After installation, run this command so Terminal recognizes conda:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">~/miniforge3/bin/conda init zsh</span><br></div></code></pre></div></div>
<p>Then close and reopen Terminal. You'll see <code>(base)</code> at the start of your prompt — conda is ready.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="create-a-virtual-environment">Create a Virtual Environment<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#create-a-virtual-environment" class="hash-link" aria-label="Direct link to Create a Virtual Environment" title="Direct link to Create a Virtual Environment" translate="no">​</a></h3>
<p>Think of a virtual environment as a separate "room" for this project — packages installed here won't affect anything else on your system.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">conda create -n marker python=3.11 -y</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">conda activate marker</span><br></div></code></pre></div></div>
<p>Once activated, your prompt changes from <code>(base)</code> to <code>(marker)</code>.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="install-marker">Install Marker<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#install-marker" class="hash-link" aria-label="Direct link to Install Marker" title="Direct link to Install Marker" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">pip install marker-pdf</span><br></div></code></pre></div></div>
<p>If you also need to convert Word, PPT, or EPUB files:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">pip install marker-pdf[full]</span><br></div></code></pre></div></div>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="verify-installation">Verify Installation<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#verify-installation" class="hash-link" aria-label="Direct link to Verify Installation" title="Direct link to Verify Installation" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">marker_single --help</span><br></div></code></pre></div></div>
<p>Wait about 10–15 seconds. If a list of parameters is printed, you're good to go.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="activating-the-environment-each-session">Activating the Environment Each Session<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#activating-the-environment-each-session" class="hash-link" aria-label="Direct link to Activating the Environment Each Session" title="Direct link to Activating the Environment Each Session" translate="no">​</a></h3>
<p>Every time you open a new Terminal, remember to activate the environment first:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">conda activate marker</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-to-use">How to Use<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#how-to-use" class="hash-link" aria-label="Direct link to How to Use" title="Direct link to How to Use" translate="no">​</a></h2>
<p>The basic format is a single line:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">marker_single /path/to/your/file --output_dir /output/directory</span><br></div></code></pre></div></div>
<p>Useful options:</p>
<ul>
<li class=""><code>--output_dir</code>: specify the output folder</li>
<li class=""><code>--output_format</code>: output format — <code>markdown</code>, <code>json</code>, or <code>html</code></li>
<li class=""><code>--page_range</code>: convert specific pages, e.g. <code>"0,5-10"</code> (pages are 0-indexed)</li>
<li class=""><code>--force_ocr</code>: force OCR — use this when text in the PDF is actually an image</li>
<li class=""><code>--langs zh</code>: tells Marker the document is in Chinese for better accuracy</li>
<li class=""><code>--use_llm</code>: use an LLM for assistance — higher accuracy, requires an API key</li>
</ul>
<p>After conversion, the output folder will contain a <code>.md</code> file and extracted images. Open with Typora or Obsidian for proper rendering.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="practical-examples">Practical Examples<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#practical-examples" class="hash-link" aria-label="Direct link to Practical Examples" title="Direct link to Practical Examples" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="convert-a-research-paper">Convert a Research Paper<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#convert-a-research-paper" class="hash-link" aria-label="Direct link to Convert a Research Paper" title="Direct link to Convert a Research Paper" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">marker_single ~/Downloads/paper.pdf \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --output_dir ~/Documents/notes</span><br></div></code></pre></div></div>
<p>The first run downloads the AI models (~1 GB) — be patient. Afterwards, math formulas are converted to LaTeX, tables and headings are preserved. Results are quite good.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="convert-a-scanned-pdf">Convert a Scanned PDF<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#convert-a-scanned-pdf" class="hash-link" aria-label="Direct link to Convert a Scanned PDF" title="Direct link to Convert a Scanned PDF" translate="no">​</a></h3>
<p>Text in scanned PDFs is stored as images and can't be recognized normally. Add <code>--force_ocr</code>:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">marker_single ~/Downloads/scanned.pdf \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --output_dir ~/Desktop/output \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --force_ocr \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --langs zh</span><br></div></code></pre></div></div>
<p>This mode is slower — roughly 5–15 seconds per page. Don't stop it midway.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="convert-specific-pages-output-as-json">Convert Specific Pages, Output as JSON<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#convert-specific-pages-output-as-json" class="hash-link" aria-label="Direct link to Convert Specific Pages, Output as JSON" title="Direct link to Convert Specific Pages, Output as JSON" translate="no">​</a></h3>
<p>For example, from a 200-page report, extract only pages 1, 5–10, and 20:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">marker_single ~/Downloads/report.pdf \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --output_dir ~/Desktop/output \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --page_range "0,4-9,19" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --output_format json</span><br></div></code></pre></div></div>
<p>JSON output produces structured data — useful for further processing, such as importing into a database or feeding into an LLM.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="let-ai-tools-handle-the-deployment">Let AI Tools Handle the Deployment<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#let-ai-tools-handle-the-deployment" class="hash-link" aria-label="Direct link to Let AI Tools Handle the Deployment" title="Direct link to Let AI Tools Handle the Deployment" translate="no">​</a></h2>
<p>If the steps above feel tedious, paste this prompt into Claude Code, Cursor, or a similar AI tool and let it set up the environment automatically.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">You are a professional Python environment configuration engineer. Please fully deploy the marker-pdf runtime environment on this machine.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">My setup: macOS Apple Silicon (M1 Pro), shell is zsh, Conda is installed at ~/miniforge3.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Please complete the following steps in order, check the result after each step, and immediately diagnose and fix any errors:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">1. Check if conda is available (conda --version). If not, run ~/miniforge3/bin/conda init zsh and remind me to reopen Terminal.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">2. Create and activate a virtual environment: conda create -n marker python=3.11 -y &amp;&amp; conda activate marker</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">3. Install marker: pip install marker-pdf</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">4. Verify PyTorch: python -c "import torch; print(torch.__version__)". If you see a libtorch_cpu.dylib error, reinstall immediately: pip uninstall torch torchvision torchaudio -y &amp;&amp; pip install torch torchvision torchaudio</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">5. Verify marker: run marker_single --help, wait ~20 seconds. A list of parameters means success.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Tell me what you're doing before each step. Do not modify system-level configuration. When done, output the installed versions of Python, PyTorch, and marker-pdf.</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="uninstalling">Uninstalling<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#uninstalling" class="hash-link" aria-label="Direct link to Uninstalling" title="Direct link to Uninstalling" translate="no">​</a></h2>
<p>Uninstall only the marker package, keep the environment:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">conda activate marker</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">pip uninstall marker-pdf</span><br></div></code></pre></div></div>
<p>Delete the entire environment (more thorough):</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">conda deactivate</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">conda env remove -n marker</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="troubleshooting">Troubleshooting<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#troubleshooting" class="hash-link" aria-label="Direct link to Troubleshooting" title="Direct link to Troubleshooting" translate="no">​</a></h2>
<p><strong>Terminal is stuck?</strong> The first run downloads models, which can be slow on some networks. Try configuring a proxy for Terminal:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">export https_proxy=http://127.0.0.1:YOUR_PORT</span><br></div></code></pre></div></div>
<p><strong><code>libtorch_cpu.dylib</code> error on Mac?</strong> Reinstall PyTorch:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">pip uninstall torch torchvision torchaudio -y</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">pip install torch torchvision torchaudio</span><br></div></code></pre></div></div>
<p><strong>Poor Chinese recognition?</strong> Add <code>--langs zh</code>. For scanned documents, also add <code>--force_ocr</code>.</p>
<p><strong><code>command not found</code>?</strong> The environment isn't activated. Run <code>conda activate marker</code> first.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary">Summary<a href="https://mikeq95.github.io/en/blog/2026/05/28/marker-github-project-tutorial#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary" translate="no">​</a></h2>
<p>Marker is essentially a <strong>locally-running document parsing engine</strong>, powered by AI models specifically trained on document layouts — not a general-purpose LLM. This makes it fast, offline-capable, and effective without any API key. It excels at complex academic PDFs: converting math formulas to LaTeX, preserving table structure, and extracting images separately. If you need to organize large volumes of documents into a knowledge base, or want to feed PDF content into an LLM for further processing, Marker is one of the best open-source options available.</p>
<hr>
<p><em>Based on <a href="https://github.com/datalab-to/marker" target="_blank" rel="noopener noreferrer" class="">datalab-to/marker</a>, compatible with marker v1.x</em></p>]]></content:encoded>
            <category>GitHub</category>
            <category>macOS</category>
        </item>
        <item>
            <title><![CDATA[My Favorite Songs (Jay Chou)]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/05/24/my-favorite-songs</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/05/24/my-favorite-songs</guid>
            <pubDate>Sun, 24 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Jay Chou's classic songs have accompanied me throughout my youth. Here are some of my favorites:]]></description>
            <content:encoded><![CDATA[<p>Jay Chou's classic songs have accompanied me throughout my youth. Here are some of my favorites:</p>
<!-- -->
<ol>
<li class=""><strong>Qi Li Xiang (Seven-Mile Fragrance)</strong> - A timeless melody with the taste of summer.</li>
<li class=""><strong>Ye Qu (Nocturne)</strong> - The moment that intro plays, memories come flooding back.</li>
<li class=""><strong>Qing Tian (Clear Sky)</strong> - The secret crush and regret of adolescence.</li>
<li class=""><strong>Yi Fu Zhi Ming (In the Name of the Father)</strong> - The pinnacle of his dark style.</li>
<li class=""><strong>Qing Hua Ci (Blue and White Porcelain)</strong> - A beautiful ode to Chinese aesthetics.</li>
</ol>
<p>These songs are more than just melodies — they are the mark of time.</p>
<hr>
<p>Want to listen? Click below to open the player. You can upload local audio files and <code>.lrc</code> lyrics files to enjoy Apple Music-style scrolling lyrics.</p>
<a href="https://mikeq95.github.io/en/music-player" target="_blank" rel="noopener noreferrer" style="display:flex;align-items:center;gap:12px;padding:16px 20px;border-radius:12px;border:1px solid var(--ifm-color-emphasis-300);text-decoration:none;color:inherit;margin-top:12px;transition:box-shadow 0.2s"><span style="font-size:32px">🎵</span><div><div style="font-weight:bold;font-size:16px">Open Music Player</div><div style="font-size:13px;color:var(--ifm-color-emphasis-500);margin-top:2px">Scrolling Lyrics · Apple Music Style · Opens in New Tab</div></div><span style="margin-left:auto;font-size:20px;color:var(--ifm-color-emphasis-400)">↗</span></a>]]></content:encoded>
            <category>Music</category>
            <category>Jay Chou</category>
        </item>
        <item>
            <title><![CDATA[🌐 macOS Network Reset Commands — Quick Reference]]></title>
            <link>https://mikeQ95.github.io/en/blog/2025/05/16/quick-reference-for-macOS network-reset-commands</link>
            <guid>https://mikeQ95.github.io/en/blog/2025/05/16/quick-reference-for-macOS network-reset-commands</guid>
            <pubDate>Sat, 16 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[In most cases, running DNS flush + DHCP reset is enough to fix the majority of network issues.]]></description>
            <content:encoded><![CDATA[<blockquote>
<p>In most cases, running <strong>DNS flush + DHCP reset</strong> is enough to fix the majority of network issues.</p>
</blockquote>
<!-- -->
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="common-commands-in-recommended-order">Common Commands (in recommended order)<a href="https://mikeq95.github.io/en/blog/2025/05/16/quick-reference-for-macOS%20network-reset-commands#common-commands-in-recommended-order" class="hash-link" aria-label="Direct link to Common Commands (in recommended order)" title="Direct link to Common Commands (in recommended order)" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-flush-dns-cache">1. Flush DNS Cache<a href="https://mikeq95.github.io/en/blog/2025/05/16/quick-reference-for-macOS%20network-reset-commands#1-flush-dns-cache" class="hash-link" aria-label="Direct link to 1. Flush DNS Cache" title="Direct link to 1. Flush DNS Cache" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-release-and-renew-ip-address-dhcp">2. Release and Renew IP Address (DHCP)<a href="https://mikeq95.github.io/en/blog/2025/05/16/quick-reference-for-macOS%20network-reset-commands#2-release-and-renew-ip-address-dhcp" class="hash-link" aria-label="Direct link to 2. Release and Renew IP Address (DHCP)" title="Direct link to 2. Release and Renew IP Address (DHCP)" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">sudo ipconfig set en0 DHCP</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-restart-wi-fi">3. Restart Wi-Fi<a href="https://mikeq95.github.io/en/blog/2025/05/16/quick-reference-for-macOS%20network-reset-commands#3-restart-wi-fi" class="hash-link" aria-label="Direct link to 3. Restart Wi-Fi" title="Direct link to 3. Restart Wi-Fi" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">networksetup -setairportpower en0 off &amp;&amp; networksetup -setairportpower en0 on</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-restart-network-interface">4. Restart Network Interface<a href="https://mikeq95.github.io/en/blog/2025/05/16/quick-reference-for-macOS%20network-reset-commands#4-restart-network-interface" class="hash-link" aria-label="Direct link to 4. Restart Network Interface" title="Direct link to 4. Restart Network Interface" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">sudo ifconfig en0 down &amp;&amp; sudo ifconfig en0 up</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="-full-network-settings-reset-more-thorough">🔧 Full Network Settings Reset (more thorough)<a href="https://mikeq95.github.io/en/blog/2025/05/16/quick-reference-for-macOS%20network-reset-commands#-full-network-settings-reset-more-thorough" class="hash-link" aria-label="Direct link to 🔧 Full Network Settings Reset (more thorough)" title="Direct link to 🔧 Full Network Settings Reset (more thorough)" translate="no">​</a></h2>
<p>Delete network preference files — they will be automatically rebuilt after reboot:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">sudo rm /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo rm /Library/Preferences/SystemConfiguration/preferences.plist</span><br></div></code></pre></div></div>
<blockquote>
<p>⚠️ <strong>Note:</strong> A Mac restart is required after running these. All network configurations will be reset to defaults — Wi-Fi and other settings will need to be reconfigured.</p>
</blockquote>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="-notes">📌 Notes<a href="https://mikeq95.github.io/en/blog/2025/05/16/quick-reference-for-macOS%20network-reset-commands#-notes" class="hash-link" aria-label="Direct link to 📌 Notes" title="Direct link to 📌 Notes" translate="no">​</a></h2>
<table><thead><tr><th>Interface</th><th>Description</th></tr></thead><tbody><tr><td><code>en0</code></td><td>Usually the Wi-Fi wireless adapter</td></tr><tr><td><code>en1</code></td><td>Usually the wired Ethernet adapter</td></tr></tbody></table>
<p>If you're unsure of your interface name, run <code>ifconfig</code> to check.</p>]]></content:encoded>
            <category>macOS</category>
        </item>
        <item>
            <title><![CDATA[Search Engine User Guide]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/05/16/earch-engine-user-guide</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/05/16/earch-engine-user-guide</guid>
            <pubDate>Sat, 16 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[1. Choosing a Search Engine]]></description>
            <content:encoded><![CDATA[<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-choosing-a-search-engine">1. Choosing a Search Engine<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#1-choosing-a-search-engine" class="hash-link" aria-label="Direct link to 1. Choosing a Search Engine" title="Direct link to 1. Choosing a Search Engine" translate="no">​</a></h3>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="recommended-order">Recommended Order<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#recommended-order" class="hash-link" aria-label="Direct link to Recommended Order" title="Direct link to Recommended Order" translate="no">​</a></h4>
<p>Move away from Baidu. The following engines all make solid alternatives:</p>
<table><thead><tr><th>Engine</th><th>Best For</th></tr></thead><tbody><tr><td><strong>Google</strong></td><td>Everyday searches, first choice</td></tr><tr><td><strong>DuckDuckGo</strong></td><td>Controversial topics, privacy protection</td></tr><tr><td><strong>Yandex</strong></td><td>Raw content, software resources, music</td></tr><tr><td><strong>Brave</strong></td><td>Everyday searches, secondary option</td></tr><tr><td><strong>Bing</strong></td><td>Casual use or transitioning from Baidu</td></tr></tbody></table>
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="engine-characteristics">Engine Characteristics<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#engine-characteristics" class="hash-link" aria-label="Direct link to Engine Characteristics" title="Direct link to Engine Characteristics" translate="no">​</a></h4>
<ul>
<li class=""><strong>Google</strong>: Results for controversial content lean toward mainstream PC viewpoints; opposing views are sparse and weak</li>
<li class=""><strong>DuckDuckGo</strong>: More neutral than Google; no keyword highlighting in results (fixable with a userscript — see end of post)</li>
<li class=""><strong>Yandex</strong>: Completely ignores Western political correctness; good for sensitive or edgy content<!-- -->
<ul>
<li class="">e.g. Search "Epstein list" — only Yandex puts the actual list at the top</li>
<li class="">e.g. Search "Hollywood scandals" — only Yandex shows hard-hitting results</li>
</ul>
</li>
<li class=""><strong>Political correctness level</strong>: <code>Google &gt; Brave &gt; DuckDuckGo &gt; Yandex</code></li>
</ul>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-practical-search-tips">2. Practical Search Tips<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#2-practical-search-tips" class="hash-link" aria-label="Direct link to 2. Practical Search Tips" title="Direct link to 2. Practical Search Tips" translate="no">​</a></h3>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="software-resources-for-students">Software Resources (for students)<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#software-resources-for-students" class="hash-link" aria-label="Direct link to Software Resources (for students)" title="Direct link to Software Resources (for students)" translate="no">​</a></h4>
<p>Use <strong>Yandex</strong> and search:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">software name + cracked / premium / unlocked</span><br></div></code></pre></div></div>
<p>Works for Android, PC, and Mac.</p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="free-music-downloads-for-students">Free Music Downloads (for students)<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#free-music-downloads-for-students" class="hash-link" aria-label="Direct link to Free Music Downloads (for students)" title="Direct link to Free Music Downloads (for students)" translate="no">​</a></h4>
<p>Use <strong>Yandex</strong> and search:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">song name + free download</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">song name + Скачать</span><br></div></code></pre></div></div>
<p>Look for results with Russian-language links — they usually allow direct download.</p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="site-specific-search">Site-Specific Search<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#site-specific-search" class="hash-link" aria-label="Direct link to Site-Specific Search" title="Direct link to Site-Specific Search" translate="no">​</a></h4>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">keyword site:https://x.com</span><br></div></code></pre></div></div>
<p>Useful for resource sites with poor built-in search.</p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="finding-e-books-annas-archive--z-library">Finding E-books (Anna's Archive / Z-Library)<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#finding-e-books-annas-archive--z-library" class="hash-link" aria-label="Direct link to Finding E-books (Anna's Archive / Z-Library)" title="Direct link to Finding E-books (Anna's Archive / Z-Library)" translate="no">​</a></h4>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">keyword + edition      # search for revised editions — usually higher quality, e.g.: tort edition</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">keyword + translation  # search for translated versions</span><br></div></code></pre></div></div>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="using-douban-to-find-good-books">Using Douban to Find Good Books<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#using-douban-to-find-good-books" class="hash-link" aria-label="Direct link to Using Douban to Find Good Books" title="Direct link to Using Douban to Find Good Books" translate="no">​</a></h4>
<p>Search on Douban → filter by high ratings; the book detail page also recommends similar titles.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-duckduckgo-keyword-highlight-userscript">3. DuckDuckGo Keyword Highlight Userscript<a href="https://mikeq95.github.io/en/blog/2026/05/16/earch-engine-user-guide#3-duckduckgo-keyword-highlight-userscript" class="hash-link" aria-label="Direct link to 3. DuckDuckGo Keyword Highlight Userscript" title="Direct link to 3. DuckDuckGo Keyword Highlight Userscript" translate="no">​</a></h3>
<blockquote>
<p>Requires the <a href="https://www.tampermonkey.net/" target="_blank" rel="noopener noreferrer" class="">Tampermonkey</a> browser extension.</p>
</blockquote>
<div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic">// ==UserScript==</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// @name         DuckDuckGo Search Keyword Highlight</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// @namespace    http://tampermonkey.net/</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// @version      2025-08-05</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// @description  Highlights search keywords in DuckDuckGo results</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// @author       You</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// @match        https://duckduckgo.com/?*</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// @grant        GM_addStyle</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// ==/UserScript==</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">(</span><span class="token keyword" style="color:#00009f">function</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">'use strict'</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token function maybe-class-name" style="color:#d73a49">GM_addStyle</span><span class="token punctuation" style="color:#393A34">(</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c"></span><br></div><div class="token-line" style="color:#393A34"><span class="token template-string string" style="color:#e3116c">        .kY2IgmnCmOGjharHErah span b {</span><br></div><div class="token-line" style="color:#393A34"><span class="token template-string string" style="color:#e3116c">            color: #ff897e !important;</span><br></div><div class="token-line" style="color:#393A34"><span class="token template-string string" style="color:#e3116c">        }</span><br></div><div class="token-line" style="color:#393A34"><span class="token template-string string" style="color:#e3116c">    </span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></div></code></pre></div></div>]]></content:encoded>
            <category>Collection</category>
        </item>
        <item>
            <title><![CDATA[Convert Articles to Podcast Audio with Kokoro — A Full Deployment Guide]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial</guid>
            <pubDate>Sat, 16 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[This post documents how to locally deploy Kokoro TTS on a Mac (Apple Silicon) via Docker to convert English/Chinese articles into high-quality audio.]]></description>
            <content:encoded><![CDATA[<blockquote>
<p>This post documents how to locally deploy Kokoro TTS on a Mac (Apple Silicon) via Docker to convert English/Chinese articles into high-quality audio.</p>
</blockquote>
<!-- -->
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-why-kokoro">1. Why Kokoro?<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#1-why-kokoro" class="hash-link" aria-label="Direct link to 1. Why Kokoro?" title="Direct link to 1. Why Kokoro?" translate="no">​</a></h2>
<p>After evaluating several open-source TTS solutions, here's why <strong>Kokoro + kokoro-web</strong> came out on top:</p>
<table><thead><tr><th>Solution</th><th>Stars</th><th>English Quality</th><th>Voice Variety</th><th>License</th></tr></thead><tbody><tr><td><strong>Kokoro</strong></td><td>7k+</td><td>⭐ Top-tier</td><td>88 options</td><td>Apache 2.0</td></tr><tr><td>ChatTTS</td><td>~33k</td><td>Moderate</td><td>Random, non-selectable</td><td>CC BY-NC (non-commercial)</td></tr><tr><td>CosyVoice</td><td>High</td><td>Decent</td><td>Best Chinese</td><td>Apache 2.0</td></tr></tbody></table>
<p><strong>Key advantages of Kokoro:</strong></p>
<ul>
<li class="">English quality approaches ElevenLabs commercial level</li>
<li class="">88 voices (American/British, male/female, A–D quality grades)</li>
<li class="">82M parameters — lightweight, runs directly on M1 Mac CPU</li>
<li class="">Apache 2.0 — free for commercial use</li>
</ul>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-voice-quality-grades">2. Voice Quality Grades<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#2-voice-quality-grades" class="hash-link" aria-label="Direct link to 2. Voice Quality Grades" title="Direct link to 2. Voice Quality Grades" translate="no">​</a></h2>
<p>Kokoro voices are graded A–D, with <strong>A being the highest</strong>:</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="english-us--recommended">English (US) — Recommended<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#english-us--recommended" class="hash-link" aria-label="Direct link to English (US) — Recommended" title="Direct link to English (US) — Recommended" translate="no">​</a></h3>
<table><thead><tr><th>Voice</th><th>Grade</th><th>Style</th></tr></thead><tbody><tr><td>Heart</td><td>A</td><td>Warm female voice (top pick)</td></tr><tr><td>Bella</td><td>A-</td><td>High-quality female voice</td></tr><tr><td>Nicole</td><td>B-</td><td>Natural female voice</td></tr><tr><td>Michael</td><td>C+</td><td>Mature male voice</td></tr></tbody></table>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="english-uk--recommended">English (UK) — Recommended<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#english-uk--recommended" class="hash-link" aria-label="Direct link to English (UK) — Recommended" title="Direct link to English (UK) — Recommended" translate="no">​</a></h3>
<table><thead><tr><th>Voice</th><th>Grade</th><th>Style</th></tr></thead><tbody><tr><td>Emma</td><td>B-</td><td>British female voice</td></tr><tr><td>George</td><td>C</td><td>British male voice</td></tr></tbody></table>
<blockquote>
<p>💡 The first time you use a voice, its <code>.bin</code> file is downloaded automatically and cached — no need to re-download.</p>
</blockquote>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-deployment-options">3. Deployment Options<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#3-deployment-options" class="hash-link" aria-label="Direct link to 3. Deployment Options" title="Direct link to 3. Deployment Options" translate="no">​</a></h2>
<table><thead><tr><th></th><th>Docker Compose</th><th>From Source</th><th>Browser (WebGPU)</th></tr></thead><tbody><tr><td>Difficulty</td><td>⭐⭐</td><td>⭐⭐⭐</td><td>⭐</td></tr><tr><td>Requires</td><td>Docker</td><td>Node.js + npm</td><td>Nothing</td></tr><tr><td>Best For</td><td>Daily local use</td><td>Developers modifying source</td><td>Occasional testing</td></tr></tbody></table>
<p><strong>Verdict: Docker Compose is the recommended approach for daily use.</strong></p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-prerequisites">4. Prerequisites<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#4-prerequisites" class="hash-link" aria-label="Direct link to 4. Prerequisites" title="Direct link to 4. Prerequisites" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-install-docker-desktop">1. Install Docker Desktop<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#1-install-docker-desktop" class="hash-link" aria-label="Direct link to 1. Install Docker Desktop" title="Direct link to 1. Install Docker Desktop" translate="no">​</a></h3>
<p>Download Docker Desktop from the official site: <a href="https://www.docker.com/products/docker-desktop/" target="_blank" rel="noopener noreferrer" class="">docker.com</a></p>
<p>Download the <code>.dmg</code> file, double-click to install, open Docker Desktop, and wait for it to start (a 🐳 icon appears in the menu bar).</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-configure-the-command-line-path-permanent">2. Configure the Command-Line Path (permanent)<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#2-configure-the-command-line-path-permanent" class="hash-link" aria-label="Direct link to 2. Configure the Command-Line Path (permanent)" title="Direct link to 2. Configure the Command-Line Path (permanent)" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">echo 'export PATH="$PATH:/Applications/Docker.app/Contents/Resources/bin"' &gt;&gt; ~/.zshrc</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">source ~/.zshrc</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-verify-installation">3. Verify Installation<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#3-verify-installation" class="hash-link" aria-label="Direct link to 3. Verify Installation" title="Direct link to 3. Verify Installation" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">docker --version &amp;&amp; docker compose version</span><br></div></code></pre></div></div>
<p>Expected output:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Docker version 29.4.3, build 055a478</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Docker Compose version v5.1.3</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="5-deploy-kokoro-web">5. Deploy kokoro-web<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#5-deploy-kokoro-web" class="hash-link" aria-label="Direct link to 5. Deploy kokoro-web" title="Direct link to 5. Deploy kokoro-web" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-create-a-project-directory">1. Create a Project Directory<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#1-create-a-project-directory" class="hash-link" aria-label="Direct link to 1. Create a Project Directory" title="Direct link to 1. Create a Project Directory" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">mkdir kokoro-web &amp;&amp; cd kokoro-web</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-create-composeyaml">2. Create <code>compose.yaml</code><a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#2-create-composeyaml" class="hash-link" aria-label="Direct link to 2-create-composeyaml" title="Direct link to 2-create-composeyaml" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">cat &gt; compose.yaml &lt;&lt; 'EOF'</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">services:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  kokoro-web:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    image: ghcr.io/eduardolat/kokoro-web:latest</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ports:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      - "3000:3000"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    environment:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      - KW_SECRET_API_KEY=my-secret-key</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    volumes:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      - ./kokoro-cache:/kokoro/cache  # cache models to avoid re-downloading</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    restart: unless-stopped</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">EOF</span><br></div></code></pre></div></div>
<blockquote>
<p><code>KW_SECRET_API_KEY</code> is the access password for the local service — for local use, any value works.</p>
</blockquote>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-start-the-service">3. Start the Service<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#3-start-the-service" class="hash-link" aria-label="Direct link to 3. Start the Service" title="Direct link to 3. Start the Service" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">docker compose up -d</span><br></div></code></pre></div></div>
<p>The first start pulls the image, which may take a few minutes.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-verify-its-running">4. Verify It's Running<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#4-verify-its-running" class="hash-link" aria-label="Direct link to 4. Verify It's Running" title="Direct link to 4. Verify It's Running" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">docker compose logs -f</span><br></div></code></pre></div></div>
<p>When you see <code>Listening on http://0.0.0.0:3000</code>, the service is up.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="6-using-the-webui">6. Using the WebUI<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#6-using-the-webui" class="hash-link" aria-label="Direct link to 6. Using the WebUI" title="Direct link to 6. Using the WebUI" translate="no">​</a></h2>
<p>Open your browser and go to:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">http://localhost:3000</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="key-settings">Key Settings<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#key-settings" class="hash-link" aria-label="Direct link to Key Settings" title="Direct link to Key Settings" translate="no">​</a></h3>
<table><thead><tr><th>Option</th><th>Recommended Value</th><th>Notes</th></tr></thead><tbody><tr><td><strong>Execution place</strong></td><td><code>API (Self-hosted)</code></td><td>Use local Docker model, not in-browser</td></tr><tr><td><strong>API URL</strong></td><td><code>http://localhost:3000/api/v1</code></td><td>Local service address</td></tr><tr><td><strong>API Key</strong></td><td><code>my-secret-key</code></td><td>Same as the value in compose.yaml</td></tr><tr><td><strong>Model quantization</strong></td><td><code>model (q8f16)</code></td><td>Best balance of speed and quality</td></tr><tr><td><strong>Voice quality</strong></td><td><code>Heart (A)</code></td><td>Top recommendation</td></tr></tbody></table>
<blockquote>
<p>⚠️ <strong>Important</strong>: Always set <code>Execution place</code> to <code>API (Self-hosted)</code>. Running in the browser is very slow.</p>
</blockquote>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="7-markdown-file-input">7. Markdown File Input<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#7-markdown-file-input" class="hash-link" aria-label="Direct link to 7. Markdown File Input" title="Direct link to 7. Markdown File Input" translate="no">​</a></h2>
<p>Kokoro only accepts plain text natively. Feeding a <code>.md</code> file directly will cause it to read out <code>##</code>, <code>**bold**</code>, and other Markdown syntax aloud.</p>
<p><strong>Solution</strong>: Use <code>pandoc</code> to convert first:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Install pandoc</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">brew install pandoc</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Convert and generate audio</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">pandoc article.md -t plain | kokoro-tts - output.mp3 --voice am_michael</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="8-generation-speed">8. Generation Speed<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#8-generation-speed" class="hash-link" aria-label="Direct link to 8. Generation Speed" title="Direct link to 8. Generation Speed" translate="no">​</a></h2>
<p>Factors that affect speed:</p>
<ul>
<li class=""><strong>Article length</strong>: scales linearly — ~300 words takes 30–60 seconds</li>
<li class=""><strong>Model quantization</strong>: <code>fp32</code> is slowest, <code>q8f16</code> is balanced, <code>q4</code> is fastest</li>
<li class=""><strong>Execution location</strong>: <code>API (Self-hosted)</code> runs on CPU; <code>Browser</code> uses GPU but requires an initial model download</li>
</ul>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="9-common-management-commands">9. Common Management Commands<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#9-common-management-commands" class="hash-link" aria-label="Direct link to 9. Common Management Commands" title="Direct link to 9. Common Management Commands" translate="no">​</a></h2>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">docker compose logs -f    # view live logs</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">docker compose stop       # stop the service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">docker compose start      # start the service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">docker compose restart    # restart the service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">docker compose pull       # update to the latest version</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="10-related-links">10. Related Links<a href="https://mikeq95.github.io/en/blog/2026/05/16/kokoro-tts-tutorial#10-related-links" class="hash-link" aria-label="Direct link to 10. Related Links" title="Direct link to 10. Related Links" translate="no">​</a></h2>
<table><thead><tr><th>Resource</th><th>URL</th></tr></thead><tbody><tr><td>Kokoro model (core)</td><td>github.com/hexgrad/kokoro</td></tr><tr><td>Model weights</td><td>huggingface.co/hexgrad/Kokoro-82M</td></tr><tr><td>Live demo</td><td>hf.co/spaces/hexgrad/Kokoro-TTS</td></tr><tr><td>kokoro-web (WebUI)</td><td>github.com/eduardolat/kokoro-web</td></tr></tbody></table>
<hr>
<p><em>Deployment environment: MacBook Pro M1 Pro · macOS · Docker Desktop 29.4.3</em></p>]]></content:encoded>
            <category>GitHub</category>
            <category>macOS</category>
        </item>
        <item>
            <title><![CDATA[Programming English Vocabulary Collection]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/04/29/coding-english-vocabulary</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/04/29/coding-english-vocabulary</guid>
            <pubDate>Wed, 29 Apr 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[1. demonstrate]]></description>
            <content:encoded><![CDATA[<ol>
<li class="">
<p><strong>demonstrate</strong></p>
<ul>
<li class="">Example: This tutorial no longer ==demonstrates== current SwiftUI or Xcode practices.</li>
<li class="">Meaning: to show or illustrate something; to demonstrate</li>
</ul>
</li>
</ol>
<!-- -->
<ol start="2">
<li class="">
<p><strong>prevent</strong></p>
<ul>
<li class="">Example: This option will ==prevent== Shadowrocket from being set as the default route.</li>
<li class="">Meaning: to stop something from happening; to block</li>
</ul>
</li>
<li class="">
<p><strong>modifier</strong></p>
<ul>
<li class="">Example: A new ==modifier== creates a new view based on the original one.</li>
<li class="">Meaning: (in SwiftUI) a method that transforms or configures a view</li>
</ul>
</li>
<li class="">
<p><strong>components</strong></p>
<ul>
<li class="">Example: One of the most common and recognizable user interface ==components== is the combination of an icon and a label.</li>
<li class="">Meaning: individual parts or elements that make up a larger system; components</li>
</ul>
</li>
<li class="">
<p><strong>idiom</strong></p>
<ul>
<li class="">Example: This ==idiom== appears across many kinds of apps and shows up in collections, lists, menus of action items, and disclosable lists, just to name a few.</li>
<li class="">Meaning: a common pattern or convention in UI/programming; an established way of doing something</li>
</ul>
</li>
<li class="">
<p><strong>just to name a few</strong></p>
<ul>
<li class="">Example: This idiom appears across many kinds of apps and shows up in collections, lists, menus of action items, and disclosable lists, ==just to name a few==.</li>
<li class="">Meaning: used to indicate that only a small number of examples are being given; "among others"</li>
</ul>
</li>
<li class="">
<p><strong>interface</strong></p>
<ul>
<li class="">Example: You create the user ==interface==, or UI, for your app inside the body; the entire contents of your app are in the code below.</li>
<li class="">Meaning: the visual layer of an application that users interact with; user interface (UI)</li>
</ul>
</li>
</ol>
<div class="language-swift codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-swift codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic">// NOTE: - Demo code</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token class-name">SwiftUI</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">struct</span><span class="token plain"> </span><span class="token class-name">ContentView</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token class-name">View</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token keyword" style="color:#00009f">var</span><span class="token plain"> body</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">some</span><span class="token plain"> </span><span class="token class-name">View</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token class-name">VStack</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token class-name">Image</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">systemName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string-literal string" style="color:#e3116c">"globe"</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">imageScale</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">large</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                </span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">foregroundColor</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">tint</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token class-name">Text</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string-literal string" style="color:#e3116c">"Hello World"</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token other-directive property" style="color:#36acaa">#Preview</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token class-name">ContentView</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></div></code></pre></div></div>
<ol start="8">
<li class="">
<p><strong>instance</strong></p>
<ul>
<li class="">Example: To construct your narrative, the app needs an ==instance== of Story, which takes an array of StoryPage instances.</li>
<li class="">Meaning: a specific occurrence of an object created from a class or struct</li>
</ul>
</li>
<li class="">
<p><strong>hold</strong></p>
<ul>
<li class="">Example: The text property ==holds== a String that describes the choice readers can make.</li>
<li class="">Meaning: to store or contain a value; to hold</li>
</ul>
</li>
<li class="">
<p><strong>present</strong></p>
<ul>
<li class="">Example: Use a navigation stack to ==present== a stack of views over a root view.</li>
<li class="">Meaning: to display or show a view on screen</li>
</ul>
</li>
<li class="">
<p><strong>indicates</strong></p>
<ul>
<li class="">Example: A value-destination ==indicates== that you are pushing a value onto the path.</li>
<li class="">Meaning: to signal or show that something is the case; to indicate</li>
</ul>
</li>
</ol>]]></content:encoded>
            <category>English</category>
            <category>Swift</category>
            <category>Collection</category>
        </item>
        <item>
            <title><![CDATA[General English Vocabulary Collection]]></title>
            <link>https://mikeQ95.github.io/en/blog/2026/04/29/general-english-vocabulary</link>
            <guid>https://mikeQ95.github.io/en/blog/2026/04/29/general-english-vocabulary</guid>
            <pubDate>Wed, 29 Apr 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[1. Based on the principle of voluntariness]]></description>
            <content:encoded><![CDATA[<ol>
<li class="">
<p><strong>Based on the principle of voluntariness</strong></p>
<ul>
<li class="">Example: Membership in the union is ==based on the principle of voluntariness==—no employee is forced to join.</li>
<li class="">Meaning: following the principle that participation is entirely a personal choice; voluntary basis</li>
</ul>
</li>
</ol>
<!-- -->
<ol start="2">
<li class="">
<p><strong>One for all, all for one</strong></p>
<ul>
<li class="">Example: The three friends made a pact: ==one for all, all for one==. They promised to stand by each other no matter what challenges lay ahead.</li>
<li class="">Meaning: a phrase expressing mutual support and solidarity within a group</li>
</ul>
</li>
<li class="">
<p><strong>Be careful, though</strong></p>
<ul>
<li class="">Example: The restaurant is amazing and cheap. ==Be careful==, though: it gets really crowded on weekends.</li>
<li class="">Meaning: used to add a warning or caveat after a positive statement; "that said, watch out for..."</li>
</ul>
</li>
<li class="">
<p><strong>embedded in</strong></p>
<ul>
<li class="">Example: These attitudes are ==embedded in== our society.</li>
<li class="">Meaning: deeply ingrained or firmly fixed within something; deeply rooted in</li>
</ul>
</li>
<li class="">
<p><strong>enthusiasts</strong></p>
<ul>
<li class="">Example: She is one of the most dedicated fitness ==enthusiasts== I have ever met.</li>
<li class="">Meaning: people who are highly interested in and passionate about a particular activity or subject</li>
</ul>
</li>
</ol>]]></content:encoded>
            <category>English</category>
            <category>Collection</category>
        </item>
    </channel>
</rss>