Upgrade yt_dlp and download script
This commit is contained in:
@@ -8,12 +8,29 @@
|
||||
|
||||
|
||||
function main() {
|
||||
cd "$(dirname "")"
|
||||
echo "Working Dir: " $(pwd)
|
||||
_STARGET="${1}"
|
||||
_SPATH="${HOME}/.config/solarfm/plugins/youtube_download"
|
||||
LINK=`xclip -selection clipboard -o`
|
||||
|
||||
python "${HOME}/.config/solarfm/plugins/youtube_download/yt_dlp/__main__.py" \
|
||||
--write-sub --embed-sub --sub-langs en \
|
||||
-o "${1}/%(title)s.%(ext)s" "${LINK}"
|
||||
cd "${_SPATH}"
|
||||
echo "Working Dir: " $(pwd)
|
||||
|
||||
rm "${_SPATH}/../../cookies.txt"
|
||||
|
||||
# Note: Export cookies to file
|
||||
python "${_SPATH}/yt_dlp/__main__.py" \
|
||||
--cookies-from-browser firefox --cookies "${_SPATH}/../../cookies.txt"
|
||||
|
||||
# Note: Use cookies from browser directly
|
||||
# python "${_SPATH}/yt_dlp/__main__.py" \
|
||||
# --cookies-from-browser firefox --write-sub --embed-sub --sub-langs en \
|
||||
# -o "${_STARGET}/%(title)s.%(ext)s" "${LINK}"
|
||||
|
||||
# Note: Download video
|
||||
python "${_SPATH}/yt_dlp/__main__.py" \
|
||||
-f "bestvideo[height<=1080][ext=mp4][vcodec^=avc]+bestaudio[ext=m4a]/best[ext=mp4]/best" \
|
||||
--cookies "${_SPATH}/../../cookies.txt" --write-sub --embed-sub --sub-langs en \
|
||||
-o "${_STARGET}/%(title)s.%(ext)s" "${LINK}"
|
||||
|
||||
}
|
||||
main "$@";
|
||||
main "$@";
|
Reference in New Issue
Block a user