<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>ClipboardFusion RSS: [Script] Download video from YouTube</title>
<atom:link href="https://www.clipboardfusion.com/Discussions/RSS/?TopicID=0cece7f9-1ff4-4d25-a3e0-23bc926ac0cb" rel="self" type="application/rss+xml" />
<link>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=0cece7f9-1ff4-4d25-a3e0-23bc926ac0cb</link>
<description>ClipboardFusion RSS: [Script] Download video from YouTube</description>
<lastBuildDate>Tue, 11 Aug 2026 07:03:43 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=0cece7f9-1ff4-4d25-a3e0-23bc926ac0cb</generator>
<item>
<title>[Script] Download video from YouTube</title>
<link>https://www.clipboardfusion.com/Discussions/View/script-download-video-from-youtube/?ID=0cece7f9-1ff4-4d25-a3e0-23bc926ac0cb</link>
<pubDate>Tue, 04 Apr 2017 18:44:36 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/script-download-video-from-youtube/?ID=0cece7f9-1ff4-4d25-a3e0-23bc926ac0cb</guid>
<category>ClipboardFusion</category>
<description><![CDATA[So, we're going to need youtube-dl. The latest version can be downloaded here: https://github.com/rg3/youtube-dl/releases/latest, or if you use python, you can get youtube-dl using pip pip install --upgrade youtube-dl.
If you just want to download the video in the 720p default format, all you ha...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
So, we're going to need youtube-dl. The latest version can be downloaded here: <a href="https://github.com/rg3/youtube-dl/releases/latest" target="_blank" rel="nofollow"><b>https://github.com/rg3/youtube-dl/releases/latest</b></a>, or if you use python, you can get youtube-dl using pip <b>pip install --upgrade youtube-dl</b>.<br/>
If you just want to download the video in the 720p default format, all you have to do is set your path to the youtube-dl.exe and directory to save files.<br/>
If you want a different quality of audio or video, you should read and understand the format of the arguments. You can find the readme here: <a href="https://github.com/rg3/youtube-dl/blob/master/README.md" target="_blank" rel="nofollow"><b>https://github.com/rg3/youtube-dl/blob/master/README.md</b></a>, you'll also need ffmpeg to merge video and audio files. ffmpeg can be found here: <a href="https://ffmpeg.zeranoe.com/builds/" target="_blank" rel="nofollow"><b>https://ffmpeg.zeranoe.com/builds/</b></a>. Copy the ffmpeg.exe from the bin directory to the directory where youtube-dl.exe is stored.<br/>
<br/>
I tried to comment on all the code for those who don't understand C#, and I hope the comments are clear. <img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" /><br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019fefa25d267667b3e9b27f991a49b7" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019fefa25d267667b3e9b27f991a49b7Js'); return false;"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019fefa25d267667b3e9b27f991a49b7Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;

// 'youtube-dl' you can find here: (https://github.com/rg3/youtube-dl/releases/latest)

// For some additional options may need 'ffmpeg' and you can find it here: (https://ffmpeg.zeranoe.com/builds/)
// Copy ffmpeg from the bin directory to a dir where 'youtube-dl.exe' stored

public static class ClipboardFusionHelper
{
    public static string ProcessText(string url)
    {
        // Check that url is a link to youtube
        if(url.Contains("youtube.com") || url.Contains("youtu.be"))
        {
            // Set your path to youtube-dl. For example (@"C:\YouTube-Download\youtube-dl.exe")
            var binPath = @"HERE'S_YOUR_PATH_TO_YOUTUBE-DL.EXE";
            
            // Set your dir where the downloaded files will be saved. For example (@"C:\My YT Saved Video")
            var pathToFiles = @"HERE'S_YOUR_PATH_TO_THE_SAVED_FILES";
            
            // Set format to save files see (https://github.com/rg3/youtube-dl/blob/master/README.md) for more help
            var fullPath = System.IO.Path.Combine(pathToFiles, "%(title)s.%(ext)s");
            
            // Simple download 720p mp4 video does not require ffmpeg
            var arg = string.Format(@"-o ""{0}"" --no-playlist -q -f best {1}", fullPath, url);
            
            // If you want to use other parameters, a different quality video or audio, like a next line,
            // look (https://github.com/rg3/youtube-dl/blob/master/README.md) to see what option you need.
            // And make sure what you have 'ffmpeg' in 'youtube-dl' directory.
//            var arg =
//              string.Format(@"-o ""{0}"" --no-playlist --no-mtime -w -q -f bestvideo+bestaudio {1}",
//                fullPath, url);
            
            // Run youtube-dl
            var appId = BFS.Application.Start(binPath, arg);
            
            // Get youtube-dl window handle
            var hWnd = BFS.Application.GetMainWindowByAppID(appId);
            
            // Because youtube-dl is a console app, hide it's window
            BFS.Window.SetWindowStyle(BFS.WindowEnum.WindowStyle.WS_DISABLED, hWnd);
            
            // Wait for the application to complete
            if(BFS.Application.WaitForExitByAppID(appId))
            {
                // Show message
                BFS.Dialog.ShowMessageInfo("Work completed");
                // And\or you can show dir with downloaded files
//                BFS.Application.Start(pathToFiles);
            }
        }
        // If url not youtube link show message
        else BFS.Dialog.ShowMessageInfo("It's not youtube link");

        return null;
    }
}</pre><textarea id="code019fefa25d267667b3e9b27f991a49b7" name="code019fefa25d267667b3e9b27f991a49b7" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>