airikr revised this gist 7 months ago. Go to revision
1 file changed, 37 insertions, 2 deletions
.bash_aliases
| @@ -13,7 +13,27 @@ alias reducevideo="reducevideo" | |||
| 13 | 13 | ||
| 14 | 14 | # Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more. | |
| 15 | 15 | function ytdl { | |
| 16 | - | 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" | |
| 16 | + | yt-dlp \ | |
| 17 | + | --check-formats \ | |
| 18 | + | --progress \ | |
| 19 | + | --ignore-errors \ | |
| 20 | + | --format "bv*[height<1080][ext=mp4]+ba" \ | |
| 21 | + | --merge-output mkv \ | |
| 22 | + | --write-info-json \ | |
| 23 | + | --write-annotations \ | |
| 24 | + | --write-thumbnail \ | |
| 25 | + | --convert-thumbnails jpg \ | |
| 26 | + | --add-metadata \ | |
| 27 | + | --convert-thumbnail jpg \ | |
| 28 | + | --embed-thumbnail \ | |
| 29 | + | --embed-chapters \ | |
| 30 | + | --embed-info-json \ | |
| 31 | + | --restrict-filenames \ | |
| 32 | + | --concurrent-fragments 3 \ | |
| 33 | + | --sponsorblock-mark all,-preview,-filler,-interaction \ | |
| 34 | + | -o "/to/dir/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" "$1" | |
| 35 | + | ||
| 36 | + | notify-send "Video file saved." | |
| 17 | 37 | } | |
| 18 | 38 | ||
| 19 | 39 | alias ytdl="ytdl" | |
| @@ -21,7 +41,22 @@ alias ytdl="ytdl" | |||
| 21 | 41 | ||
| 22 | 42 | # Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file. | |
| 23 | 43 | function ytdla { | |
| 24 | - | 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" | |
| 44 | + | yt-dlp \ | |
| 45 | + | --check-formats \ | |
| 46 | + | --progress \ | |
| 47 | + | --ignore-errors \ | |
| 48 | + | --write-info-json \ | |
| 49 | + | --no-call-home \ | |
| 50 | + | --add-metadata \ | |
| 51 | + | --audio-format "mp3" \ | |
| 52 | + | --extract-audio \ | |
| 53 | + | --format bestaudio/best \ | |
| 54 | + | --embed-thumbnail \ | |
| 55 | + | --restrict-filenames \ | |
| 56 | + | --concurrent-fragments 3 \ | |
| 57 | + | -o "/to/dir/%(uploader)s/%(upload_date>%Y-%m-%d)s - %(title)s (%(id)s).%(ext)s" "$1" | |
| 58 | + | ||
| 59 | + | notify-send "Audio filed saved." | |
| 25 | 60 | } | |
| 26 | 61 | ||
| 27 | 62 | alias ytdla="ytdla" | |
airikr revised this gist 7 months ago. Go to revision
1 file changed, 1 insertion
.bash_aliases
| @@ -1,5 +1,6 @@ | |||
| 1 | 1 | alias install_no="sudo pacman -Sy" | |
| 2 | 2 | alias install_ya="yay -S --noconfirm" | |
| 3 | + | alias backupvps="rsync -avhzr --delete --progress --rsh='ssh -p22' user@ip:/ --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/swapfile","/boot/*"} /to/dir/" | |
| 3 | 4 | ||
| 4 | 5 | ||
| 5 | 6 | # Compress a video with CUDA acceleration (GPU from NVIDIA is required) | |
airikr revised this gist 1 year ago. Go to revision
1 file changed, 2 insertions, 1 deletion
.bash_aliases
| @@ -28,7 +28,8 @@ alias ytdla="ytdla" | |||
| 28 | 28 | ||
| 29 | 29 | # Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram. | |
| 30 | 30 | function reduceimage { | |
| 31 | - | convert -resize 2000x2000 -quality 70 "$1" "$1".r && exiftool -all= "$1".r && exiftool -delete_original "$1".r | |
| 31 | + | convert -resize 2000x2000 -quality 70 "$1".jpg "$1"-r.webp | |
| 32 | + | exiftool -overwrite_original -all= "$1"-r.webp | |
| 32 | 33 | } | |
| 33 | 34 | ||
| 34 | 35 | alias reduceimage="reduceimage" | |
airikr revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
.bash_aliases
| @@ -12,7 +12,7 @@ alias reducevideo="reducevideo" | |||
| 12 | 12 | ||
| 13 | 13 | # Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more. | |
| 14 | 14 | function ytdl { | |
| 15 | - | 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)> | |
| 15 | + | 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" | |
| 16 | 16 | } | |
| 17 | 17 | ||
| 18 | 18 | alias ytdl="ytdl" | |
airikr revised this gist 2 years ago. Go to revision
No changes
airikr revised this gist 2 years ago. Go to revision
1 file changed, 4 insertions
.bash_aliases
| @@ -1,3 +1,7 @@ | |||
| 1 | + | alias install_no="sudo pacman -Sy" | |
| 2 | + | alias install_ya="yay -S --noconfirm" | |
| 3 | + | ||
| 4 | + | ||
| 1 | 5 | # Compress a video with CUDA acceleration (GPU from NVIDIA is required) | |
| 2 | 6 | function reducevideo { | |
| 3 | 7 | ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2" | |
airikr revised this gist 2 years ago. Go to revision
1 file changed, 16 insertions
.bash_aliases
| @@ -6,6 +6,22 @@ function reducevideo { | |||
| 6 | 6 | alias reducevideo="reducevideo" | |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | + | # Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more. | |
| 10 | + | function ytdl { | |
| 11 | + | 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)> | |
| 12 | + | } | |
| 13 | + | ||
| 14 | + | alias ytdl="ytdl" | |
| 15 | + | ||
| 16 | + | ||
| 17 | + | # Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file. | |
| 18 | + | function ytdla { | |
| 19 | + | 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" | |
| 20 | + | } | |
| 21 | + | ||
| 22 | + | alias ytdla="ytdla" | |
| 23 | + | ||
| 24 | + | ||
| 9 | 25 | # Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram. | |
| 10 | 26 | function reduceimage { | |
| 11 | 27 | convert -resize 2000x2000 -quality 70 "$1" "$1".r && exiftool -all= "$1".r && exiftool -delete_original "$1".r | |
airikr revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
.bash_aliases
| @@ -6,7 +6,7 @@ function reducevideo { | |||
| 6 | 6 | alias reducevideo="reducevideo" | |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | - | # Compress an image by reducing size and quality and remove all metadata. Inspiration from Telegram. | |
| 9 | + | # Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram. | |
| 10 | 10 | function reduceimage { | |
| 11 | 11 | convert -resize 2000x2000 -quality 70 "$1" "$1".r && exiftool -all= "$1".r && exiftool -delete_original "$1".r | |
| 12 | 12 | } | |
airikr revised this gist 2 years ago. Go to revision
1 file changed, 9 insertions
.bash_aliases
| @@ -1,3 +1,12 @@ | |||
| 1 | + | # Compress a video with CUDA acceleration (GPU from NVIDIA is required) | |
| 2 | + | function reducevideo { | |
| 3 | + | ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2" | |
| 4 | + | } | |
| 5 | + | ||
| 6 | + | alias reducevideo="reducevideo" | |
| 7 | + | ||
| 8 | + | ||
| 9 | + | # Compress an image by reducing size and quality and remove all metadata. Inspiration from Telegram. | |
| 1 | 10 | function reduceimage { | |
| 2 | 11 | convert -resize 2000x2000 -quality 70 "$1" "$1".r && exiftool -all= "$1".r && exiftool -delete_original "$1".r | |
| 3 | 12 | } | |
airikr revised this gist 2 years ago. Go to revision
1 file changed, 5 insertions
.bash_aliases(file created)
| @@ -0,0 +1,5 @@ | |||
| 1 | + | function reduceimage { | |
| 2 | + | convert -resize 2000x2000 -quality 70 "$1" "$1".r && exiftool -all= "$1".r && exiftool -delete_original "$1".r | |
| 3 | + | } | |
| 4 | + | ||
| 5 | + | alias reduceimage="reduceimage" | |