Files
SolarFM/plugins/youtube_download/download.sh

41 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
# . CONFIG.sh
# set -o xtrace ## To debug scripts
# set -o errexit ## To exit on error
# set -o errunset ## To exit if a variable is referenced but not set
function main() {
2025-05-02 16:11:08 -05:00
_STARGET="${1}"
_SPATH="${HOME}/.config/solarfm/plugins/youtube_download"
LINK=`xclip -selection clipboard -o`
2025-05-02 16:11:08 -05:00
cd "${_SPATH}"
echo "Working Dir: " $(pwd)
2026-05-26 20:50:58 -05:00
# rm "${_SPATH}/../../cookies.txt"
2025-05-02 16:11:08 -05:00
# Note: Export cookies to file
# python "${_SPATH}/yt_dlp/__main__.py" \
2026-05-26 20:50:58 -05:00
# --cookies-from-browser firefox --cookies "${_SPATH}/../../cookies.txt"
2025-05-02 16:11:08 -05:00
python "${_SPATH}/yt_dlp/__main__.py" \
2026-05-26 20:50:58 -05:00
--js-runtimes deno \
--cookies-from-browser firefox \
--concurrent-fragments 8 \
--embed-metadata \
--embed-thumbnail \
--write-auto-subs \
--sub-langs "en.*" \
--embed-subs \
--merge-output-format mp4 \
--remux-video mp4 \
-f "bv*[height<=1080]+ba/b[height<=1080]" \
-o "${_STARGET}/%(title)s.%(ext)s" "${LINK}"
"${LINK}"
2025-05-02 16:11:08 -05:00
}
2025-05-02 16:11:08 -05:00
main "$@";