Difference between revisions of "DownloadServer - Youtube"

From The TinkerNet Wiki
Jump to navigation Jump to search
Line 7: Line 7:
 
Fortunately, it's pretty easy to do.
 
Fortunately, it's pretty easy to do.
  
== youtube-dl ==
+
==youtube-dl==
 
[https://youtube-dl.org/ youtube-dl] is a pretty awesome tool.
 
[https://youtube-dl.org/ youtube-dl] is a pretty awesome tool.
  
Line 23: Line 23:
 
Which guarantees you keep up with the multitude of random changes made at YouTube.
 
Which guarantees you keep up with the multitude of random changes made at YouTube.
  
=== scripting ===
+
===scripting===
 
Example of a useful script to update a local copy of a YouTube Channel:
 
Example of a useful script to update a local copy of a YouTube Channel:
  
 
<code>youtube-dl -w --download-archive 11111111-ARCHIVE --write-description -f mp4 -o "%(upload_date)s - %(title)s.%(ext)s" <nowiki>https://www.youtube.com/user/LastWeekTonight</nowiki></code>
 
<code>youtube-dl -w --download-archive 11111111-ARCHIVE --write-description -f mp4 -o "%(upload_date)s - %(title)s.%(ext)s" <nowiki>https://www.youtube.com/user/LastWeekTonight</nowiki></code>
  
(this particular little script maintains a local archive of a channel that YouTube thinks Canadians should not be allowed to watch...)
+
This particular little script maintains a local archive of a channel that YouTube thinks Canadians should not be allowed to watch...  (needless to say, it gets run on the VPN equipped Download Server.)

Revision as of 16:46, 24 June 2020

There are a few good reasons to be set up to download YouTube videos.

  • Geofencing
  • Reliability
  • Bandwidth Management

Fortunately, it's pretty easy to do.

youtube-dl

youtube-dl is a pretty awesome tool.

But don't install it through the package manager. It gets incredibly regular updates & the package manager kinda borks this.

Instead, install it directly:

  • sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
  • sudo chmod a+rx /usr/local/bin/youtube-dl

This allows you to regularly update (maybe even through cron) it with the command:

  • sudo youtube-dl -U

Which guarantees you keep up with the multitude of random changes made at YouTube.

scripting

Example of a useful script to update a local copy of a YouTube Channel:

youtube-dl -w --download-archive 11111111-ARCHIVE --write-description -f mp4 -o "%(upload_date)s - %(title)s.%(ext)s" https://www.youtube.com/user/LastWeekTonight

This particular little script maintains a local archive of a channel that YouTube thinks Canadians should not be allowed to watch... (needless to say, it gets run on the VPN equipped Download Server.)