<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Alessandro Pogliaghi's Blog</title><image><url>https://apogliaghi.com/img/favicon/favicon.png</url><title>Selfhosted on Alessandro Pogliaghi</title><link>https://apogliaghi.com/categories/selfhosted/</link></image><link>https://apogliaghi.com/categories/selfhosted/</link><description>Recent content in Selfhosted on Alessandro Pogliaghi</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>apogliaghi@gmail.com (Alessandro Pogliaghi)</managingEditor><webMaster>apogliaghi@gmail.com (Alessandro Pogliaghi)</webMaster><copyright>Alessandro Pogliaghi ~ 2026 | Made with ❤️ in<span class='emoji'>🇪🇺</span></copyright><lastBuildDate>Sun, 04 Jan 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://apogliaghi.com/categories/selfhosted/index.xml" rel="self" type="application/rss+xml"/><atom:link href="https://apogliaghi.com/" rel="alternate" type="text/html"/><item><title>Forking MeTube ~ You can just do stuff</title><link>https://apogliaghi.com/2026/01/forking-metube-~-you-can-just-do-stuff/</link><pubDate>Sun, 04 Jan 2026 00:00:00 +0000</pubDate><author>apogliaghi@gmail.com (Alessandro Pogliaghi)</author><guid>https://apogliaghi.com/2026/01/forking-metube-~-you-can-just-do-stuff/</guid><description>
&lt;h2 id="the-itch">
The Itch
&lt;a href="#the-itch" class="h-anchor" aria-hidden="true">#&lt;/a>
&lt;/h2>
&lt;p>&lt;a href="https://github.com/alexta69/metube">MeTube&lt;/a> is a neat self-hosted YouTube downloader with a clean web UI. Paste a link, pick your format, hit download. Simple.&lt;/p>
&lt;p>Except YouTube decided that simple things shouldn&amp;rsquo;t stay simple.&lt;/p>
&lt;p>At some point, downloads started failing with the lovely &amp;ldquo;Sign in to confirm you&amp;rsquo;re not a bot&amp;rdquo; message. Classic. YouTube&amp;rsquo;s bot detection had gotten stricter, the web is not fun anymore.&lt;/p>
&lt;p>On top of that, I wanted my downloaded videos to actually show up properly in Jellyfin instead of appearing as mysterious &amp;ldquo;Unknown&amp;rdquo; entries with no metadata. Two itches, one fork.&lt;/p>
&lt;figure class="center" >
&lt;img src="https://apogliaghi.com/img/_metube-pot/metube_homepage.png"
/>
&lt;figcaption class="center" >MeTube POT interface&lt;/figcaption>
&lt;/figure>
&lt;h2 id="pot-proof-of-origin-support">
POT (Proof-of-Origin) Support
&lt;a href="#pot-proof-of-origin-support" class="h-anchor" aria-hidden="true">#&lt;/a>
&lt;/h2>
&lt;p>YouTube&amp;rsquo;s anti-bot measures work by requiring a &amp;ldquo;Proof-of-Origin&amp;rdquo; token, basically proving that the request comes from a legitimate browser session rather than some script hammering their servers.&lt;/p>
&lt;p>The fix? &lt;a href="https://github.com/Brainicism/bgutil-ytdlp-pot-provider">bgutil-ytdlp-pot-provider&lt;/a>. It&amp;rsquo;s a yt-dlp plugin that generates these POT tokens, making YouTube believe the requests are coming from an actual browser.&lt;/p>
&lt;h2 id="jellyfin-integration">
Jellyfin Integration
&lt;a href="#jellyfin-integration" class="h-anchor" aria-hidden="true">#&lt;/a>
&lt;/h2>
&lt;figure class="center" >
&lt;img src="https://apogliaghi.com/img/_metube-pot/jellyfin_homepage.png"
/>
&lt;figcaption class="center" >Video properly displayed in Jellyfin with full metadata&lt;/figcaption>
&lt;/figure>
&lt;p>Here&amp;rsquo;s the thing about downloading YouTube videos: yt-dlp can grab a ton of metadata and save it as a &lt;code>.info.json&lt;/code> file alongside the video. Title, description, upload date, channel name, tags, duration, everything.&lt;/p>
&lt;p>Jellyfin, however, doesn&amp;rsquo;t speak &lt;code>.info.json&lt;/code>. It wants &lt;code>.nfo&lt;/code> files, an XML format that media servers have used since the Kodi days.&lt;/p>
&lt;p>So I wrote a post-processor hook that runs after each download completes.&lt;/p>
&lt;p>It reads the &lt;code>.info.json&lt;/code>, extracts the relevant fields, and generates a Jellyfin-compatible &lt;code>.nfo&lt;/code> file. The metadata mapping looks like this:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Title&lt;/strong> and &lt;strong>Original Title&lt;/strong> from the video title&lt;/li>
&lt;li>&lt;strong>Plot&lt;/strong> from the description&lt;/li>
&lt;li>&lt;strong>Year&lt;/strong> and &lt;strong>Premiered&lt;/strong> from the upload date&lt;/li>
&lt;li>&lt;strong>Studio&lt;/strong> and &lt;strong>Director&lt;/strong> mapped to the uploader/channel&lt;/li>
&lt;li>&lt;strong>Tags&lt;/strong> from the video tags (capped at 20 to keep things sane)&lt;/li>
&lt;li>&lt;strong>Runtime&lt;/strong> converted from seconds to minutes&lt;/li>
&lt;li>&lt;strong>Unique ID&lt;/strong> storing the YouTube video ID&lt;/li>
&lt;/ul>
&lt;p>After generating the &lt;code>.nfo&lt;/code>, the hook cleans up by deleting the original &lt;code>.info.json&lt;/code>. No leftover clutter.&lt;/p>
&lt;h2 id="keeping-up-with-upstream">
Keeping Up with Upstream
&lt;a href="#keeping-up-with-upstream" class="h-anchor" aria-hidden="true">#&lt;/a>
&lt;/h2>
&lt;figure class="center" >
&lt;img src="https://apogliaghi.com/img/_metube-pot/aint_nobody.png"
width="600px"
/>
&lt;figcaption class="center" >Creating a meme without Nano Banana 🍌? Ain&amp;rsquo;t nobody got time for that!&lt;/figcaption>
&lt;/figure>
&lt;p>Forking is easy. Maintaining a fork? Not so fun.&lt;/p>
&lt;p>The upstream MeTube repo keeps getting updates: bug fixes, new features, dependency bumps.&lt;/p>
&lt;p>I automated this with a GitHub Action (lame, I know) that runs weekly. Here&amp;rsquo;s what it does:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Fetches the latest upstream release&lt;/strong> from the original MeTube repo&lt;/li>
&lt;li>&lt;strong>Checks if it&amp;rsquo;s already been analyzed&lt;/strong> (no point in creating duplicate reports)&lt;/li>
&lt;li>&lt;strong>Generates a diff&lt;/strong> between the fork and the new release&lt;/li>
&lt;li>&lt;strong>Sends the diff to an LLM&lt;/strong> for analysis because, I ain&amp;rsquo;t got time for that&lt;/li>
&lt;li>&lt;strong>Creates a GH issue&lt;/strong> with the analysis report&lt;/li>
&lt;/ol>
&lt;p>The result? A nicely formatted issue telling me whether I should bother merging upstream changes or if I can safely ignore them. The boring parts of fork maintenance, automated.&lt;/p>
&lt;h2 id="use-it-yourself">
Use it yourself
&lt;a href="#use-it-yourself" class="h-anchor" aria-hidden="true">#&lt;/a>
&lt;/h2>
&lt;p>The fork lives at &lt;a href="https://github.com/tatoalo/metube_pot">tatoalo/metube_pot&lt;/a>. If you&amp;rsquo;re running MeTube and hitting YouTube&amp;rsquo;s bot detection, or you want your downloads to play nice with Jellyfin, give it a spin:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>docker pull ghcr.io/tatoalo/metube_pot
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Sometimes you just see something that&amp;rsquo;s 90% of what you need, and the remaining 10% is an afternoon of hacking. Fork stuff, scratch your own itches, automate the tedious parts.&lt;/p>
&lt;p>&lt;strong>Note&lt;/strong>: I don&amp;rsquo;t condone piracy. Use this tool responsibly and ethically. Also, respect YouTube&amp;rsquo;s terms of service and copyright laws. 🤷‍♂️&lt;/p>
&lt;p>&lt;strong>Note&lt;/strong>: This has been done for fun and for research purposes. 🤷‍♂️🤷‍♂️&lt;/p></description></item></channel></rss>