Targeted download of MAME Roms...

Downloading all of MAME ROMs, is not useful, as many of them don't worth, as games or the emulation is not good. Also, each of...
Below is a script, for use in Termux, to launch MPV via the terminal/termux and watch videos. For the script to work properly, you have to install MPV-Android, preferably from not Google Play, use FDroid instead. Install it and make sure to allow it to use the sdcard for accessing files.
Also, keep in mind, that mpv-android and thus the script, will only play files, accessible from the system. This means, that you cannot playback files, that are saved inside the Termux file system /data/data/com.termux/files
. If you use the pwd
command from inside termux, even if you are in a system wide folder, you will see that it uses a path like /data/data/com.termux/files/home/storage/shared/Movies/...
which mpv-android doesn't accept, cause it needs a URI path like file:///sdcard/Movies/...
. So the script checks that and replaces the correct file path. It can also accept a path like ./
or you could just point to the file and the script will also add the correct path.
For streaming videos from the net, the script, doesn't uses mpv at all and it uses the termux-open
command to use the default system viewer. So, if you point to a Youtube video, it will open the Youtube app. in your smartphone.
#!/data/data/com.termux/files/usr/bin/sh
fn="$1"
case $fn in
./*) fn=$(echo $fn | cut -c3-);
fn=$(pwd)/$fn;
fn=$(echo "$fn" | sed 's/\/data\/data\/com.termux\/files\/home\/storage\/shared\///g');
am start -n is.xyz.mpv/.MPVActivity -a android.intent.action.VIEW -d file:///sdcard/"$fn";;
http*) termux-open "$fn";;
*) fn=$(pwd)/$fn;
fn=$(echo "$fn" | sed 's/\/data\/data\/com.termux\/files\/home\/storage\/shared\///g');
am start -n is.xyz.mpv/.MPVActivity -a android.intent.action.VIEW -d file:///sdcard/"$fn";;
esac