====== Youtube-dl ====== Great tool for downloading from [[youtube]], and elsewhere. It's [[github>ytdl-org/youtube-dl/issues/29965|currently unmaintained]], so I've switched to a fork called [[yt-dlp]] to get around slow speeds downloading from Youtube. ===== Useful Arguments ===== ^ ''-F'' | List available formats for the video. | ^ ''-f\_[code]'' | Format, use code from ''-F'' list. Default is highest quality. | ^ ''-i'' | Ignore errors. Sometimes comes in handy when trivial errors are holding things up. | ^ ''-o'' | Lets you set a template to format the filenames of the output. | ^ ''-v'' | Verbose process info. Good if something's going wrong. | ^ ''-w'' | Don't overwrite files. | ===== Configuration ===== You can put any argument in the file ''~/.config/youtube-dl/config'', and it will add them any time it runs. So it's an easy way to specify a common download location and naming template, for example. Mine just looks like this: # Output template --output ~/Downloads/%(title)s-%(id)s.%(ext)s ===== Uses ===== ==== Video ==== YTDL will automatically grab the best-quality version, so often ''youtube-dl [url]'' is sufficient. ==== Getting Audio from Videos ==== Good for getting music on there, though if you can find it somewhere else in a not-video format it'll probably be better quality? Still, this comes in really handy when you just want to share a song or something. - ''youtube-dl -F [url]'' to list formats, then - ''youtube-dl -f [number] [url]'' to download selected. * __OR__ ''youtube-dl %%--%%audio%%-%%format best -x'' will just grab the best quality one. * Either option'll be a silly format like .m4a or .opus, so if you want to convert it to .mp3 or .ogg (for example) use [[ffmpeg]]\\ ''ffmpeg -i [filename.m4a] [filename.mp3|ogg]'' ==== Channel ==== You can grab all the videos from a channel too! ''youtube-dl [url]'' So just like normal, but you add the channel's URL instead of the video's. * https://askubuntu.com/questions/856911/using-youtube-dl-to-download-entire-youtube-channel ===== GUI ===== Been researching making or installing a web interface to combine with a YTDL setup on [[qnap_ts-231p|my NAS]]. Here're some links: * [[https://oleksis.github.io/youtube-dl-gui/|yt-dlg]] - [[Python]]. * [[github>Rudloff/alltube]] - Seems overly complicated? * https://old.reddit.com/r/qnap/comments/8hu6me/how_to_download_youtube_using_qnap/ * https://old.reddit.com/r/qnap/comments/lipv1p/help_with_youtubedl_installation/ * https://old.reddit.com/r/qnap/comments/8hu6me/how_to_download_youtube_using_qnap/ * https://forum.qnap.com/viewtopic.php?t=134916 * [[https://tartube.sourceforge.io/|Tartube]] ===== Links ===== * https://youtube-dl.org/ * [[github>ytdl-org/youtube-dl]] * [[yt-dlp]] - Fork with more features, and project activity. {{tag>software cli guide open-source youtube}}