Update aliases
This commit is contained in:
parent
dcf670070d
commit
8c4fbcc4a8
37
.aliases
37
.aliases
|
@ -437,8 +437,8 @@ download_youtube_vid() {
|
||||||
return
|
return
|
||||||
fi
|
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}"
|
#printf "${BOLD}${RED}USING TEMP FIX FOR YOUTUBE FORMAT ISSUES BY SETTING THE CLIENT TO tv_simply.\nWAS FIXED (SEE https://github.com/yt-dlp/yt-dlp/issues/13930)\nBUT THE NEW VERSION IS DOWNLOADING LOWER BITRATE VIDS\nTHAN THIS FIX, SO THE PATCH STAYS FOR NOW!\n\n${NORMAL}"
|
||||||
opts+=" --extractor-args youtube:player-client=default,tv_simply"
|
#opts+=" --extractor-args youtube:player-client=default,tv_simply"
|
||||||
|
|
||||||
if [[ $shortname == "1" || $transcribe == "1" ]]; then
|
if [[ $shortname == "1" || $transcribe == "1" ]]; then
|
||||||
printf "${BOLD}Downloading Youtube vid "
|
printf "${BOLD}Downloading Youtube vid "
|
||||||
|
@ -693,6 +693,10 @@ download_twitch_chat() {
|
||||||
# To extract a portion of a video, you have to first download the entire file and then use the
|
# To extract a portion of a video, you have to first download the entire file and then use the
|
||||||
# `trim-video` or `compress-video' with a time range.
|
# `trim-video` or `compress-video' with a time range.
|
||||||
#
|
#
|
||||||
|
# To download the portion of a stream:
|
||||||
|
#
|
||||||
|
# yt-dlp -f "b" --external-downloader ffmpeg --external-downloader-args "ffmpeg_i:-ss 5:25:38.00 -to 5:56:50.00" URL
|
||||||
|
#
|
||||||
download_twitch_vid() {
|
download_twitch_vid() {
|
||||||
local format="$1"
|
local format="$1"
|
||||||
local shortname="$2"
|
local shortname="$2"
|
||||||
|
@ -712,12 +716,15 @@ download_twitch_vid() {
|
||||||
# It's a two step process because streamlink cannot pass the formatted filename to ffmpeg.
|
# It's a two step process because streamlink cannot pass the formatted filename to ffmpeg.
|
||||||
# We fallback to yt-dlp when it's a subscriber VOD because we don't have an easy way to access it with streamlink.
|
# We fallback to yt-dlp when it's a subscriber VOD because we don't have an easy way to access it with streamlink.
|
||||||
|
|
||||||
local subscriber_vod=0
|
local use_ytdlp=0
|
||||||
|
|
||||||
local split_opts=($opts)
|
local split_opts=($opts)
|
||||||
if [[ ${split_opts[0]} == "--cookies" ]]; then
|
for i in "${split_opts[@]}"; do
|
||||||
subscriber_vod=1
|
if [[ $i == "--cookies" ]]; then
|
||||||
printf "${BOLD}Subscriber VOD. Will use yt-dlp to download.${NORMAL}\n"
|
use_ytdlp=1
|
||||||
fi
|
printf "${BOLD}Subscriber VOD. Will use yt-dlp to download.${NORMAL}\n"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [[ $shortname == "1" || $compress == "1" || $transcribe == "1" ]]; then
|
if [[ $shortname == "1" || $compress == "1" || $transcribe == "1" ]]; then
|
||||||
printf "${BOLD}Downloading Twitch vid "
|
printf "${BOLD}Downloading Twitch vid "
|
||||||
|
@ -764,14 +771,13 @@ download_twitch_vid() {
|
||||||
printf "filename: $filename\n"
|
printf "filename: $filename\n"
|
||||||
|
|
||||||
# Download the video.
|
# Download the video.
|
||||||
if [[ $subscriber_vod == "0" ]]; then
|
if [[ $use_ytdlp == "1" ]]; then
|
||||||
printf "${YELLOW}${BOLD}\nUsing streamlink to download...${NORMAL}\n"
|
|
||||||
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"
|
printf "${YELLOW}${BOLD}\nUsing yt-dlp to download...${NORMAL}\n"
|
||||||
opts+=" --embed-thumbnail --embed-metadata"
|
opts+=" --embed-thumbnail --embed-metadata"
|
||||||
|
|
||||||
local cmd="yt-dlp.exe -f $yt_dlp_format -o \"$filename\" $opts $url"
|
local cmd="yt-dlp.exe -f $yt_dlp_format -o \"$filename\" $opts $url"
|
||||||
|
else
|
||||||
|
printf "${YELLOW}${BOLD}\nUsing streamlink to download...${NORMAL}\n"
|
||||||
|
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\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
|
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
|
||||||
|
@ -1273,6 +1279,13 @@ alias nv='normalize-volume'
|
||||||
alias na='normalize-volume'
|
alias na='normalize-volume'
|
||||||
alias tv='echo can just do a cv with a time range...' #trim-video-vbr'
|
alias tv='echo can just do a cv with a time range...' #trim-video-vbr'
|
||||||
|
|
||||||
|
function compress_and_normalize_volume() {
|
||||||
|
local final_name="$1"
|
||||||
|
compress-video f.mp4 ff ; normalize-volume ff.mp4 "$final_name"
|
||||||
|
}
|
||||||
|
|
||||||
|
alias cvn='compress_and_normalize_volume'
|
||||||
|
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
# Git
|
# Git
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
|
|
Loading…
Reference in New Issue
Block a user