Download (archive) youtube content with specifications.
A setting for videos as well as for audio extractions from videos are provided.
Youtube content has become important to people. My contribution hepls you to download videos which are important to you or of which you want to do further research on from your hard disk. Moreover, anytime channels can get closed and the videos won't be available online any longer. Due to that, you can archive videos on your own computer.
You can specify channels or playlists or singular videos.
You set which channel etc. you target in the file yt-dlp-channels-audio.txt
or yt-dlp-channels-video.txt
respectively. You can list as much targests as you want here, each in a new line.
- Go to the channel's videos section for example
- Copy the address shown in the address bar
- Paste this address into the channels file.
The program then reads the content from the channels file and downloads all the content according to the specifications set in the configuration file which is explained below.
After downloading each youtube content, the unique ID of that one is then saved in the archive files yt-dlp-archive-video.txt
or yt-dlp-archive-audio.txt
respectively. So when you run the application agin on the same targets, the downloader skips the content you already downloaded. So for the archiving to work propery, keep the archive file and leave it basically untouched.
- Quality settings are set for getting the best videos but with a highest resolution of 800p (to save disk space).
- Free formats are preferred.
- Title names which match a certain pattern are downloaded only Here, the title must include two keywords in order to be triggered for downloading: sleep and meditation. This is useful to execute a targeted filter towards the title name. In a channel about spirituality for example, you get only content which is about a possible interaction of sleep and meditation.
- Output file names are set to be congruent to windows file name prerequisites.
- Output file naming pattern is here: /channel/video/playlist/title - license-comments-likes-views
Example output:
Why Do We Fall Asleep in Meditation - Questions and Answers with Shunyamurti - NA-51comments-422likes-8408views.webm
- Metadata and thumbnail picture are saved.
- The video's description text is being saved to a file with extension
.description
. - A JSON file is being saved with details of the downloaded content which is suitable for post-processing in your online application.
- The comments will be saved inside the json file too
- Subtitle file is being downloaded too, if available
The options of the video context is equal; though video format settings are replaced with audio settings:
- An order of file formats are set:
opus
format is preferred overmp3
is preferred overaac
is preferred overm4a
- The audio quality is set as 5 of 10, while 0 is best and 10 is worst quality. This provides decent quality but not extreme (which can be adequate for vocal content such as a podcast or an audio book). Set this value lower in case you require high quality for i.e. an audiophile music experience or activate the line below in the configuration file which yields for the high resolution FLAC file format. When choosing quality, think about that higher quality demands usually more disk space and that the downloads take longer.
- Output file naming pattern is here: /channel/audio/playlist/title - license-comments-likes-views
Nearly infinite customization possible. If you are a beginner, you can start with modifying values given in the configuration files.-
- Install yt-dlp (see below)
- Insert the youtube content URLs you are targeting into the channels file.
- Open the configuration file and set in line 4 the path for where you keep your channels and archive file. After, set the download path in line 6 where you want your downloads to be saved.
You run it via yt-dlp --config-clocation "c:\path\to\the\configfile"
The environment used is
- yt-dlp: https://github.com/yt-dlp/yt-dlp
Thank you to its developers.
Download the latest release and copy the extracted file into the folder of your development setup, i.e. c:\users\username\Anaconda3\
if you have installed the Anaconda package.
Author: Jonas Dossmann
Distributed under the UNLICENSE license.