alias install_no="sudo pacman -Sy" alias install_ya="yay -S --noconfirm" # Compress a video with CUDA acceleration (GPU from NVIDIA is required) function reducevideo { ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2" } alias reducevideo="reducevideo" # Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more. function ytdl { yt-dlp --check-formats --progress -f "bv*[height<1080][ext=mp4]+ba" --write-info-json --embed-metadata --convert-thumbnail jpg --embed-thumbnail --embed-chapters --embed-info-json --sponsorblock-mark all -o "/mnt/Storage/YouTube/videos/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" "$1" } alias ytdl="ytdl" # Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file. function ytdla { yt-dlp --no-call-home --no-part --add-metadata --embed-thumbnail --audio-format "mp3" --extract-audio --format bestaudio/best -x -w -o "/mnt/Storage/YouTube/audio/%(uploader)s/%(upload_date>%Y-%m-%d)s - %(title)s (%(id)s).%(ext)s" "$1" } alias ytdla="ytdla" # Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram. function reduceimage { convert -resize 2000x2000 -quality 70 "$1".jpg "$1"-r.webp exiftool -overwrite_original -all= "$1"-r.webp } alias reduceimage="reduceimage"