Update some download aliases, vimrc search for cursor term, and some volume scripts
This commit is contained in:
47
.aliases
47
.aliases
@@ -110,8 +110,12 @@ remove_windows_file() {
|
||||
fi
|
||||
}
|
||||
|
||||
open_explorer_here() {
|
||||
local path_expanded=$(expand_path "$1")
|
||||
open_explorer() {
|
||||
local target="$1"
|
||||
if [[ $target == "" ]]; then
|
||||
target="$PWD"
|
||||
fi
|
||||
local path_expanded=$(expand_path "$target")
|
||||
if [[ -d $path_expanded ]]; then
|
||||
local path=$(unix_to_windows_path "$path_expanded")
|
||||
explorer.exe "$path"
|
||||
@@ -259,7 +263,7 @@ dos2unix_all() {
|
||||
}
|
||||
alias d2u='dos2unix_all'
|
||||
|
||||
alias e='open_explorer_here "$PWD"'
|
||||
alias e='open_explorer'
|
||||
alias exp='echo "Use e instead."'
|
||||
alias f='fg'
|
||||
alias hist='history'
|
||||
@@ -352,7 +356,7 @@ make_vid_dir_and_cd_into() {
|
||||
|
||||
dir_name=$(remove_extra_spaces "$dir_name")
|
||||
|
||||
printf "${BOLD}Creating directory ${YELLOW}'$dir_name'${NORMAL}\n"
|
||||
printf "${BOLD}Creating directory ${YELLOW}\"$dir_name\"${NORMAL}\n"
|
||||
mkdir "$dir_name" 2>/dev/null
|
||||
cd "$dir_name"
|
||||
|
||||
@@ -999,9 +1003,12 @@ download_mp4() {
|
||||
mv $temp_name "$filename.mp4"
|
||||
}
|
||||
|
||||
# Download from m3u8 stream to mp4.
|
||||
# You can supply a local file or a URL to the m3u8 file. If the request requires cookies then the easiest way to do it is to
|
||||
# run the ffmpeg command yourself using this as the example format:
|
||||
# Download a stream to mp4. Can be from an m3u8 file, an mpd, etc. Whatever the
|
||||
# supported extensions are from ffmpeg.
|
||||
#
|
||||
# You can supply a local file or a URL to the stream file. If the request
|
||||
# requires cookies then the easiest way to do it is to run the ffmpeg command
|
||||
# yourself using this as the example format:
|
||||
#
|
||||
# ffmpeg -protocol_whitelist file,https,crypto,tls,tcp -headers $'Cookie: CloudFront-Policy=ayJT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m56dA__; CloudFront-Key-Pair-Id=APK3IWIJLRLBNXI2PR4Q\r\n' -i https://video.stellartickets.com/organizations/2ad4a0ac-bec7-4863-a0f1-36247cc83d23/transcoded/91afb281-07-20-23_Krazam_Presents_index_1080p_20230721T024151_1.m3u8 -acodec copy -vcodec copy krazam.mp4
|
||||
#
|
||||
@@ -1012,17 +1019,17 @@ download_mp4() {
|
||||
#
|
||||
# If you need to debug the http request then add "-v trace" to the command above.
|
||||
#
|
||||
download_mp4_from_m3u8() {
|
||||
local m3u8_path="$1"
|
||||
download_mp4_from_stream() {
|
||||
local stream_path="$1"
|
||||
local filename="$2"
|
||||
|
||||
if [[ $m3u8_path == "" || $filename == "" ]]; then
|
||||
error "Usage: <m3u8 path> <filename>"
|
||||
if [[ $stream_path == "" || $filename == "" ]]; then
|
||||
error "Usage: <stream path> <filename>"
|
||||
return
|
||||
fi
|
||||
|
||||
printf "${BOLD}Downloading: ${YELLOW}$filename${NORMAL}\n"
|
||||
ffmpeg.exe -protocol_whitelist file,data,https,crypto,tls,tcp -allowed_extensions ALL -i $m3u8_path -acodec copy -vcodec copy "${filename}.mp4"
|
||||
ffmpeg.exe -protocol_whitelist file,data,https,crypto,tls,tcp -allowed_extensions ALL -i $stream_path -acodec copy -vcodec copy "${filename}.mp4"
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
error "Error: failed to download."
|
||||
@@ -1033,17 +1040,17 @@ download_mp4_from_m3u8() {
|
||||
}
|
||||
|
||||
# Same notes from above regarding cookies/headers.
|
||||
download_aac_from_m3u8() {
|
||||
local m3u8_path="$1"
|
||||
download_aac_from_stream() {
|
||||
local stream_path="$1"
|
||||
local filename="$2"
|
||||
|
||||
if [[ $m3u8_path == "" || $filename == "" ]]; then
|
||||
error "Usage: <m3u8 path> <filename>"
|
||||
if [[ $stream_path == "" || $filename == "" ]]; then
|
||||
error "Usage: <stream path> <filename>"
|
||||
return
|
||||
fi
|
||||
|
||||
printf "${BOLD}Downloading: ${YELLOW}$filename${NORMAL}\n"
|
||||
ffmpeg.exe -protocol_whitelist file,https,crypto,tls,tcp -i $m3u8_path -acodec copy "${filename}.aac"
|
||||
ffmpeg.exe -protocol_whitelist file,https,crypto,tls,tcp -i $stream_path -acodec copy "${filename}.aac"
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
error "Error: failed to download."
|
||||
@@ -1185,8 +1192,10 @@ alias twitter='download_twitter_vid "" '
|
||||
# Misc
|
||||
#-------------------------------------------------
|
||||
alias download-mp4='download_mp4'
|
||||
alias download-from-m3u8='download_mp4_from_m3u8'
|
||||
alias download-audio-from-m3u8='download_aac_from_m3u8'
|
||||
alias download-from-stream='download_mp4_from_stream'
|
||||
alias download-from-m3u8='echo Use download-from-stream instead.'
|
||||
alias download-audio-from-stream='download_aac_from_stream'
|
||||
alias download-audio-from-m3u8='echo Use download-audio-from-stream instead.'
|
||||
|
||||
####################################################################################################
|
||||
# Video Compression
|
||||
|
||||
Reference in New Issue
Block a user