aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/dlvideo
blob: 36ce5e8129d42b5b155a8fe75e005cf032e45a36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

if [[ -n "$1" ]]; then
  yt-dlp "$1" -i -o "%(title)s.%(ext)s" --cookies "~/.config/cookies.txt" &&
  exit 0 ||
  ffmpeg -i "$1" -c:v libx264 -preset slow -crf 22 "$(date +%s).mp4" &&
  exit 0 ||
  exit 1
else
  printf "[ Error ] Not enough arguments.\n"
  exit 1
fi