#!/bin/bash
Prompt the user for input #
echo "Enter the file path, URL, or media source to play with mpv:" read -r input
Check if the input is empty #
if [[ -z "$input" ]]; then echo "No input provided. Exiting." exit 1 fi
Pass the input to mpv #
mpv --ytdl-raw-options=cookies="/Users/celticlich/Downloads/cookies.txt" "$input" --really-quiet &
Optional: Handle any error from mpv gracefully #
if [[ $? -ne 0 ]]; then echo "An error occurred while trying to play the media with mpv." exit 1 fi
exit 0
last updated: