MPVF runs MPV with optional MPV profiles on a set of files found with GNU Find by including and excluding pathname patterns and setting the depth levels in the directory tree. This Bash script has its strengths, I think, in that it stores the location of your directories, as well as directories on removable media, and only searches locations that exist on your system at the time the script is run and if no directories were entered on the command line. There is a list of file extensions that the script looks at, if you like, and just passes a file to MPV based on that list.
Repository
In the examples below, ls is executed first and lists the contents of the Dir1 directory recursively. Then, each block of text that follows begins with an MPVF command line followed by the executed FIND command line and its output, i.e. the files played last.
$ ls -1R Dir1/
Dir1/:
1-Sunday.mp4
3-Tuesday.mp4
6-Friday.mp4
Dir2
Dir2-Sunday
Dir1/Dir2:
8-Sunday-Tuesday.mp4
9-Friday-Sunday.mp4
Dir1/Dir2-Sunday:
(mpvf -i sunday Dir1/)
$ find Dir1/ ( -ipath *sunday* ) -type f | sort
Dir1/1-Sunday.mp4
Dir1/Dir2/8-Sunday-Tuesday.mp4
Dir1/Dir2/9-Friday-Sunday.mp4
(mpvf -e sunday Dir1/)
$ find Dir1/ ( ! -ipath *sunday* ) -type f | sort
Dir1/3-Tuesday.mp4
Dir1/6-Friday.mp4
(mpvf -i sunday -e dir2 Dir1/)
$ find Dir1/ ( -ipath *sunday* ! -ipath *dir2* ) -type f | sort
Dir1/1-Sunday.mp4
(mpvf -i sunday -i friday Dir1/)
$ find Dir1/ ( -ipath *sunday* -ipath *friday* ) -type f | sort
Dir1/Dir2/9-Friday-Sunday.mp4
(mpvf -e friday -e sunday Dir1/)
$ find Dir1/ ( ! -ipath *friday* ! -ipath *sunday* ) -type f | sort
Dir1/3-Tuesday.mp4
(mpvf -a tuesday -a dir2 -e friday Dir1/)
$ find Dir1/ ( ! -ipath *friday* ) ( -ipath *tuesday* -o -ipath *dir2* ) -type f | sort
Dir1/3-Tuesday.mp4
Dir1/Dir2/8-Sunday-Tuesday.mp4
(mpvf -i sunday -n 2 Dir1/)
$ find Dir1/ -mindepth 2 ( -ipath *sunday* ) -type f | sort
Dir1/Dir2/8-Sunday-Tuesday.mp4
Dir1/Dir2/9-Friday-Sunday.mp4
(mpvf -i sunday -x 1 Dir1/)
$ find Dir1/ -maxdepth 1 ( -ipath *sunday* ) -type f | sort
Dir1/1-Sunday.mp4
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 1 of 1
Thread
-
Last edited by o770; 14th Oct 2024 at 22:01.
Similar Threads
-
Play clips and loops in MPV with these Bash scripts
By o770 in forum LinuxReplies: 0Last Post: 13th Sep 2024, 22:23 -
Download streaming video from player on webpage using bash
By BosseB in forum Video Streaming DownloadingReplies: 12Last Post: 10th Nov 2023, 05:53 -
How to run three Python files one by another one in a specified path
By D.LUFFY in forum ProgrammingReplies: 6Last Post: 27th May 2023, 08:25 -
mpv how to identify files?
By Selur in forum Newbie / General discussionsReplies: 8Last Post: 14th Mar 2020, 12:32 -
Need to Scale an MPV File So it Muxes with Other Files
By koberulz in forum Newbie / General discussionsReplies: 22Last Post: 29th Nov 2019, 19:45