<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Dan Clowry's Blog]]></title><description><![CDATA[My personal blog for sharing whats on my mind]]></description><link>https://danclowry.com/blog/</link><image><url>https://danclowry.com/blog/favicon.png</url><title>Dan Clowry&apos;s Blog</title><link>https://danclowry.com/blog/</link></image><generator>Ghost 5.75</generator><lastBuildDate>Thu, 11 Jun 2026 18:59:19 GMT</lastBuildDate><atom:link href="https://danclowry.com/blog/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Using Checkpoint Avanan and Microsoft 365 Quarantine]]></title><description><![CDATA[Enable Unified Quarantine reports in Checkpoint Avanan to consolidate 365 and Checkpoint quarantined emails into a single end-user report.]]></description><link>https://danclowry.com/blog/using-checkpoint-avanan-quarantine-with-microsoft-365/</link><guid isPermaLink="false">656db248ab518772a642d8ba</guid><dc:creator><![CDATA[Daniel Clowry]]></dc:creator><pubDate>Tue, 12 Dec 2023 10:20:25 GMT</pubDate><media:content url="https://danclowry.com/blog/content/images/2023/12/report-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://danclowry.com/blog/content/images/2023/12/report-1.png" alt="Using Checkpoint Avanan and Microsoft 365 Quarantine"><p><em>Throughout this article I&apos;ll be refering to Avanan as &quot;Checkpoint&quot; now that it has been acquired by Checkpoint and merged into their product line.</em></p><p><em>Last updated 12 December 2023<br>Checkpoint system version PROD_2023_w49_6</em></p><h1 id="intro"><em>Intro</em></h1><p>I work for an Australian MSP servicing SMB clients. Earlier this year we began replacing our previous security email gateway service with Checkpoint Protect/Avanan throughout our client setups.</p><p>One issue we struggled with during our initial deployment was handling quarantined messages. Most SEG solutions require you to replace your domain&apos;s MX record with the SEG&apos;s mailserver and create transport rules in Exchange to completely bypass 365&apos;s spam filtering. Checkpoint on the other hand works in addition to Exchange&apos;s built in protection by&#xA0;<a href="https://www.avanan.com/blog/the-problem-with-blinding-default-security?ref=danclowry.com">scanning emails using APIs</a>. This means your emails are protected with an additional layer of security through Exchange Online Protection/Defender for Office 365 but also means you&apos;re now managing two sets of filtering policies and importantly, two sets of quarantine systems.</p><p>Having to deal with two sets of quarantine systems adds unnecessary complexity for end users as well as techs. Users would receive digests from both systems, and would need to deal with two different UIs for viewing &amp; releasing email. Similarly, techs would need to check two systems when investigating quarantined emails and we needed to separately integrate both Checkpoint and 365 quarantine into our ticketing system. Luckily since June 2023 Checkpoint has a new &quot;<a href="https://blog.checkpoint.com/product-updates/unified-quarantine/?ref=danclowry.com">Unified Quarantine</a>&quot; feature that combines emails quarantined by Microsoft and Checkpoint into a single end-user digest as well as a single portal for techs to action quarantined items.</p><figure class="kg-card kg-image-card kg-width-wide kg-card-hascaption"><img src="https://danclowry.com/blog/content/images/2023/12/report.png" class="kg-image" alt="Using Checkpoint Avanan and Microsoft 365 Quarantine" loading="lazy" width="1540" height="649" srcset="https://danclowry.com/blog/content/images/size/w600/2023/12/report.png 600w, https://danclowry.com/blog/content/images/size/w1000/2023/12/report.png 1000w, https://danclowry.com/blog/content/images/2023/12/report.png 1540w" sizes="(min-width: 1200px) 1200px"><figcaption><span style="white-space: pre-wrap;">A Checkpoint quarantine digest. The report contains emails that have been quarantined by both Microsoft and Checkpoint.</span></figcaption></figure><h1 id="enabling-unified-quarantine-notifications">Enabling Unified Quarantine notifications</h1><p>Unified Quarantine digests will contain a list of emails that have been quarantined by both Checkpoint and Microsoft since the last digest. Users can then release, or request release quarantined emails per your Checkpoint Office 365 Mail policy (for emails quarantined by Checkpoint) and the Microsoft release options policy configured in the steps below (for emails quarantined by Microsoft.)</p><figure class="kg-card kg-image-card"><img src="https://danclowry.com/blog/content/images/2023/12/settings-1.png" class="kg-image" alt="Using Checkpoint Avanan and Microsoft 365 Quarantine" loading="lazy" width="1917" height="808" srcset="https://danclowry.com/blog/content/images/size/w600/2023/12/settings-1.png 600w, https://danclowry.com/blog/content/images/size/w1000/2023/12/settings-1.png 1000w, https://danclowry.com/blog/content/images/size/w1600/2023/12/settings-1.png 1600w, https://danclowry.com/blog/content/images/2023/12/settings-1.png 1917w" sizes="(min-width: 720px) 720px"></figure><ol><li>From your Checkpoint tenant, expand&#xA0;<strong>Security Settings &gt; User Interaction &gt; Restore Requests</strong>.</li><li>Enable&#xA0;<strong>End User Quarantine Report</strong>.</li><li>If desired, tick &quot;Include spam emails that are sent to the Junk folder&quot;, &quot;Allow end users to generate a quarantine report on demand&quot;, and &quot;Stop sending immediate quarantine notification emails&quot;. I normally enable &quot;Allow end users to generate a quarantine report on demand&quot; while leaving the other two disabled.</li><li>Expand the&#xA0;<strong>Scheduling</strong>&#xA0;section and create your desired schedule. This could be once a day, once every hour, 10am &amp; 4pm, etc.</li><li>Expand&#xA0;<strong>Recipients</strong>&#xA0;and select&#xA0;<strong>All Users</strong>.</li><li>Expand&#xA0;<strong>Sender</strong>&#xA0;and set the following options:<ul><li>Friendly-From name: This sets the From header display name. You can set whatever name you want or leave it blank. If left blank the full sender address will be displayed in the user&apos;s email client.</li><li>From address: Change to&#xA0;<strong>Custom</strong>&#xA0;and set the address as&#xA0;<code>no-reply@quarantine.[yourdomainhere]</code>&#xA0;e.g.&#xA0;<code>no-reply@quarantine.danclowry.com</code>. The section &quot;High-Confidence Phish &amp; Secure By Default&quot; further down this article explains why the &quot;quarantine&quot; subdomain is used rather than leaving the address as the default&#xA0;<code>no-reply@[recipient domain]</code>.</li><li>Reply-to address: Leave as&#xA0;<strong>Same as From address</strong></li></ul></li><li>Expand&#xA0;<strong>Emails quarantined by Microsoft</strong>&#xA0;and tick &quot;Daily quarantine report should include emails quarantined by Microsoft&quot;</li><li>Set the release options for Microsoft quarantined emails. Below are the default actions:<ul><li>Malware: Can request a restore (admin needs to approve)</li><li>High Confidence Phishing: Can request a restore (admin needs to approve)</li><li>Phishing: Can request a restore (admin needs to approve)</li><li>High Confidence Spam: Can restore on their own</li><li>Spam: Can restore on their own</li><li>Bulk: Cannot restore</li><li>Transport Rule: Cannot restore</li></ul></li><li>Click&#xA0;<strong>Save and Apply</strong>&#xA0;to save the notification settings</li></ol><p>Checkpoint will now begin sending quarantine digests to end users per your configured schedule. Job done right? Unfortunately not...</p><h1 id="high-confidence-phish-microsoft-365-secure-by-default">High-Confidence Phish &amp; Microsoft 365 Secure by Default</h1><p>After configuring unified quarantine notifications for our clients, I quickly noticed that Checkpoint&apos;s digest emails were being quarantined by 365 as &quot;high confidence phish&quot;. I initially tried creating an Exchange transport rule to set the SCL to -1 for any emails coming from a Checkpoint IP with sender no-reply@[customerdomain] to bypass EOP spam filtering. However even after creating the transport rule, digests were still getting quarantined by 365 as high confidence phish.</p><p>After further digging, I found that this was because of 365&apos;s &quot;secure by default&quot; feature where Microsoft will ignore common EOP overrides for emails detected as malware or high confidence phishing. In Microsoft&apos;s&#xA0;<a href="https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/secure-by-default?view=o365-worldwide&amp;ref=danclowry.com">own words</a>:</p><blockquote>
<p>Because Microsoft wants to keep our customers secure by default, some tenants overrides aren&apos;t applied for malware or high confidence phishing. These overrides include:</p>
<ul>
<li>Allowed sender lists or allowed domain lists (anti-spam policies)</li>
<li>Outlook Safe Senders</li>
<li>IP Allow List (connection filtering)</li>
<li>Exchange mail flow rules (also known as transport rules)</li>
</ul>
</blockquote>
<p>Microsoft will only enable secure by default when the MX record for your domain is the default&#xA0;<code>protection.outlook.com</code>&#xA0;record. Because Checkpoint uses APIs rather than a traditional MX record replacement, secure by default is switched on and cannot be disabled.</p><p>So how can you stop 365 from quarantining Checkpoint&apos;s digests? Microsoft lists&#xA0;<a href="https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/secure-by-default?view=o365-worldwide&amp;ref=danclowry.com#exceptions">four ways</a>&#xA0;you can override secure by default:</p><blockquote>
<ul>
<li>Phishing simulations: Simulated attacks can help you identify vulnerable users before a real attack impacts your organization. To prevent phishing simulation messages from being filtered, see Configure third-party phishing simulations in the advanced delivery policy.</li>
<li>Security/SecOps mailboxes: Dedicated mailboxes used by security teams to get unfiltered messages (both good and bad). Teams can then review to see if they contain malicious content.</li>
<li>Third-party filters: Secure by default only applies when the MX record for your domain is set to Exchange Online Protection (contoso.mail.protection.outlook.com). If it&apos;s set to another service or device, it&apos;s possible to override Secure by default with a Transport Rule to bypass all spam filtering. When Microsoft detects messages as High Confidence Phish with this rule in place, they still deliver to the Inbox.</li>
<li>False positives: To temporarily allow certain messages that are still being blocked by Microsoft, use admin submissions. By default, allow entries for domains and email addresses, files, and URLs exist for 30 days. During those 30 days, Microsoft learns from the allow entries and removes them or automatically extends them. By default, allow entries for spoofed senders never expire.</li>
</ul>
</blockquote>
<p>Security/SecOps mailboxes won&apos;t work as that&apos;ll just redirect everyone&apos;s quarantine digests to a single mailbox (as well as any other actual spam filtered by EOP), changing the MX record isn&apos;t possible due to how Checkpoint works, and submitting the quarantine digests as false positive detections in Defender would work OK for a single deployment, but doesn&apos;t scale when you&apos;re managing dozens or hundreds of tenants.</p><p>Configuring a phishing simulation is what we&apos;ll use. This is basically the same as a spam bypass transport rule and will set Exchange&apos;s SCL to -1 for Checkpoint&apos;s digests.</p><h2 id="configuring-a-phishing-simulation">Configuring a Phishing Simulation</h2><p>Before you can create the phishing simulation you&apos;ll need to figure out what IP address your Checkpoint digest emails are sent from so you can add it to the phishing simulation policy. Checkpoint specifies its mailserver IP addresses in its&#xA0;<a href="https://www.avanan.com/product-updates/reduced-spf-record-footprint-for-outgoing-traffic-inspection?ref=danclowry.com"><code>spfa.cpmails.com</code></a>&#xA0;SPF record. At the time of writing, the SPF record contains 12 IPv4 addresses. Microsoft only allow up to 10 addresses to be added to a phishing simulation policy so you can&apos;t just add all 12 addresses to your policy. Luckily, Checkpoint seems to send all its notification emails from a single IP (likely based on your tenant&apos;s configured location). For all of our tenants in Australia, Checkpoint sends its digests from the 13.211.69.231 IP address (which has a PTR record of&#xA0;<code>au.cloud-sec-av.com</code>). Check your previous Checkpoint digests to figure out what IP address Checkpoint uses on your tenant.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://danclowry.com/blog/content/images/2023/12/headers.png" class="kg-image" alt="Using Checkpoint Avanan and Microsoft 365 Quarantine" loading="lazy" width="1887" height="649" srcset="https://danclowry.com/blog/content/images/size/w600/2023/12/headers.png 600w, https://danclowry.com/blog/content/images/size/w1000/2023/12/headers.png 1000w, https://danclowry.com/blog/content/images/size/w1600/2023/12/headers.png 1600w, https://danclowry.com/blog/content/images/2023/12/headers.png 1887w" sizes="(min-width: 720px) 720px"><figcaption><span style="white-space: pre-wrap;">A quarantine report with its headers shown on the right. Note the sender IP 13.211.69.231. All of our quarantine digests are sent from this IP. The IP is also present in the spfa.cpmails.com SPF record.</span></figcaption></figure><p>Once you&apos;ve found what IP Checkpoint uses, you&apos;re ready to create a phishing simulation policy. To create the policy:</p><ol><li>Login to your 365 tenant and go to the&#xA0;<a href="https://security.microsoft.com/?ref=danclowry.com">Microsoft 365 Defender</a>&#xA0;portal.</li><li>Go to&#xA0;<strong>Policies &amp; rules</strong>&#xA0;&gt;&#xA0;<strong>Threat policies</strong>&#xA0;&gt;&#xA0;<strong>Advanced delivery</strong>&#xA0;&gt;&#xA0;<strong>Phishing simulation</strong>.</li><li>Click&#xA0;<strong>Add</strong>&#xA0;to open the&#xA0;<strong>Add Third Party Phishing Simulations</strong>&#xA0;flyout.</li><li>Configure the phishing simulation options:<ul><li>Expand the&#xA0;<strong>Domain</strong>&#xA0;option and enter the&#xA0;<code>quarantine.[yourdomainhere]</code>&#xA0;domain you set in Checkpoint.</li><li>Expand the&#xA0;<strong>Sending IP</strong>&#xA0;option and enter the IP Checkpoint sends its emails from.</li><li>Leave&#xA0;<strong>Simulation URLs to allow</strong>&#xA0;blank as this isn&apos;t required for emails.</li></ul></li><li>Click&#xA0;<strong>Add</strong>&#xA0;to save the policy.</li></ol><p>Exchange will now bypass its spam filtering for all emails sent from the&#xA0;<code>quarantine.[yourdomainhere]</code>&#xA0;address if they were sent through your specified Checkpoint IP. If an email does not match both the domain AND IP conditions, Exchange will treat it as a regular email and it will be subject to EOP filtering.</p><h2 id="protecting-the-quarantine-subdomain-from-spoofing">Protecting the quarantine subdomain from spoofing</h2><p>It is important to configure an SPF and DMARC record for the quarantine subdomain to prevent an attacker from spoofing it either internally or externally.</p><p>Since&#xA0;<a href="https://techcommunity.microsoft.com/t5/exchange-team-blog/announcing-new-dmarc-policy-handling-defaults-for-enhanced-email/bc-p/3895302?ref=danclowry.com">July this year</a>&#xA0;Exchange Online has begun honoring domain DMARC policies by default. I.e. if a domain&apos;s DMARC policy has a value of&#xA0;<code>p=reject</code>, Exchange will return an NDR to the sender and refuse to deliver the message. If a domain has a DMARC policy of&#xA0;<code>p=quarantine</code>, EXO will move the message into 365 quarantine.</p><p>We can create an SPF record alongside a DMARC record for the quarantine subdomain to ensure that Exchange will always reject emails unless they were sent from one of the Checkpoint servers.</p><p>Add the following two TXT records to your domain&apos;s zone:</p><table>
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Value</th>
<th>TTL</th>
</tr>
</thead>
<tbody>
<tr>
<td>TXT</td>
<td>quarantine</td>
<td>v=spf1 include:spfa.cpmails.com -all</td>
<td>Default</td>
</tr>
<tr>
<td>TXT</td>
<td>_dmarc.quarantine</td>
<td>v=DMARC1; p=reject; aspf=s; adkim=s;</td>
<td>Default</td>
</tr>
</tbody>
</table>
<p>The SPF record informs recipient servers that the Checkpoint mail servers are the only permitted senders for the domain. The DMARC record then informs recipient servers that they should reject all messages that fail SPF validation.</p><p>Now if a third-party tries to spoof the quarantine subdomain, the message will be immediately rejected by Exchange with the response:</p><pre><code>550 5.7.509 Access denied, sending domain quarantine.danclowry.com does not pass DMARC verification and has a DMARC policy of reject.</code></pre><h1 id="conclusion">Conclusion</h1><p>Now that you&apos;ve configured Checkpoint Unified Quarantine your users will only have to worry about checking a single report to view their quarantined messages. </p>]]></content:encoded></item><item><title><![CDATA[How to Install Youtube-DL on Windows]]></title><description><![CDATA[Youtube-DL is a great little program that allows you to download videos from almost every major video website on the internet. This tutorial will show you how to download, install, configure and use Youtube-DL for Windows.]]></description><link>https://danclowry.com/blog/youtube-dl-windows-install/</link><guid isPermaLink="false">61d57a9e6155f5ab42b69278</guid><dc:creator><![CDATA[Daniel Clowry]]></dc:creator><pubDate>Wed, 17 Jul 2019 02:04:00 GMT</pubDate><content:encoded><![CDATA[
<!--kg-card-begin: html-->
<aside>
    <p>
        <em>Last updated 23 January 2019 - <a href="#changelog">Changelog</a><br></em>
		Youtube-DL version 2019.12.25<br>
		Windows 10 version 1903 (OS Build 18362.476)<br>
		FFmpeg version N-94251-gf83b46e218<br>
    </p>
