TheBajaBust Posted February 7, 2023 Posted February 7, 2023 Hey guys, I am pretty new to this. I am working on turning my Le Potato into a TV shuffler. I have decided to go with Armbian, since I can't SSH (which is required for the CoreElec method), because I use college internet, and it just isn't configured properly. I am currently trying to get a script going that will open a folder and begin randomly playing videos from within, but I cannot figure out where to start really. I think I need to import mpv into the script somehow, but I honestly cannot find any resources on how to do this. Any help is appreciated, thanks in advance. 0 Quote
TRS-80 Posted February 8, 2023 Posted February 8, 2023 I guess you could do something as simple as a bash[0] script, really. But something like Kodi would give you a lot more control, I think (among many other niceties). I would also try and figure out how to communicate with the device over the network, if at all possible. Barring that, I guess you could use an IR remote (especially in Kodi). [0] or Python, or whatever language you like 0 Quote
CryBaby Posted February 8, 2023 Posted February 8, 2023 #!/bin/bash TOP=/home/share/video/music if [ -n "$1" ]; then TOP=$1 fi OLDIFS=$IFS IFS=$'\n' find $TOP -name "*.[maowf][povgklm][gvim]" -print | shuf -n 100 > randomplaylist mpv -fs -vf=pp=de --playlist=randomplaylist rm randomplaylist IFS=$OLDIFS This will play 100 randomly selected files from /home/share/video/music and subdirectories or whatever directory you pass on the command line. 1 Quote
TRS-80 Posted February 8, 2023 Posted February 8, 2023 4 hours ago, CryBaby said: "*.[maowf][povgklm][gvim]" Interesting regexp. Where did you find that? Or it's your own handiwork? 0 Quote
CryBaby Posted February 8, 2023 Posted February 8, 2023 I wrote the script years ago but as far as I recall I made the regexp myself. I probably just made a list of all the video file extensions I had and then listed the letters in each position. 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.