LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   to find out what a programing riding on another program (https://www.linuxquestions.org/questions/linux-newbie-8/to-find-out-what-a-programing-riding-on-another-program-4175704754/)

andrewysk 12-09-2021 06:00 PM

to find out what a programing riding on another program
 
I have searched the web, but find nothing regarding this issue:

let me use clipgrab for example:
Since Clipgrab is using youtube-dl to download video. while newer version of clipgrab is using yt-dlp.
how to know if the clipgrab is using which program ?
I tried to search clipgrab in Htop, but it just does not show youtube-dl nor yt-dlp.

example2:
i would like to know what program mpv riding on when i use mpv to play youtube url.
does the mpv uses youtube-dl or yt-dlp... ? that's what i want to know..

Please tell me how to do it.
Thx

evo2 12-09-2021 07:23 PM

Hi,

you can trace what is being called with strace. Try:
Code:

strace mpv 'https://www.youtube.com/watch?v=aqz-KE-bpKQ'
Evo2.

P.S. I was soooo tempted to Rickroll

dugan 12-09-2021 08:20 PM

I'd just look at the source code.

pan64 12-10-2021 01:20 AM

probably you can try pstree too

ondoho 12-10-2021 06:22 AM

Quote:

Originally Posted by andrewysk (Post 6308185)
i would like to know what program mpv riding on when i use mpv to play youtube url.
does the mpv uses youtube-dl or yt-dlp... ? that's what i want to know..

Code:

man mpv| less +/yt-dlp

andrewysk 12-10-2021 07:03 AM

learn something new
 
Quote:

Originally Posted by ondoho (Post 6308306)
Code:

man mpv| less +/yt-dlp

Thank you! I have learned something new from you.
I never thought of looking into man of mpv to see what the author has to say about which package does the program ride on.

and i was always go into man then execute search with "/"..

now, i know i can do a 1 line method.. using your cli.

Gracias.

andrewysk 12-10-2021 03:39 PM

Quote:

Originally Posted by evo2 (Post 6308198)
Hi,

you can trace what is being called with strace.

I tried Strace output into a log file.. but yielded no desired result. It does not shows any call for youtube-dl.
strace is no good for this purpose.

Code:

$ strace -qe execve mpv 'https://www.youtube.com/watch?v=aqz-KE-bpKQ'
output:
execve("/usr/bin/mpv", ["mpv", "https://www.youtube.com/watch?v="...], 0x7ffc5ca23aa8 /* 67 vars */) = 0


andrewysk 12-10-2021 03:43 PM

Quote:

Originally Posted by pan64 (Post 6308249)
probably you can try pstree too

I tried pstree, but yield no useful info in this case. I see nothing related to youtube-dl.
I just learn by example on this utility.. 1st time user. .maybe i don't know how to use it right.

Code:

$ pstree -pt 88789
mpv(88789)-+-{dav1d-frame}(88818)
          |-{dav1d-frame}(88821)
          |-{dav1d-tile}(88816)
          |-{dav1d-tile}(88817)
          |-{dav1d-tile}(88819)
          |-{dav1d-tile}(88820)
          |-{mpv/ao}(88823)
          |-{mpv/demux}(88815)
          |-{mpv/lua script }(88790)
          |-{mpv/lua script }(88791)
          |-{mpv/lua script }(88792)
          |-{mpv/lua script }(88793)
          |-{mpv/vo}(88799)
          |-{mpv/worker}(88805)
          `-{threaded-ml}(88822)

$ pstree -pts 88789
systemd(1)---systemd(549)---krunner(33349)---mpv(88789)-+-{dav1d-frame}(888+
                                                        |-{dav1d-frame}(888+
                                                        |-{dav1d-tile}(8881+
                                                        |-{dav1d-tile}(8881+
                                                        |-{dav1d-tile}(8881+
                                                        |-{dav1d-tile}(8882+
                                                        |-{mpv/ao}(88823)
                                                        |-{mpv/demux}(88815+
                                                        |-{mpv/lua script }+
                                                        |-{mpv/lua script }+
                                                        |-{mpv/lua script }+
                                                        |-{mpv/lua script }+
                                                        |-{mpv/vo}(88799)
                                                        |-{mpv/worker}(8880+
                                                        `-{threaded-ml}(888+


andrewysk 12-10-2021 03:47 PM

Only manage to find out that mpv uses youtube-dl by default from man page using suggestion of ondoho

But this is not a permanent solution. If the author didn't write in man page.. then i won't know.
Looking into source code is not something i know how to do. so i skipped that suggestion.

andrewysk 12-10-2021 04:04 PM

some youtube video not working with mpv.. weird
 
Quote:

Originally Posted by evo2 (Post 6308198)

Code:

mpv 'https://www.youtube.com/watch?v=aqz-KE-bpKQ'


Hii Evo2, After i tried out to play the youtube video as you attached in the link, my mpv only has audio, no video at all.

I also tried a random video that appears on the list ( https://www.youtube.com/watch?v=5-YjjrwAz8g) , no video, only got audio.

I tried a random video, like this one, mpv show both audio and video just fine (https://www.youtube.com/watch?v=16y1AkoZkmQ)

something is not right.. somehow, some video works while other not.. no idea what's wrong with mpv.

pan64 12-11-2021 02:33 AM

Quote:

Originally Posted by andrewysk (Post 6308445)
I tried pstree, but yield no useful info in this case. I see nothing related to youtube-dl.

pstree shows the actual situation, it will not tell you if youtube-dl (or anything else) will be (or was already) used.

fatmac 12-11-2021 12:15 PM

Also look at ldd - ldd programname or ldd /bin/programname etc.

ondoho 12-12-2021 05:18 AM

Quote:

Originally Posted by andrewysk (Post 6308448)
Only manage to find out that mpv uses youtube-dl by default from man page using suggestion of ondoho

Then I suspect you have an older version of mpv.
Mine says:
Quote:

ytdl_path=youtube-dl

Configure paths to youtube-dl's executable or a compatible fork's. The paths
should be separated by : on Unix and ; on Windows. mpv looks in order for the
configured paths in PATH and in mpv's config directory. The defaults are
"yt-dlp", "yt-dlp_x86" and "youtube-dl".
On Windows the suffix extension
".exe" is always appended.
I suppose it means: in that order.
In any case, this is configurable in ~/.config/mpv/mpv.conf.

andrewysk 12-16-2021 06:33 AM

Quote:

Originally Posted by ondoho (Post 6308829)
Then I suspect you have an older version of mpv.
Mine says:

I suppose it means: in that order.
In any case, this is configurable in ~/.config/mpv/mpv.conf.

There isn't any .conf file in my ~/.config/mpv/

Is it possible to copy your mpv.conf into the specified address ? it could be possible to change which tool it uses to download youtube video in this config file. Hopefully.

so far, i have made the mpv works by made using sym link as suggested by someone on this forum.. i sym linked yt-dlp to youtube-dl (which i have renamed to otherthing).

andrewysk 12-16-2021 06:38 AM

Quote:

Originally Posted by fatmac (Post 6308651)
Also look at ldd - ldd programname or ldd /bin/programname etc.

Tried on mpv, it didnt' list out anything near to youtube... It only list out library files.


All times are GMT -5. The time now is 01:10 PM.