pystardust / ytfzf

A posix script to find and watch youtube videos from the terminal. (Without API)
GNU General Public License v3.0
3.66k stars 351 forks source link

[BUG]: mpv installed with flatpak is not recognized #716

Open lamyergeier opened 5 months ago

lamyergeier commented 5 months ago

Describe the bug

$ ytfzf 
Search
> ted ed rome
Scraping YouTube (with https://invidious.lunar.icu) (ted ed rome, pg: 1)

[ERROR]: mpv is not installed
$ type mpv
mpv is a function
mpv () 
{ 
    flatpak run "io.mpv.Mpv" "${@}"
}
$ mpv --version
mpv v0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
libplacebo version: v6.338.1
FFmpeg version: n6.1.1
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

To Reproduce

Expected behavior

Screenshots

Information

OS: Fedora 39 Terminal: bash Ytfzf version: 2.6.1 Output of readlink $(which sh): bash

Additional context

Euro20179 commented 5 months ago

user functions dont work in shell scripts (shell scripts can't use user aliases either)

i'd create a file in your $PATH called mpv that just does exactly what your function does, and give it execute permissions.

ehula commented 5 months ago

Something that might be related... I have installed mpv in NixOS using home-manager, and have specified a couple of scripts to be installed as well. Running mpv from the commandline works fine, and the scripts are working as well. However, when mpv is called from ytfzf, it runs ok but the scripts are not running.

eljamm commented 1 month ago

Something that might be related... I have installed mpv in NixOS using home-manager, and have specified a couple of scripts to be installed as well. Running mpv from the commandline works fine, and the scripts are working as well. However, when mpv is called from ytfzf, it runs ok but the scripts are not running.

A possible solution for NixOS