💾 Archived View for ait.place › dot › bin › mpvbtfs.txt captured on 2023-05-24 at 18:07:59.
⬅️ Previous capture (2022-07-16)
-=-=-=-=-=-=-
#!/usr/bin/env bash tmp=/tmp/btfs mkdir -p $tmp btfs "$1" $tmp || exit 1 echo "Mounted torrent in: $tmp" #Check until a file shows up until [ ! -z "$(ls $tmp)" ]; do sleep 0.5 echo "Checking for files in: $tmp" done # Enclose the file names with quotes #__findfiles | while read -r line; do # if [ -z "$things" ];then # things="\"$line\"" # else # things="$things \"$line\"" # fi #done list=$(find $tmp -type f | grep -e '.mkv' -e '.mp4' | sed "s/^.*$/\"&\"/g") echo "Found files: $list" echo $list | xargs mpv fusermount -u $tmp && echo "Unmounted $tmp"