Renaming alias stuff

This commit is contained in:
Michael Campagnaro 2023-03-01 15:27:38 -05:00
parent 2e07b0c85f
commit 84b221bdb9
2 changed files with 64 additions and 61 deletions

116
aliases
View File

@ -350,7 +350,7 @@ make_vid_dir_and_cd_into() {
} }
# Download YouTube videos. Note that yt-dlp downloads a lot faster than streamlink. # Download YouTube videos. Note that yt-dlp downloads a lot faster than streamlink.
dl_youtube_vid() { download_youtube_vid() {
local format="$1" local format="$1"
local shortname="$2" local shortname="$2"
local make_folder="$3" local make_folder="$3"
@ -402,7 +402,7 @@ dl_youtube_vid() {
} }
# Download YouTube video and flip horizontally. # Download YouTube video and flip horizontally.
dl_youtube_vid_and_hflip() { download_youtube_vid_and_hflip() {
local format="$1" local format="$1"
local make_folder="$2" local make_folder="$2"
local url="$3" local url="$3"
@ -446,7 +446,7 @@ dl_youtube_vid_and_hflip() {
fi fi
} }
dl_youtube_playlist() { download_youtube_playlist() {
local format="$1" local format="$1"
local url="$2" local url="$2"
local dir_name="$3" local dir_name="$3"
@ -483,7 +483,7 @@ dl_youtube_playlist() {
} }
# Download Twitch chat transcript # Download Twitch chat transcript
actually_dl_twitch_chat() { actually_download_twitch_chat() {
local url="$1" local url="$1"
local filename="$2" local filename="$2"
@ -496,7 +496,7 @@ actually_dl_twitch_chat() {
fi fi
} }
dl_twitch_chat() { download_twitch_chat() {
local make_folder="$1" local make_folder="$1"
local url="$2" local url="$2"
shift 2 shift 2
@ -514,7 +514,7 @@ dl_twitch_chat() {
fi fi
fi fi
actually_dl_twitch_chat $url "$(yt-dlp.exe --get-filename -o "%(upload_date>%Y-%m-%d)s-%(title)s-tw-%(id)s" $opts $url)" actually_download_twitch_chat $url "$(yt-dlp.exe --get-filename -o "%(upload_date>%Y-%m-%d)s-%(title)s-tw-%(id)s" $opts $url)"
if [[ $make_folder == "1" ]]; then if [[ $make_folder == "1" ]]; then
cd .. cd ..
@ -532,7 +532,7 @@ dl_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-and-trim` scripts. # `trim-video` or `compress-video-and-trim` scripts.
# #
dl_twitch_vid() { download_twitch_vid() {
local format="$1" local format="$1"
local shortname="$2" local shortname="$2"
local compress="$3" local compress="$3"
@ -590,7 +590,7 @@ dl_twitch_vid() {
fi fi
# Download Twitch chat transcript # Download Twitch chat transcript
actually_dl_twitch_chat $url "$(yt-dlp.exe --get-filename -o "$name_format" $opts $url)" actually_download_twitch_chat $url "$(yt-dlp.exe --get-filename -o "$name_format" $opts $url)"
# Get the video filename. # Get the video filename.
local filename=$(yt-dlp.exe --get-filename -o "$name_format.%(ext)s" $opts $url) local filename=$(yt-dlp.exe --get-filename -o "$name_format.%(ext)s" $opts $url)
@ -628,7 +628,7 @@ dl_twitch_vid() {
# Can download an embedded vid. You might need to save the site cookies if the vid is behind a paywall. # Can download an embedded vid. You might need to save the site cookies if the vid is behind a paywall.
# e.g. yt-dlp.exe -F --cookies cookies.txt --referer https://gillyandkeeves.tv https://player.vimeo.com/video/756941969 # e.g. yt-dlp.exe -F --cookies cookies.txt --referer https://gillyandkeeves.tv https://player.vimeo.com/video/756941969
# The vid ID can be found by looking at the embed's iframe src attribute. # The vid ID can be found by looking at the embed's iframe src attribute.
dl_vimeo_vid() { download_vimeo_vid() {
local format="$1" local format="$1"
local shortname="$2" local shortname="$2"
local compress="$3" local compress="$3"
@ -688,7 +688,7 @@ dl_vimeo_vid() {
} }
# Download Twitter videos. # Download Twitter videos.
dl_twitter_vid() { download_twitter_vid() {
local format="$1" local format="$1"
local make_folder="$2" local make_folder="$2"
local url="$3" local url="$3"
@ -739,7 +739,7 @@ dl_twitter_vid() {
} }
# Download MP4 video. # Download MP4 video.
dl_mp4() { download_mp4() {
local url="$1" local url="$1"
local filename="$2" local filename="$2"
@ -762,7 +762,7 @@ dl_mp4() {
} }
# Download from m3u8 stream to mp4. # Download from m3u8 stream to mp4.
dl_from_m3u8() { download_from_m3u8() {
local m3u8_path="$1" local m3u8_path="$1"
local filename="$2" local filename="$2"
@ -783,7 +783,7 @@ dl_from_m3u8() {
} }
# Download Instagram video and flip horizontally. # Download Instagram video and flip horizontally.
dl_instagram_vid_and_hflip() { download_instagram_vid_and_hflip() {
local url="$1" local url="$1"
local filename="$2" local filename="$2"
@ -809,68 +809,68 @@ dl_instagram_vid_and_hflip() {
} }
# YouTube Vid DL # YouTube Vid DL
alias yt='dl_youtube_vid "" $SHORTNAME_OFF' alias yt='download_youtube_vid "" $SHORTNAME_OFF'
alias yt-shortname='dl_youtube_vid "" $SHORTNAME_ON' alias yt-shortname='download_youtube_vid "" $SHORTNAME_ON'
alias yt-1080='dl_youtube_vid "137+140" $SHORTNAME_OFF' alias yt-1080='download_youtube_vid "137+140" $SHORTNAME_OFF'
alias yt-1080-shortname='dl_youtube_vid "137+140" $SHORTNAME_ON' alias yt-1080-shortname='download_youtube_vid "137+140" $SHORTNAME_ON'
alias yt-720='dl_youtube_vid "136+140" $SHORTNAME_OFF' alias yt-720='download_youtube_vid "136+140" $SHORTNAME_OFF'
alias yt-720-shortname='dl_youtube_vid "136+140" $SHORTNAME_ON' alias yt-720-shortname='download_youtube_vid "136+140" $SHORTNAME_ON'
alias yt-playlist='dl_youtube_playlist ""' alias yt-playlist='download_youtube_playlist ""'
alias yt-playlist-1080='dl_youtube_playlist "137+140"' alias yt-playlist-1080='download_youtube_playlist "137+140"'
alias yt-playlist-720='dl_youtube_playlist "136+140"' alias yt-playlist-720='download_youtube_playlist "136+140"'
alias yt-playlist-tiny='dl_youtube_playlist "160+140"' alias yt-playlist-tiny='download_youtube_playlist "160+140"'
alias yt-audio='yt-dlp.exe -f "140"' alias yt-audio='yt-dlp.exe -f "140"'
alias yt-and-hflip='dl_youtube_vid_and_hflip "137+140"' # 1080p alias yt-and-hflip='download_youtube_vid_and_hflip "137+140"' # 1080p
# Twitch Vid DL # Twitch Vid DL
alias tw='dl_twitch_vid "" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw='download_twitch_vid "" $SHORTNAME_OFF $COMPRESSION_OFF'
alias tw-compressed='dl_twitch_vid "" $SHORTNAME_OFF $COMPRESSION_ON' alias tw-compressed='download_twitch_vid "" $SHORTNAME_OFF $COMPRESSION_ON'
alias tw-shortname='dl_twitch_vid "" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-shortname='download_twitch_vid "" $SHORTNAME_ON $COMPRESSION_OFF'
alias tw-shortname-compressed='dl_twitch_vid "" $SHORTNAME_ON $COMPRESSION_ON' alias tw-shortname-compressed='download_twitch_vid "" $SHORTNAME_ON $COMPRESSION_ON'
alias tw-custom='dl_twitch_vid ' alias tw-custom='download_twitch_vid '
alias tw-chat='dl_twitch_chat' alias tw-chat='download_twitch_chat'
alias tw-1080='dl_twitch_vid "1080" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-1080='download_twitch_vid "1080" $SHORTNAME_OFF $COMPRESSION_OFF'
alias tw-1080-compressed='dl_twitch_vid "1080" $SHORTNAME_OFF $COMPRESSION_ON' alias tw-1080-compressed='download_twitch_vid "1080" $SHORTNAME_OFF $COMPRESSION_ON'
alias tw-1080-shortname='dl_twitch_vid "1080" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-1080-shortname='download_twitch_vid "1080" $SHORTNAME_ON $COMPRESSION_OFF'
alias tw-1080-shortname-compressed='dl_twitch_vid "1080" $SHORTNAME_ON $COMPRESSION_ON' alias tw-1080-shortname-compressed='download_twitch_vid "1080" $SHORTNAME_ON $COMPRESSION_ON'
alias tw-1080p60='dl_twitch_vid "1080p60" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-1080p60='download_twitch_vid "1080p60" $SHORTNAME_OFF $COMPRESSION_OFF'
alias tw-1080p50='dl_twitch_vid "1080p50" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-1080p50='download_twitch_vid "1080p50" $SHORTNAME_OFF $COMPRESSION_OFF'
alias tw-1080p60-compressed='dl_twitch_vid "1080p60" $SHORTNAME_OFF $COMPRESSION_ON' alias tw-1080p60-compressed='download_twitch_vid "1080p60" $SHORTNAME_OFF $COMPRESSION_ON'
alias tw-1080p50-compressed='dl_twitch_vid "1080p50" $SHORTNAME_OFF $COMPRESSION_ON' alias tw-1080p50-compressed='download_twitch_vid "1080p50" $SHORTNAME_OFF $COMPRESSION_ON'
alias tw-1080p60-shortname='dl_twitch_vid "1080p60" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-1080p60-shortname='download_twitch_vid "1080p60" $SHORTNAME_ON $COMPRESSION_OFF'
alias tw-1080p50-shortname='dl_twitch_vid "1080p50" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-1080p50-shortname='download_twitch_vid "1080p50" $SHORTNAME_ON $COMPRESSION_OFF'
alias tw-1080p60-shortname-compressed='dl_twitch_vid "1080p60" $SHORTNAME_ON $COMPRESSION_ON' alias tw-1080p60-shortname-compressed='download_twitch_vid "1080p60" $SHORTNAME_ON $COMPRESSION_ON'
alias tw-1080p50-shortname-compressed='dl_twitch_vid "1080p50" $SHORTNAME_ON $COMPRESSION_ON' alias tw-1080p50-shortname-compressed='download_twitch_vid "1080p50" $SHORTNAME_ON $COMPRESSION_ON'
alias tw-720='dl_twitch_vid "720p" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-720='download_twitch_vid "720p" $SHORTNAME_OFF $COMPRESSION_OFF'
alias tw-720-compressed='dl_twitch_vid "720p" $SHORTNAME_OFF $COMPRESSION_ON' alias tw-720-compressed='download_twitch_vid "720p" $SHORTNAME_OFF $COMPRESSION_ON'
alias tw-720-shortname='dl_twitch_vid "720p" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-720-shortname='download_twitch_vid "720p" $SHORTNAME_ON $COMPRESSION_OFF'
alias tw-720p60='dl_twitch_vid "720p60" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-720p60='download_twitch_vid "720p60" $SHORTNAME_OFF $COMPRESSION_OFF'
alias tw-720p60-shortname='dl_twitch_vid "720p60" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-720p60-shortname='download_twitch_vid "720p60" $SHORTNAME_ON $COMPRESSION_OFF'
alias tw-4k='dl_twitch_vid "2160p" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-4k='download_twitch_vid "2160p" $SHORTNAME_OFF $COMPRESSION_OFF'
alias tw-4k-compressed='dl_twitch_vid "2160p" $SHORTNAME_OFF $COMPRESSION_ON' alias tw-4k-compressed='download_twitch_vid "2160p" $SHORTNAME_OFF $COMPRESSION_ON'
alias tw-4k-shortname='dl_twitch_vid "2160p" $SHORTNAME_ON $COMPRESSION_OFF' alias tw-4k-shortname='download_twitch_vid "2160p" $SHORTNAME_ON $COMPRESSION_OFF'
alias tw-4k-shortname-compressed='dl_twitch_vid "2160p" $SHORTNAME_ON $COMPRESSION_ON' alias tw-4k-shortname-compressed='download_twitch_vid "2160p" $SHORTNAME_ON $COMPRESSION_ON'
alias tw-source='dl_twitch_vid "Source" $SHORTNAME_OFF $COMPRESSION_OFF' alias tw-source='download_twitch_vid "Source" $SHORTNAME_OFF $COMPRESSION_OFF'
# Vimeo Vid DL # Vimeo Vid DL
alias vimeo='dl_vimeo_vid "Original" $SHORTNAME_OFF $COMPRESSION_OFF' alias vimeo='download_vimeo_vid "Original" $SHORTNAME_OFF $COMPRESSION_OFF'
alias vimeo-compressed='dl_vimeo_vid "Original" $SHORTNAME_OFF $COMPRESSION_ON' alias vimeo-compressed='download_vimeo_vid "Original" $SHORTNAME_OFF $COMPRESSION_ON'
# Instagram Vid DL # Instagram Vid DL
alias ig-download-and-hflip='dl_instagram_vid_and_hflip ' alias ig-download-and-hflip='download_instagram_vid_and_hflip '
# Twitter Vid DL # Twitter Vid DL
alias twt='dl_twitter_vid "" ' alias twt='download_twitter_vid "" '
# Misc # Misc
alias download-mp4='dl_mp4' alias download-mp4='download_mp4'
alias download-from-m3u8='dl_from_m3u8' alias download-from-m3u8='download_from_m3u8'
#################################################################################################### ####################################################################################################
# Video Compression # Video Compression

View File

@ -24,13 +24,16 @@ else
NORMAL="" NORMAL=""
fi fi
warn() {
printf "${BOLD}${YELLOW}$1${NORMAL}"
}
error() { error() {
printf "${BOLD}${RED}$1${NORMAL}" printf "${RED}$1${NORMAL}"
} }
fatal() { fatal() {
msg=$1 printf "${RED}$1${NORMAL}\n"
printf "${RED}${msg}${NORMAL}\n"
exit 1 exit 1
} }