<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: UserName</title>
    <description>The latest articles on DEV Community by UserName (@satkarjuneja).</description>
    <link>https://dev.to/satkarjuneja</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3876981%2Fbef2c547-9a84-433d-9835-a75f9a949047.png</url>
      <title>DEV Community: UserName</title>
      <link>https://dev.to/satkarjuneja</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/satkarjuneja"/>
    <language>en</language>
    <item>
      <title>I accidentally found a way to avoid youtube ads by not loading them at all</title>
      <dc:creator>UserName</dc:creator>
      <pubDate>Mon, 13 Apr 2026 15:38:09 +0000</pubDate>
      <link>https://dev.to/satkarjuneja/i-accidentally-found-a-way-to-avoid-youtube-ads-by-not-loading-them-at-all-imf</link>
      <guid>https://dev.to/satkarjuneja/i-accidentally-found-a-way-to-avoid-youtube-ads-by-not-loading-them-at-all-imf</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1s5yxfg1b5bfxosxvc9.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1s5yxfg1b5bfxosxvc9.jpeg" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;YouTube ads are served by the browser's web player. So if you skip the browser entirely and stream directly using CLI tools, the ad delivery system is never involved not blocked, just never requested.&lt;/p&gt;

&lt;p&gt;The setup is simple: &lt;code&gt;yt-dlp&lt;/code&gt; resolves a search query into a direct stream URL, and &lt;code&gt;mpv&lt;/code&gt; plays it. No browser opens, no web player loads, no ads.&lt;/p&gt;

&lt;p&gt;I wrapped this into a small desktop GUI called. You type a search, hit play, and mpv starts streaming. Supports audio-only or video mode, pause/stop, and uses mpv's IPC socket so controls actually work properly.&lt;/p&gt;

&lt;p&gt;The whole thing is about 200 lines of Python and Tkinter.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Search query → yt-dlp → direct stream URL → mpv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;yt-dlp handles the &lt;code&gt;ytsearch1:&lt;/code&gt; prefix, so you never need to copy a URL. Just type what you want to hear or watch.&lt;/p&gt;

&lt;p&gt;For video mode, yt-dlp fetches separate video and audio stream URLs and passes both to mpv via &lt;code&gt;--audio-file&lt;/code&gt;, which is how YouTube serves high-quality streams anyway.&lt;/p&gt;

&lt;p&gt;mpv gets an IPC socket at &lt;code&gt;/tmp/mpvsocket&lt;/code&gt; so pause, stop, and future controls can send commands directly without needing to track the subprocess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Have a look
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/satkarjuneja/Playbin" rel="noopener noreferrer"&gt;github.com/satkarjuneja/Playbin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Only hard dependency is &lt;code&gt;mpv&lt;/code&gt;. yt-dlp is bundled.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Please give feedback of any better solutions of this sort&lt;br&gt;
Thanks.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>showdev</category>
      <category>sideprojects</category>
    </item>
  </channel>
</rss>
