From a9e468dce1692330d0c2c1a4771a2d94bd6ed8ff Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Wed, 20 Jul 2022 12:12:23 +0200 Subject: [PATCH] Added examples to yt-dlp's notes --- knowledge base/yt-dlp.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/knowledge base/yt-dlp.md b/knowledge base/yt-dlp.md index b5c98e3..ec12761 100644 --- a/knowledge base/yt-dlp.md +++ b/knowledge base/yt-dlp.md @@ -16,6 +16,9 @@ yt-dlp -F AK44wAvv2E4 # See all available information from a video. yt-dlp -j BaW_jenozKc +# List available subtitiles. +yt-dlp --list-subs rQnNghhPw6o + # Check what name will be used for the destination. # Output templates at https://github.com/yt-dlp/yt-dlp#output-template, or use # '-j' to see the json file with all of them. @@ -26,6 +29,19 @@ yt-dlp --get-filename \ # Download all videos in a YouTube channel. yt-dlp -f "bestvideo+bestaudio/best" -ciw \ -o "%(title)s.%(ext)s" -v https://www.youtube.com/c/pbsspacetime/videos + +# As above with improvements. +# Slow down the requests to avoid issues in retrieving the data. +# Include chapters, metadata and selected subtitles. +# Prefix the file name with its timestamp, or upload date if it is null. +yt-dlp -ciw \ + --retry-sleep 3 --sleep-requests 0 --sleep-subtitles 3 \ + --embed-chapters --embed-metadata --embed-subs \ + --sub-langs "(de|en|fr|es|it|ja|nl|zh(-Han.*)?)(-en)?" \ + --sub-format "ass/srt/best" --write-auto-subs \ + -f "bestvideo+bestaudio/best" \ + -o "%(timestamp>%Y-%m-%d,upload_date>%Y-%m-%d)s %(title)s.%(ext)s" \ + https://www.youtube.com/c/becausescience/videos ``` ## Further readings