Skip to content

Commit

Permalink
update yt_dlp
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlivio committed Dec 8, 2024
1 parent 2bda3d6 commit 8ee16d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions programs/yt-dlp.bash
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
ARGS_ALL="--no-warnings --windows-filenames --output '%(title)s.%(ext)s'"
ARGS_BACTH="$AR--download-archive .downloaded.txt --no-playlist"

function yt_dlp_sub_en() {
function yt_dlp_sub_en_url() {
: ${1?"Usage: ${FUNCNAME[0]} <url to video>"}
local url=${1%%&*} # remove all after & (to leave only www.youtube.com/watch?v=...)
yt-dlp $ARGS_ALL --skip-download --write-sub --write-auto-sub --convert-subs srt --sub-lang en "$url"
}

function yt_dlp_audio() {
function yt_dlp_audio_from_url_or_list_url() {
: ${1?"Usage: ${FUNCNAME[0]} <url to audio or list>"}
yt-dlp $ARGS_ALL --extract-audio --audio-format m4a "$1"
}

function yt_dlp_audio_from_txt() {
function yt_dlp_audio_from_urls_at_txt() {
: ${1?"Usage: ${FUNCNAME[0]} <url to audio or list>"}
yt-dlp $ARGS_ALL $ARGS_BACTH --extract-audio --audio-format m4a --batch-file "$1"
}

function yt_dlp_video_from_txt() {
function yt_dlp_video_from_urls_at_txt() {
: ${1?"Usage: ${FUNCNAME[0]} <url to audio or list>"}
yt-dlp $ARGS_ALL $ARGS_BACTH --recode-video mp4 --batch-file "$1"
}

function yt_dlp_video_480() {
function yt_dlp_video_480_from_url_or_list_url() {
: ${1?"Usage: ${FUNCNAME[0]} <url to video or list>"}
yt-dlp $ARGS_ALL -f 'best[height<=480]' --recode-video mp4 "$1"
}

function yt_dlp_video_480_from_txt() {
function yt_dlp_video_480_from_urls_at_txt() {
: ${1?"Usage: ${FUNCNAME[0]} <txt_file>"}
yt-dlp $ARGS_ALL $ARGS_BACTH -f 'best[height<=480]' --recode-video mp4 --batch-file "$1"
}

0 comments on commit 8ee16d7

Please sign in to comment.