summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkiz <skiznet@aol.com>2024-11-16 16:33:29 -0500
committerSkiz <skiznet@aol.com>2024-11-16 16:33:29 -0500
commitb0c98a8ff5fc292fb68486acf6441257fa1f39e4 (patch)
tree7734328d7ecdccc3c9151c8129eb384f88546e71
parentf102b97d8bcb5334c1d9891588259f242153c8b7 (diff)
Created history function
-rwxr-xr-xmediachad16
1 files changed, 12 insertions, 4 deletions
diff --git a/mediachad b/mediachad
index a17d6e4..fdba6ef 100755
--- a/mediachad
+++ b/mediachad
@@ -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