</aside>
<!--kg-card-end: html-->
<hr><p>Youtube-DL is a great little program that allows you to download videos from almost every major video website on the internet. This tutorial will show you how to download, install, configure and use Youtube-DL for Windows.</p><h3 id="prerequisites">Prerequisites:</h3><ul><li>Basic knowledge on how to open and use Command Prompt</li><li><a href="https://www.microsoft.com/en-US/download/details.aspx?id=5555&amp;ref=danclowry.com">Microsoft Visual C++ 2010 Redistributable Package (x86)</a></li></ul><h1 id="download-and-installation">Download and Installation</h1><h2 id="installing-youtube-dl">Installing Youtube-DL</h2><p>We&apos;ll start off with download and installing Youtube-DL. Go to the <a href="https://github.com/ytdl-org/youtube-dl/releases/latest?ref=danclowry.com">releases page of the Youtube-DL Github repository</a>. Scroll down until you find the list of assets, click on the file called &quot;youtube-dl.exe&quot; to begin downloading Youtube-DL. You can download the file to any location except for System32. I recommend creating a separate folder solely for Youtube-DL as it makes it easier to configure Youtube-DL later on. For this tutorial, I have downloaded the file to <code>D:\Programs\Other Programs\Youtube-DL</code>.</p><p>Now that you&apos;ve downloaded Youtube-DL, you&apos;ve probably noticed that nothing happens when you try to double-click to run the program. This is because Youtube-DL is a command-line program, it can only be used from a command line interface such as Command Prompt. </p><p>However, if you open Command Prompt and try to use the command <code>youtube-dl</code> you&apos;ll still get an error saying that the command is not recognised. To run Youtube-DL you&apos;ll need to either add it to your computer&apos;s PATH or <code>cd</code> into the directory where you downloaded Youtube-DL.</p><h3 id="add-youtube-dl-to-your-path-recommended">Add Youtube-DL to your PATH (Recommended)</h3><p>Adding Youtube-DL to you PATH allows you to run the <code>youtube-dl</code> command from any command-line interface such as Command Prompt or PowerShell without needing to first <code>cd</code> into the directory where you installed Youtube-DL.</p><p>To add Youtube-DL to your PATH:</p><p><strong>1. Copy the full path of your Youtube-DL install location - </strong>You can reveal the full path by navigating to wherever you downloaded Youtube-DL in Windows Explorer, clicking on the address bar and copying the text. Do <strong>not</strong> include the .exe in the path, it should only include directories (e.g. <code>D:\Programs\Other Programs\Youtube-DL</code> instead of <code>D:\Programs\Other Programs\Youtube-DL\youtube-dl.exe</code>)</p><figure class="kg-card kg-image-card"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---14.38.32.43.png" class="kg-image" alt="A screenshot of Windows Explorer showing the current path in the address bar" loading="lazy"></figure><p><strong>2. Open Environment Variables - </strong>Open the System Properties menu by pressing <code>Win+R</code> and typing <code>systempropertiesadvanced</code>. From this menu, press the button labelled &quot;Environment Variables...&quot;.</p><figure class="kg-card kg-image-card"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---14.50.43.40.png" class="kg-image" alt loading="lazy"></figure><p><strong>3. Select the <code>Path</code> variable - </strong>You can add Youtube-DL to either the user or system PATH. Adding it to the system PATH will allow any user to run the <code>youtube-dl</code> command without first <code>cd</code>ing into the install directory, whereas the user PATH will only apply to the currently logged in user. Note that setting it in the system PATH requires administrator permissions and <code>youtube-dl.exe</code> cannot be located in a user specific location (such as the Desktop or &quot;My Documents&quot;). For this tutorial, I will be using the system PATH.<br><br>If you want to add it to the user PATH, scroll through the first list of variables until you find one named <code>Path</code>. Double-click on it to open the editor.<br>If you want to add it to the system PATH, scroll through the second list of variables until you find one named <code>Path</code>. Double-click on it to open the editor.<br><br>There will most likely already be some stuff already in the Path. <strong>Do not delete any existing entries</strong>. They were most likely set by another program or by Windows and deleting them can cause programs not to work and can even cause Windows to become unbootable.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---15.09.22.21.png" class="kg-image" alt loading="lazy"><figcaption><span style="white-space: pre-wrap;">List of user and system variables on the left and the editor for the system PATH on the right</span></figcaption></figure><p><strong>4. Add the Youtube-DL install path to <code>Path</code> - </strong>With the variable editor open and your Youtube-DL install path in the clipboard, press the &quot;New&quot; button from the right side of the editor. This will create a new entry to the bottom of the variable. Paste in your Youtube-DL path and press enter then press &quot;OK&quot; to save the changes.</p><figure class="kg-card kg-image-card"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---15.14.44.82.png" class="kg-image" alt loading="lazy"></figure><p><strong>5. Test it! - </strong>Now that you&apos;ve added Youtube-DL to the PATH you should be able to open a new Command Prompt window and run <code>youtube-dl</code>. Now you can go to the section &quot;Installing FFmpeg&quot; to continue the installation!</p><figure class="kg-card kg-image-card"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---15.17.46.42.png" class="kg-image" alt loading="lazy"></figure><p>If you&apos;re still getting an error saying that <code>youtube-dl</code> is not recognised, try the following:</p><ul><li>Restart your computer to force a refresh of the PATH.</li><li>Double check that the path to Youtube-DL is correct. Make sure that <code>youtube-dl.exe</code> is not included in the path.</li><li>If you added Youtube-DL to the system PATH, try adding it to the user PATH (and vice versa). </li><li>From the PATH editor, select the Youtube-DL entry and try moving it up or down the list of PATH entries using the &quot;Move Up&quot; and &quot;Move Down&quot; buttons.</li></ul><p>And if you still can&apos;t get it it work, leave a comment at the bottom of this article to see if someone can help you.</p><h3 id="run-youtube-dl-from-the-install-directory">Run Youtube-DL from the Install Directory</h3><p>If you only want to run Youtube-DL occasionally and don&apos;t want it cluttering your PATH, you can instead run it directly from the install folder. Open Windows Explorer and navigate to the folder you downloaded Youtube-DL to. Click on the address bar in Windows Explorer and type <code>cmd</code> to open Command Prompt in the current folder. Now you can simply use <code>youtube-dl</code> to run the program.</p><figure class="kg-card kg-image-card"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---17.06.08.85.png" class="kg-image" alt loading="lazy"></figure><h2 id="installing-ffmpeg">Installing FFmpeg</h2><p>While FFmpeg isn&apos;t required, it gives you access to more features of Youtube-DL. Most notably, it allows you to download Youtube videos higher than 720p and allows you to combine a specific audio and video track together as one file.</p><p>Installing FFmpeg is pretty much the same as Youtube-DL. You can <a href="https://www.gyan.dev/ffmpeg/builds/?ref=danclowry.com#git-section">download Windows binaries for FFmpeg from FFmpeg maintainer Gyan Doshi&apos;s website </a>&#x2014; download the &quot;git-full&quot; binary if you&apos;re not sure what build to pick. This will begin downloading a 7z file containing the latest FFmpeg build (you will need <a href="https://www.7-zip.org/download.html?ref=danclowry.com">7-Zip </a>to extract the file). Open the archive and extract the contents of the ffmpeg-20xx-xx-xx folder to a location of your choosing. For this tutorial, I have extracted it to <code>D:\Programs\Other Programs\ffmpeg</code>.</p><p>With FFmpeg extracted, you&apos;ll now need to add it to your PATH. The steps are the same as with Youtube-DL. However, instead of copying the base FFmpeg install path, copy the path from the <code>bin</code> folder (e.g. <code>D:\Programs\Other Programs\ffmpeg\bin</code> instead of <code>D:\Programs\Other Programs\ffmpeg\</code>).</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---17.19.39.24.png" class="kg-image" alt loading="lazy"><figcaption><span style="white-space: pre-wrap;">Note that the path for FFmpeg includes the &quot;bin&quot; folder</span></figcaption></figure><p>You can verify that FFmpeg is set in the path by opening Command Prompt and run <code>ffmpeg</code>.</p><figure class="kg-card kg-image-card"><img src="https://danclowry.com/blog/content/images/2019/12/Desktop-Screenshot-2019.12.31---17.21.56.79.png" class="kg-image" alt loading="lazy"></figure><h1 id="configuring-youtube-dl">Configuring Youtube-DL</h1><p>Now that you&apos;ve successfully installed Youtube-DL, you&apos;ll probably want to customise it to your liking using some of the <a href="https://github.com/ytdl-org/youtube-dl?ref=danclowry.com#options">hundreds of options available</a>. But typing out the same options every time you run Youtube-DL is tedious. This is where the configuration file comes in. The options set in the configuration file are run every time Youtube-DL is run. However, the config can be disabled at runtime using the <code>--ignore-config</code> flag. Options set at runtime will also have precedence over those set in the config.</p><p>Creating a config file is very straightforward. For Windows, simply create a file called <code>config.txt</code> at <code>%APPDATA%\youtube-dl\</code>. You set options in the config much like how you set them at runtime. You can comment out lines using the hash symbol (#).</p><p>I recommend using the following config as a starting point:</p><pre><code># Set date at current date instead of video&apos;s original date
--no-mtime

# Save to current user&apos;s videos folder using video title
# See https://github.com/ytdl-org/youtube-dl#output-template for all naming options
-o &quot;%USERPROFILE%\Videos\Youtube\%(title)s.%(ext)s&quot;</code></pre><p>See the Youtube-DL <a href="https://github.com/ytdl-org/youtube-dl?ref=danclowry.com#options">list of options</a> and <a href="https://github.com/ytdl-org/youtube-dl?ref=danclowry.com#output-template">list of output options</a> for configuring Youtube-DL.</p><h1 id="using-youtube-dl">Using Youtube-DL</h1><p>So you&apos;ve finally installed and configured Youtube-DL to your liking, you&apos;re probably wondering how you use it. This section gives some examples and tips on how to download videos using Youtube-DL.</p><h3 id="basic-usage">Basic Usage</h3><p>The easiest way to download a video is by calling youtube-dl followed by the video URL.</p><pre><code>youtube-dl https://www.youtube.com/watch?v=tO01J-M3g0U</code></pre><p>This will download the requested video using the highest available quality. If FFmpeg is installed, it will download the highest quality video and highest quality audio separately and combine them into a single file. Otherwise, it will instead try to download the highest quality file that contains both video and audio.</p><h4 id="format-selector">Format Selector</h4><p>But what if you want to download the video at a specific quality? Or what if you want to only download audio? This is where the format selector comes in.</p><p>You can list all the available formats for a video by using the <code>-F</code> flag (note the uppercase F) or <code>--list-formats</code>.</p><pre><code>youtube-dl https://www.youtube.com/watch?v=tO01J-M3g0U -F

[youtube] tO01J-M3g0U: Downloading webpage
[youtube] tO01J-M3g0U: Downloading video info webpage
[info] Available formats for tO01J-M3g0U:
format code  extension  resolution note
249          webm       audio only tiny   56k , opus @ 50k (48000Hz), 918.04KiB
250          webm       audio only tiny   71k , opus @ 70k (48000Hz), 1.19MiB
140          m4a        audio only tiny  130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 2.39MiB
251          webm       audio only tiny  140k , opus @160k (48000Hz), 2.37MiB
394          mp4        256x144    144p   79k , av01.0.00M.10.0.110.09.16.09.0, 30fps, video only, 1.24MiB
278          webm       256x144    144p   97k , webm container, vp9, 30fps, video only, 1.59MiB
160          mp4        256x144    144p  111k , avc1.4d400c, 30fps, video only, 1.20MiB
395          mp4        426x240    240p  182k , av01.0.00M.10.0.110.09.16.09.0, 30fps, video only, 2.27MiB
242          webm       426x240    240p  227k , vp9, 30fps, video only, 3.20MiB
133          mp4        426x240    240p  245k , avc1.4d4015, 30fps, video only, 2.45MiB
330          webm       256x144    144p60 HDR  250k , vp9.2, 60fps, video only, 3.69MiB
396          mp4        640x360    360p  336k , av01.0.01M.10.0.110.09.16.09.0, 30fps, video only, 4.26MiB
243          webm       640x360    360p  420k , vp9, 30fps, video only, 5.97MiB
331          webm       426x240    240p60 HDR  517k , vp9.2, 60fps, video only, 7.98MiB
397          mp4        854x480    480p  623k , av01.0.04M.10.0.110.09.16.09.0, 30fps, video only, 7.92MiB
134          mp4        640x360    360p  634k , avc1.4d401e, 30fps, video only, 6.97MiB
244          webm       854x480    480p  773k , vp9, 30fps, video only, 10.86MiB
332          webm       640x360    360p60 HDR 1094k , vp9.2, 60fps, video only, 17.37MiB
398          mp4        1280x720   720p60 1249k , av01.0.08M.10.0.110.09.16.09.0, 60fps, video only, 17.83MiB
135          mp4        854x480    480p 1297k , avc1.4d401f, 30fps, video only, 14.05MiB
247          webm       1280x720   720p 1545k , vp9, 30fps, video only, 22.19MiB
333          webm       854x480    480p60 HDR 2034k , vp9.2, 60fps, video only, 33.47MiB
136          mp4        1280x720   720p 2657k , avc1.4d401f, 30fps, video only, 27.20MiB
248          webm       1920x1080  1080p 2702k , vp9, 30fps, video only, 39.80MiB
302          webm       1280x720   720p60 2710k , vp9, 60fps, video only, 36.54MiB
298          mp4        1280x720   720p60 4071k , avc1.4d4020, 60fps, video only, 45.17MiB
303          webm       1920x1080  1080p60 4622k , vp9, 60fps, video only, 63.87MiB
334          webm       1280x720   720p60 HDR 4790k , vp9.2, 60fps, video only, 80.74MiB
137          mp4        1920x1080  1080p 4985k , avc1.640028, 30fps, video only, 49.39MiB
299          mp4        1920x1080  1080p60 6761k , avc1.64002a, 60fps, video only, 80.25MiB
335          webm       1920x1080  1080p60 HDR 7277k , vp9.2, 60fps, video only, 123.60MiB
271          webm       2560x1440  1440p 8874k , vp9, 30fps, video only, 119.07MiB
308          webm       2560x1440  1440p60 13422k , vp9, 60fps, video only, 181.85MiB
336          webm       2560x1440  1440p60 HDR 16900k , vp9.2, 60fps, video only, 297.56MiB
313          webm       3840x2160  2160p 18006k , vp9, 30fps, video only, 287.61MiB
315          webm       3840x2160  2160p60 26847k , vp9, 60fps, video only, 436.24MiB
337          webm       3840x2160  2160p60 HDR 29609k , vp9.2, 60fps, video only, 528.73MiB
43           webm       640x360    360p , vp8.0, vorbis@128k, 15.53MiB
18           mp4        640x360    360p  609k , avc1.42001E, mp4a.40.2@ 96k (44100Hz), 11.23MiB
22           mp4        1280x720   720p 1605k , avc1.64001F, mp4a.40.2@192k (44100Hz) (best)</code></pre><p>Youtube-DL returns a lot of information but once you break it down it becomes a lot more manageable. The information is returned in a table format with seven columns and one format per row. Audio-only formats comes first, followed by video-only formats with the audio+video formats at the bottom. Formats are listed in ascending order by bitrate. The columns of the table are broken down as follows:</p><ul><li><strong>Format code - </strong>The code used when downloading a format</li><li><strong>Extension -</strong> The extension of the downloaded format</li><li><strong>Resolution - </strong>The resolution, framerate and additional information such as HDR</li><li><strong>Bitrate -</strong> The bitrate of the format expressed in kilobits/second</li><li><strong>Codec - </strong>Codec information, format framerate and whether the format is video/audio only</li><li><strong>Size - </strong>The size of the format</li></ul><table>
<thead>
<tr>
<th>Format Code</th>
<th>Extension</th>
<th>Resolution</th>
<th>Bitrate</th>
<th>Codec</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>337</code></td>
<td><code>webm</code></td>
<td><code>3840x2160 2160p60 HDR</code></td>
<td><code>29609k</code></td>
<td><code>vp9.2, 60fps, video only</code></td>
<td><code>528.73MiB</code></td>
</tr>
</tbody>
</table>
<p></p><p>To download specific specific formats of a video, use the <code>-f</code> (note the lowercase f) or <code>--format</code> flag. You can specify video only, audio only, or video + audio formats. Formats are selected using the format codes returned using the <code>--list-formats</code> flag.</p><pre><code>youtube-dl https://www.youtube.com/watch?v=tO01J-M3g0U -f 299+251

