From 62fa34ca20b94bca09c80f010a2d46249514a987 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Wed, 2 Aug 2023 15:11:38 -0400 Subject: [PATCH] Update aliases --- .aliases | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.aliases b/.aliases index f0039cb..b21a6ce 100644 --- a/.aliases +++ b/.aliases @@ -928,7 +928,7 @@ download_mp4() { # # If you need to debug the http request then add "-v trace" to the command above. # -download_from_m3u8() { +download_mp4_from_m3u8() { local m3u8_path="$1" local filename="$2" @@ -948,6 +948,27 @@ download_from_m3u8() { printf "${BOLD}Finished downloading ${YELLOW}$filename${NORMAL}\n" } +# Same notes from above regarding cookies/headers. +download_aac_from_m3u8() { + local m3u8_path="$1" + local filename="$2" + + if [[ $m3u8_path == "" || $filename == "" ]]; then + error "Usage: " + 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" + + if [[ $? -ne 0 ]]; then + error "Error: failed to download." + return + fi + + printf "${BOLD}Finished downloading ${YELLOW}$filename${NORMAL}\n" +} + #------------------------------------------------- # YouTube Vid DL @@ -1072,7 +1093,8 @@ alias twitter='download_twitter_vid "" ' # Misc #------------------------------------------------- alias download-mp4='download_mp4' -alias download-from-m3u8='download_from_m3u8' +alias download-from-m3u8='download_mp4_from_m3u8' +alias download-audio-from-m3u8='download_aac_from_m3u8' #################################################################################################### # Video Compression