<?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/"
	>

<channel>
	<title>youtube-dl Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/youtube-dl/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Sat, 07 Sep 2019 02:02:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Write a Bash Script to Queue Links for youtube-dl</title>
		<link>https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/</link>
					<comments>https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/#comments</comments>
		
		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Sat, 07 Sep 2019 01:56:11 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[youtube]]></category>
		<category><![CDATA[youtube-dl]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=13461</guid>

					<description><![CDATA[<p>Most people use YouTube. However, if you are like me and don’t like streaming your digital content and instead prefer to have raw media files available on your hard disk which can be played back at much better quality than streaming services offer on unstable or slow internet connections, then you are probably already using [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/">Write a Bash Script to Queue Links for youtube-dl</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Most people use YouTube. However, if you are like me and don’t like streaming your digital content and instead prefer to have raw media files available on your hard disk which can be played back at much better quality than streaming services offer on unstable or slow internet connections, then you are probably already using the popular <a href="https://youtube-dl.org/"><strong>youtube-dl</strong></a> tool to download digital content from YouTube.</p>
<p>youtube-dl allows a user to download video and audio (or split the audio/video into separate files) from YouTube links by simply pasting the shared URL into the terminal console following the youtube-dl syntax. That’s the easy part. But what do you do if you have more than one or two links?</p>
<p>Sometimes when I am browsing YouTube I collect a bunch of links which I want to download. Sometimes this can be 3-5 links, or sometimes I can end up with an extensive list of 10 or more which I had not originally intended. It can be time consuming manually pasting in links then waiting for each download to complete before pasting in the next link and repeating the process. Thankfully, there is an easier way to do it by writing a neat little Bash script.</p>
<p>Let’s get started.</p>
<p>For example purposes, we will use the following fake randomly generated links to download:</p>
<pre><strong>https://youtu.be/ACcLsrbigWu</strong>
<strong>https://youtu.be/BAbg6BnkB3F</strong>
<strong>https://youtu.be/l0eRloaKxVS</strong></pre>
<p>So let’s write ourselves a neat little Bash script to deal with these links, using a combination of Bash and youtube-dl.</p>
<p>I use Emacs for this kind of short-style scripting, but feel free to use whatever code editor you prefer. Let’s just call our script something easy, like &#8220;yt-queue.sh&#8221;:</p>
<pre><strong>&gt; emacs yt-queue.sh</strong></pre>
<p>Then in your code editor, enter the following syntax:</p>
<pre><strong>#!/bin/bash</strong>
<strong>#</strong>

<strong>#start</strong>
<strong>#links</strong>
<strong>#end</strong></pre>
<p><img loading="lazy" class="aligncenter size-full wp-image-13465" src="https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1.png" alt="" width="1919" height="1079" srcset="https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1.png 1919w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-1068x601.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-747x420.png 747w" sizes="(max-width: 1919px) 100vw, 1919px" /></p>
<p>This provides a basic and sensible script layout for your youtube-dl queue.</p>
<p>Where we have &#8220;#links&#8221;, press &#8220;ENTER&#8221; at the end of the line so we get a new blank line. Now we need to paste in the links to download. But remember to write &#8220;youtube-dl&#8221; before each link. This is effectively telling the Bash script to use youtube-dl to download the link that follows. Once one link has completed downloading, the script then passes onto the next line in the queue, and then the next and so forth. Stupidly simple, yet effective.</p>
<p>After pasting in the links, the script should look something like this:</p>
<pre><strong>#!/bin/bash</strong>
<strong>#</strong>

<strong>#start</strong>
<strong>#links</strong>
<strong>youtube-dl https://youtu.be/ACcLsrbigWu</strong>
<strong>youtube-dl https://youtu.be/BAbg6BnkB3F</strong>
<strong>youtube-dl https://youtu.be/l0eRloaKxVS</strong>
<strong>#end</strong></pre>
<p>The script is finished. Now we need to just execute it when we are ready to start it.</p>
<p>This process is particularly useful for downloading extensive lists which can be done overnight &#8211; write your script before you go to bed, execute the script and by the morning your files will be completed.</p>
<p>Execute the script by simply running the following:</p>
<pre><strong>&gt; bash yt-queue.sh</strong></pre>
<p>You have now learned how to write a simple Bash script to queue links for youtube-dl.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/">Write a Bash Script to Queue Links for youtube-dl</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