[youtube] tO01J-M3g0U: Downloading webpage
[youtube] tO01J-M3g0U: Downloading video info webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: C:\Users\Dan\Videos\Youtube\The World in HDR in 4K (ULTRA HD).f299.mp4
[download] 100% of 80.89MiB in 00:28
[download] Destination: C:\Users\Dan\Videos\The World in HDR in 4K (ULTRA HD).f251.webm
[download] 100% of 2.37MiB in 00:01
[ffmpeg] Merging formats into &quot;C:\Users\Dan\Videos\Youtube\The World in HDR in 4K (ULTRA HD).mkv&quot;
Deleting original file C:\Users\Dan\Videos\Youtube\The World in HDR in 4K (ULTRA HD).f299.mp4 (pass -k to keep)
Deleting original file C:\Users\Dan\Videos\Youtube\The World in HDR in 4K (ULTRA HD).f251.webm (pass -k to keep)</code></pre><p>The above example will download the formats that match the codes <code>299</code> and <code>251</code>. This corresponds to the 1080p 60FPS video and 140kb/s Opus audio stream. Those files are then combined into a single MKV using FFmpeg.</p><p>Downloading audio or video only follows the same process. Just specify the audio or video format.</p><figure class="kg-card kg-code-card"><pre><code>youtube-dl https://www.youtube.com/watch?v=tO01J-M3g0U -f 299</code></pre><figcaption><p><span style="white-space: pre-wrap;">Only download video (format code 299)</span></p></figcaption></figure><figure class="kg-card kg-code-card"><pre><code>youtube-dl https://www.youtube.com/watch?v=tO01J-M3g0U -f 251</code></pre><figcaption><p><span style="white-space: pre-wrap;">Only download audio (format code 251)</span></p></figcaption></figure><p>Youtube-DL also has some preset formats to download the best or worst audio/video available. These can be used in place of an exact format code.</p><ul><li><code>best</code> - Downloads the highest quality file containing both audio and video</li><li><code>worst</code> - Downloads the lowest quality file containing both audio and video</li><li><code>bestvideo</code> - Downloads the highest quality video-only file</li><li><code>worstvideo</code> - Downloads the lowest quality video-only file</li><li><code>bestaudio</code> - Downloads the highest quality audio-only file</li><li><code>worstaudio</code> - Downloads the lowest quality audio-only file</li></ul><h1 id="conclusion">Conclusion</h1><p>Youtube-DL is an incredible program that allows you to download media from hundreds of websites. While I hope this tutorial has got you up and running with using Youtube-DL, I highly recommend checking out the <a href="https://github.com/ytdl-org/youtube-dl/blob/master/README.md?ref=danclowry.com">README for Youtube-DL</a> that contains much more detailed information on the available options for using and configuring Youtube-DL.</p><h1 id="changelog">Changelog</h1><ul><li>2021-01-23: updated FFmpeg download link (thanks ElectroGaming)</li></ul>]]></content:encoded></item></channel></rss>