Home / Media
A tool for downloading videos from a variety of site (not just YouTube).
docker run --rm -v//$PWD:/downloads wernight/youtube-dl <...>
ffmpeg
to allow downloading best quality audio and video.youtube-dl -c <URL>
-c
/--continue
to re-run the command if it previously failed during download.youtube-dl -qiwc --no-warnings [-o <format>] <URL>
-q
/--quiet
and --no-warnings
to only errors. Alternatively, redirect STDERR to a log file and keep STDOUT non-quiet to be able to check the status. There may be videos that fail to download for different reasons, so do watch for errors.-i
/--ignore-errors
to avoid stopping on errors.-wc
/--no-overwrites --continue
to download only new/missing videos.-o <format>
to specify the output filename format. See below.-f bestvideo+bestaudio
to download the best video format and best audio format and (by default) merge them. This is the default, but only as long as “ffmpeg” is installed. If it’s not installed and this option is not specified, it may instead download a lower quality format.youtube-dl -c --extract-audio --audio-quality 0
--audio-format <format>
: Audio format, like “mp3”, “wav”, etc. Defaults to “best”.--audio-quality <0-9>
: Audio quality, where 0 is best. Defaults to “5”.-o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s"
youtube-dl -iwc -f bestvideo+bestaudio -o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s" <url>
youtube-dl -iwc -f bestvideo+bestaudio --cookie ~/cookies.txt -o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s" <url>
--cookie <file>
option (see How do I pass cookies to youtube-dl? (youtube-dl)).CDs and DVDs use 2048 byte sectors and may have both unintentional and intentional data errors. Some will explode in size when you try to rip them. There are multiple methods to try. I recommend using ddrescue since it’s the simplest and because of its error handling features.
Install support for encrypted/protected DVDs:
contrib
or non-free
repo areas (I’m not sure which).apt install libdvd-pkg && dpkg-reconfigure libdvd-pkg
Gather information about the disc:
apt install genisoimage
isoinfo -d -i /dev/sr0
apt install dvdbackup
dvdbackup -i /dev/sr0 -I
dvdbackup -i /dev/sr0 -o . -M
genisoimage -dvd-video -udf -o <name>{.iso,}
apt install vobcopy
mkdir -p /media/dvd && mount /dev/dvd /media/dvd
vobcopy -i /media/dvd -l -m
umount /media/dvd
If the disc is damaged, use ddrescue instead.
isosize -x /dev/sr0
dd if=/dev/sr0 of=<name>.iso bs=2048 count=3659360 conv=noerror status=progress
conv=noerror
prevents halting on error and writes zero to the output instead.ddrescue is a sophisticated recovery tool which gracefully handles read errors. When using a map file, it can be aborted and run multiple times and using different sources to try to fix corrupt sections. A typical way to use this method is to run it with fast options first and then optionally with slower options afterwards. When the output is a regular file, the corrupt sectors will contain zeros. This method can also be used to backup dying hard drives etc., but the options used below are for CD/DVD discs.
apt install gddrescue
ddrescue -n -b2048 /dev/sr0 <name>.{iso,map}
ddrescue -d -r1 -b2048 /dev/sr0 <name>.{iso,map}