diff options
author | Skiz <skiznet@aol.com> | 2024-11-16 16:33:29 -0500 |
---|---|---|
committer | Skiz <skiznet@aol.com> | 2024-11-16 16:33:29 -0500 |
commit | b0c98a8ff5fc292fb68486acf6441257fa1f39e4 (patch) | |
tree | 7734328d7ecdccc3c9151c8129eb384f88546e71 | |
parent | f102b97d8bcb5334c1d9891588259f242153c8b7 (diff) |
Created history function
-rwxr-xr-x | mediachad | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -29,11 +29,19 @@ program_check "ytfzf" program_check "mpv" program_check "yt-dlp" -# yt-fzf -#ytfzf --loop --pages=3 --force-youtube "$input" > /dev/null 2>&1 || echo "Error! Run again" - # Get link -ytfzf --pages=3 --force-youtube -L "$input" | grep "youtube.com" | xargs -I {} yt-dlp -o - --quiet "{}" | mpv - --pause > /dev/null 2>&1 +#ytfzf --pages=3 --force-youtube -L "$input" | grep "youtube.com" | xargs -I {} yt-dlp -o - --quiet "{}" | mpv - --pause > /dev/null 2>&1 + +# Code to work with .yt-history +link=$(ytfzf --pages=3 --force-youtube -L "$input" | grep "youtube.com") +# Plays the video: +yt-dlp -o - --quiet "$link" | mpv - --pause > /dev/null 2>&1 || exit 1 + +file=".yt-history" +time=$(date +%T-%m-%d-%y) +title=$(yt-dlp --get-title --quiet "$link") + +echo -e "Search: $input \nDate: $time \nTitle: $title \nLink: $link \n" # USING YT-DLP |