diff --git a/.aliases b/.aliases index 118fb0a..1af1ba1 100644 --- a/.aliases +++ b/.aliases @@ -437,6 +437,9 @@ download_youtube_vid() { return fi + printf "${BOLD}${RED}USING TEMP FIX FOR YOUTUBE FORMAT ISSUES BY SETTING THE CLIENT TO tv_simply. SEE https://github.com/yt-dlp/yt-dlp/issues/13930\n\n${NORMAL}" + opts+=" --extractor-args youtube:player-client=default,tv_simply" + if [[ $shortname == "1" || $transcribe == "1" ]]; then printf "${BOLD}Downloading Youtube vid " if [[ $shortname == "1" ]]; then printf "| ${YELLOW}using short name${NORMAL}${BOLD} "; fi @@ -448,13 +451,10 @@ download_youtube_vid() { if [[ $format == "" ]]; then printf "${BOLD}No format given; using best available.${NORMAL}\n" - # Download best mp4 video. - format="bv*[ext=mp4]+ba[ext=m4a]" + # Download best mp4 video, best audio then merge. + format="bv[ext=mp4]+ba[ext=m4a]" fi - # We're assuming we'll always have an mp4 video only and audio track to merge. - opts+=" --merge-output-format mp4 --write-subs --sub-lang en --embed-subs" - if [[ $make_folder == "1" ]]; then make_vid_dir_and_cd_into $url "" if [[ $? -ne 0 ]]; then @@ -474,6 +474,9 @@ download_youtube_vid() { printf "filename: $filename\n" # Download the video. + # We're assuming we'll always have an mp4 video only and audio track to merge. + opts+=" --merge-output-format mp4 --write-subs --sub-lang en --embed-subs --embed-thumbnail --embed-metadata" + local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. error=$? @@ -508,20 +511,22 @@ download_youtube_playlist() { local url="$2" local dir_name="$3" shift 3 - local opts="$@ --write-sub --sub-lang en --embed-subs" + local opts="$@" if [[ $url == "" || $dir_name == "" ]]; then error "Usage: " return fi + printf "${BOLD}${RED}USING TEMP FIX FOR YOUTUBE FORMAT ISSUES BY SETTING THE CLIENT TO tv_simply. SEE https://github.com/yt-dlp/yt-dlp/issues/13930\n\n${NORMAL}" + opts+=" --extractor-args youtube:player-client=default,tv_simply" + printf "${BOLD}Downloading Youtube playlist\n\n${NORMAL}" if [[ $format == "" ]]; then printf "${BOLD}No format given; using best available.${NORMAL}\n" - # Download best mp4 video and best m4a audio, then merge. - format="bv*[ext=mp4]+ba[ext=m4a]" - opts+=" --merge-output-format mp4" + # Download best mp4 video, best audio then merge. + format="bv[ext=mp4]+ba[ext=m4a]" fi make_vid_dir_and_cd_into $url "$dir_name" @@ -529,6 +534,9 @@ download_youtube_playlist() { return fi + # We're assuming we'll always have an mp4 video only and audio track to merge. + opts+=" --merge-output-format mp4 --write-subs --sub-lang en --embed-subs --embed-thumbnail --embed-metadata" + local cmd="yt-dlp.exe -f $format -o \"%(playlist_index)03d--%(upload_date>%Y-%m-%d)s-%(title)s-yt-%(id)s.%(ext)s\" $opts $url" eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. @@ -598,6 +606,9 @@ function download_youtube_audio() { return fi + printf "${BOLD}${RED}USING TEMP FIX FOR YOUTUBE FORMAT ISSUES BY SETTING THE CLIENT TO tv_simply. SEE https://github.com/yt-dlp/yt-dlp/issues/13930\n\n${NORMAL}" + opts+=" --extractor-args youtube:player-client=default,tv_simply" + printf "${BOLD}Downloading Youtube audio\n\n${NORMAL}" if [[ $make_folder == "1" ]]; then @@ -680,7 +691,7 @@ download_twitch_chat() { # `tw-1080p60 --cookies /c//twitch_cookies.txt` # # To extract a portion of a video, you have to first download the entire file and then use the -# `trim-video` or `compress-video-and-trim` scripts. +# `trim-video` or `compress-video' with a time range. # download_twitch_vid() { local format="$1" @@ -758,6 +769,8 @@ download_twitch_vid() { local cmd="streamlink.exe --twitch-low-latency --twitch-disable-ads --twitch-disable-hosting --force --progress=force $opts $url $streamlink_format -O | ffmpeg -i pipe:0 -c copy \"$filename\"" else printf "${YELLOW}${BOLD}\nUsing yt-dlp to download...${NORMAL}\n" + opts+=" --embed-thumbnail --embed-metadata" + local cmd="yt-dlp.exe -f $yt_dlp_format -o \"$filename\" $opts $url" fi @@ -810,10 +823,13 @@ download_vimeo_vid() { if [[ $format == "" ]]; then printf "${BOLD}No format given; using best available.${NORMAL}\n" - # Download best mp4 video. - format="bv*[ext=mp4]+ba[ext=m4a]" + # Download best mp4 video, best audio then merge. + format="bv[ext=mp4]+ba[ext=m4a]" fi + # We're assuming we'll always have an mp4 video only and audio track to merge. + opts+=" --merge-output-format mp4 --write-subs --sub-lang en --embed-subs --embed-thumbnail --embed-metadata" + if [[ $shortname == "1" || $compress == "1" || $transcribe == "1" ]]; then printf "${BOLD}Downloading Vimeo vid " if [[ $shortname == "1" ]]; then printf "| ${YELLOW}using short name${NORMAL}${BOLD} "; fi @@ -926,6 +942,7 @@ download_twitter_vid() { printf "filename: $filename\n" # Download the video. + opts+=" --embed-thumbnail --embed-metadata" local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. @@ -990,6 +1007,7 @@ download_instagram_vid() { printf "filename: $filename\n" # Download the video. + opts+=" --embed-thumbnail --embed-metadata" local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. @@ -1247,28 +1265,13 @@ alias download-audio-from-m3u8='echo Use download-audio-from-stream instead.' # Video Compression #################################################################################################### -function _compress_video_hard() { - local crf=35 - local name="$1" - local out="$2" - if [[ name == "" || out == "" ]]; then - error "Usage: cmd " - return - fi - # 0=cpu, 1=gpu - compress-video-with-crf $crf "$name" "$out" 0 -} - -alias compress-video-hard='_compress_video_hard' - alias cv='compress-video' -alias cvh='compress-video-hard' alias jv='join-video' alias av='analyze-volume' alias aa='analyze-volume' alias nv='normalize-volume' alias na='normalize-volume' -alias tv='trim-video-vbr' +alias tv='echo can just do a cv with a time range...' #trim-video-vbr' #################################################################################################### # Git