Welcome to our New Forums!

Our forums have been upgraded and expanded!

Welcome to Our New Forums

  • Our forums have been upgraded! You can read about this HERE

Automate youtube downloading of channels

Mastermind

New member
Joined
Sep 21, 2021
Messages
487
Location
[email protected]
With the help of youtube-dl you can download entire youtube channels and playlists.
It's available for both Windows and GNU/Linux.

Windows
If you are under windows, download the executable (or compile it) from https://github.com/ytdl-org/youtube-dl/releases and put it into a folder.
In the same folder you'll need ffmpeg. You can downlad and compile the source from https://ffmpeg.org/download.html or get the executable from https://www.gyan.dev/ffmpeg/builds/
Create a .bat file and put the following inside:
Code:
[path to youtube-dl.exe] --config-location "[path to config file for channel 1]"
[path to youtube-dl.exe] --config-location "[path to config file for channel 2]"
[path to youtube-dl.exe] --config-location "[path to config file for playlist 1]"
Double click on the bat file and it will download all the missing videos in sequence.

GNU/Linux
If you are under GNU/Linux the easiest way to install youtube-dl is using the package manager.
On devuan/debian/ubuntu you'd run
Code:
sudo apt install youtube-dl
Create a .sh file and put the following inside:
Code:
#!/bin/bash

youtube-dl --config-location "[path to config file for channel 1]"
youtube-dl --config-location "[path to config file for channel 2]"
youtube-dl --config-location "[path to config file for playlist 1]"

Example:
Code:
youtube-dl --config-location "~/Adrian_von_Ziegler/__config"

Add execution rights:
Code:
sudo chmod u+x your_script.sh
Then execute it:
Code:
./your_script.sh


Config files

Here's an example for an audio only download:
Code:
# Output format
-o "~/Adrian_von_Ziegler/%(title)s.%(ext)s"

# Archive Settings
--download-archive "~/Adrian_von_Ziegler/__downloaded"

# skip on error
-i

# continue downloads
-c

# do not overwrite
--no-overwrites

# Uniform Format
--merge-output-format webm

# Debug
-v

# Format
-f "bestaudio[acodec=opus]"

--playlist-reverse 
--limit-rate 500k 
--no-call-home 
--force-ipv4
--sleep-interval 15
--max-sleep-interval 45

--write-info-json
--add-metadata

# Channel URL
https://www.youtube.com/c/AdrianvonZiegler/videos

For audio and video, change the -f (format) parameter to:
high quality:
Code:
-f "best"
medium quality:
Code:
-f "bestvideo[height=720][vcodec^=vp9][fps<=30]+bestaudio[acodec=opus]/bestvideo[height=720][vcodec^=avc1][fps<=30]+bestaudio[acodec=opus]/bestvideo[height=720]+bestaudio[acodec=opus]/best"
low quality:
Code:
-f "bestvideo[height=360][vcodec^=vp9][fps<=30]+bestaudio[acodec=opus]/bestvideo[height=360][vcodec^=avc1][fps<=30]+bestaudio[acodec=opus]/bestvideo[height=360]+bestaudio[acodec=opus]/worst"

If you want to download a playlist instead of a channel, just give it the playlist URL instead of the channel URL.
Right now youtube is limiting downloads to about 70 kb/s. If you want to download faster you'll have to add the cookie parameter. I just leave it at 70 kb/s and it'll download everything eventually.
 
Bro can you create a video demonstration going through the steps.
 
I will test this later. I have been using a webpage to download videos / music before, but this can potentially save a lot of time and effort so this method can be better for efficiency.
 
Larissa666 said:
Amazing, I was able to install this via Homebrew.

Too bad most people are afraid of command line, though.

Thank you, brother.
It's like you have a command, let's say apt. Then you have command man which stands for manual. You type man apt into terminal. You get a proper manual to read to given that the dev has made such for the program. Most programs have this, but not all, and some manuals are more elaborate than others.

It really is nothing too complicated. It's simply that not every mind is attuned to technicalities.
 
Jack said:
Bro can you create a video demonstration going through the steps.

https://github.com/yt-dlp/yt-dlp/releases/download/2021.12.27/yt-dlp.exe

1. Command prompt
2. [Destination folder of the downloaded file] [youtube link]

Example:

C:\Users\Admin\Downloads>yt-dlp.exe https://www.youtube.com/watch?v=evmO1igrgyc

The downloaded file can be found on the same folder destination.

If you have a different OS and the executable file is not working, download your OS format below:

https://github.com/yt-dlp/yt-dlp/releases/tag/2021.12.27
 
AgainstAllAuthority said:
Voimir said:
I have tried yt-dlp and it shows better download speed compared to Youtube-dl. It has a maximum download rate of 4.2 M.

https://github.com/yt-dlp/yt-dlp

Interesting. Can you share a configuration file template to download an entire channel?

You mean this?

https://github.com/yt-dlp/yt-dlp#configuration

The method I introduced to Jack for Windows can already download a playlist or an entire channel. Just put the channel's link and it will automatically download all the videos.
 

Al Jilwah: Chapter IV

"It is my desire that all my followers unite in a bond of unity, lest those who are without prevail against them." - Satan

Back
Top