Closed stl3 closed 2 years ago
When exactly are those commands being run,
Like, do you have them in your config or something?
Also variables don't expand in single quotes, so that $2 is a literal $2.
You could try putting
termux_video () {
echo "am start --user 0 -a android.intent.action.VIEW -d \"$1\" -n is.xyz.mpv/.MPVActivity" > $PREFIX/bin/mpv
}
url_handler=termux_video
Ok i see, you might want to consider just doing this, as mpv recieves a random number of args, and the url is i think the 3rd.
You can add one of the following to ~/.config/ytfzf/conf.sh
and it should work better:
termux_player () {
am start --user 0 -a android.intent.action.VIEW -d "$1" -n is.xyz.mpv/.MPVActivity
}
url_handler=termux_player
or
termux_player () {
termux-open "$1"
}
url_handler=termux_player
However when i tried this it said that is.xyz.mpv/.MPVActivity
is an invalid activity, i can't help much more than this.
With the 2nd one I can choose newpipe like the way I'm currently doing it, but the other am start line doesn't work. For now I think the only way is to use Newpipe to watch instead of mpv/vlc/mxplayer. I feel sad because I had just gotten it working perfectly on mpv before this happened lol.
how the hell did you get it to work it's not even supported
Also it seems your intent command is a bit off.
I spent a bit trying to get this to work because this is actually very cool lol.
I had tried one of the apk's sfan5 built, it was either from https://github.com/mpv-android/mpv-android/issues/479 or the mpv-android-2021-10-28.apk, I can't remember the link for this one.
Ah, i see. You could try using an older version of ytfzf maybe v2.1 if it worked before, but i don't think it'll fix anything since the logic in the script is almost identical.
Yeah I don't think much can be done atm, if I find anything else I'll let you know but we can probably close this.
Just an addendum for other users in case they want to get mpv working with ytfzf in Termux:
From https://github.com/mpv-android/mpv-android/pull/58 download this file https://kitsunemimi.pw/tmp/mpv-android-2021-10-29.apk (uninstall the current mpv-android you have installed, and then install this).
Open mpv, goto three dots top right->Settings->Advanced-->Install/Update youtube-dl and select Install and choose yt-dlp
Once that is done:
Add the following to ~/.config/ytfzf/conf.sh
:
termux_player () {
am start --user 0 -a android.intent.action.VIEW -d "$1" -n is.xyz.mpv/.MPVActivity
}
url_handler=termux_player
This will get mpv to work with ytfzf now :). However if you still want a different app like Newpipe to work with ytfzf, then add the following to ~/.config/ytfzf/conf.sh
instead, which should let you choose an app to open with (I assume, if you don't have default ones set):
termux_player () {
termux-open "$1"
}
url_handler=termux_player
Euro20179, I have to apologize - in my haste to fix an issue with ani-cli I had inadvertantly replaced my mpv version with another one that did not have youtube/yt-dlp stuff built in, but the good news is now other people can see how to get mpv working with it now :)
PS (random), don't do ytfzf -s -l -r "some kind of search"
especially with --pages, it loops and you have to kill Termux manually. Most people probably know this, but I wasn't really thinking when I did it. It was just annoying especially with using termux-open "$1"
because the app chooser kept popping up lol.
Ngl, when you made your issue, I started trying it myself, and kinda wanted to know how to do it, so thanks for the instructions. No need to apologize lol.
PS (random), don't do
ytfzf -s -l -r "some kind of search"
Yes i realized this one day and it could be useful if you need a bunch of youtube links idk.
Just an addendum for other users in case they want to get mpv working with ytfzf in Termux: <
Sorry for highjacking the topic, can you tell me please how did you installed ytfzf in termux because I can't, I get something like this: mkdir -p /usr/local/bin mkdir: cannot create directory ‘/usr’: Read-only file system.
And I want to try your method with mpsyt and/or yewtube, but I can't find the config file of neither one of them. My device is not rooted.
make PREFIX="$PREFIX" install doc
Thank you, it works, I had to run it in Home directory.
~ ytfzf --version ytfzf: git-1351.393d7b3 Termux version: 0.118.0 How to reproduce:
~ ytfzf -r shell scripting
Problem: Trying to play any video, using:echo 'am start --user 0 -a android.intent.action.VIEW -d "$2" -n is.xyz.mpv/.MPVActivity' > $PREFIX/bin/mpv
No longer plays the video. This problem also exists in ani-cli. Both mpv/vlc cannot launch the urls passed by ytfzf. In order for me to be able to watch I had to use:echo 'termux-open "$2"' > $PREFIX/bin/mpv
and I can watch them but through Newpipe app. If anyone has a workaround or explanation of what I have that is incorrect, please let me know how to fix it thanks. It was working prior to this using the above intent.