LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2021, 07:09 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308

Quote:
Originally Posted by andrewysk View Post
Tried on mpv, it didnt' list out anything near to youtube... It only list out library files.
yes, see man ldd.
If you wish to see everything opened during execution you need to use strace (or similar).
Code:
strace -f -o /tmp/strace.out mpv <url>
and check the strace file (look for open, not only execve)
 
1 members found this post helpful.
Old 12-16-2021, 07:56 AM   #17
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
yes, see man ldd.
If you wish to see everything opened during execution you need to use strace (or similar).
Code:
strace -f -o /tmp/strace.out mpv <url>
and check the strace file (look for open, not only execve)
Ya, thx, i found it.. it was calling for youtube-dl.. hence i symlinked yt-dlp to youtube-dl.. it works well.

Code:
86331 openat(AT_FDCWD, "/usr/bin/youtube-dl", O_RDONLY|O_CLOEXEC) = 3

86331 openat(AT_FDCWD, "/usr/bin/youtube-dl", O_RDONLY) = 3
Thx.
 
Old 12-18-2021, 02:11 AM   #18
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by andrewysk View Post
Is it possible to copy your mpv.conf into the specified address ?
You really have to start reading man pages.
 
Old 12-18-2021, 02:13 AM   #19
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by andrewysk View Post
hence i symlinked yt-dlp to youtube-dl..
I mean, suit yourself, but I still think the config route is more elegant.
Quote:
Originally Posted by andrewysk View Post
Is it possible to copy your mpv.conf into the specified address ?
You really have to start reading man pages.
 
Old 12-18-2021, 02:58 AM   #20
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
I mean, suit yourself, but I still think the config route is more elegant.

You really have to start reading man pages.
Since you said it twice, i believe there bound to have some useful info in the man.. hence i read...

first thing first:
How do you read such a long page of man ? it is without ending.. i don't know which page and how many more..
Hence i used
Code:
 man mpv | less
, but it alters some content of it and format of it.
Look at the weird CODES... eg: \xe2\x80\x90 .. that messed up the format of the man page.
How do you read such a long man page ?

Thx

Code:
CONFIGURATION FILES
   Location and Syntax
       You  can  put  all  of the options in configuration files which will be read every time mpv is
       run. The system-wide configuration file 'mpv.conf' is in your  configuration  directory  (e.g.
       /etc/mpv  or /usr/local/etc/mpv), the user-specific one is ~/.config/mpv/mpv.conf. For details
       and platform specifics (in particular Windows paths) see the FILES section.

       User-specific options override system-wide options and options given on the command line over\xe2\x80\x90
       ride  either.  The  syntax of the configuration files is option=value. Everything after a # is
       considered a comment. Options that work without values can be enabled by setting them  to  yes
       and disabled by setting them to no. Even suboptions can be specified in this way.

          Example configuration file

              # Use GPU-accelerated video output by default.
              vo=gpu
              # Use quotes for text that can contain spaces:
              term-status-msg="Time: ${time-pos}"

   Escaping spaces and special characters
       This is done like with command line options. The shell is not involved here, but option values
       still need to be quoted as a whole if it contains certain characters like spaces. A config en\xe2\x80\x90
       try can be quoted with ", as well as with the fixed-length syntax (%n%) mentioned before. This
       is like passing the exact contents of the quoted string as command line  option.  C-style  es\xe2\x80\x90
       capes  are  currently _not_ interpreted on this level, although some options do this manually.
       (This is a mess and should probably be changed at some point.)

   Putting Command Line Options into the Configuration File
       Almost all command line options can be put into the configuration file. Here is a small guide:

                               \xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90
                               \xe2\x94\x82Option            \xe2\x94\x82 Configuration file entry \xe2\x94\x82
                               \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\:
 
Old 12-18-2021, 04:06 AM   #21
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you can use an online man page like this: https://manpages.ubuntu.com/manpages...an1/mpv.1.html but man mpv should work without piping it. Man also has a man page (which is available online too) and you can set up a PAGER for it - if you wish.
 
Old 12-18-2021, 08:40 AM   #22
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
I mean, suit yourself, but I still think the config route is more elegant.

You really have to start reading man pages.
Hii Ondoho,

I found the treasure cave!! according to your guidance. I know for sure this is the hint that you were hinting me! :=) Bingo right ?

Code:
ytdl_path=youtube-dl
Configure  path to youtube-dl executable or a compatible fork's.  The default "youtube-dl" looks for the executable in PATH. In a Windows environment the suffix extension ".exe" is always appended.
I should have my "yt-dlp" configured in PATH environment variable. But /usr/bin is already in path, so anything in /usr/bin is fine, i don't have to mess with PATH.

I just need to change from
ytdl_path=youtube-dl
to
ytdl_path=yt-dlp

So far so good ?

There is only 1 problem that i don't understand.
Since i don't have mpv.conf file, should i create myself a mpv.conf in ~/.config/mpv/mpv.conf ?

And since i have got nothing else need to add to mpv config, i need have 1 single line written in mpv.conf:
Code:
ytdl_path=yt-dlp
Does that alone do the trick ?
Thx
 
Old 12-18-2021, 09:27 AM   #23
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Almost there.
Scroll up in that man page, it says, under '--ytdl':
Quote:
This accepts a set of options, which can be passed to it with the --script-opts option (using ytdl_hook- as prefix)
Example:
Code:
--script-opts=ytdl_hook-ytdl_path=yt-dlp
And yes, that's convoluted.

Also explained in the man page:
Every command line option can become a config file option by removing the 2 dashes '--' at the beginning.
 
1 members found this post helpful.
Old 12-18-2021, 12:12 PM   #24
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by andrewysk View Post
Since you said it twice, i believe there bound to have some useful info in the man.. hence i read...

first thing first:
How do you read such a long page of man ? it is without ending.. i don't know which page and how many more..
Hence i used
Code:
 man mpv | less
, but it alters some content of it and format of it.
Look at the weird CODES... eg: \xe2\x80\x90 .. that messed up the format of the man page.
How do you read such a long man page ?

Thx

Code:
CONFIGURATION FILES
   Location and Syntax
       You  can  put  all  of the options in configuration files which will be read every time mpv is
       run. The system-wide configuration file 'mpv.conf' is in your  configuration  directory  (e.g.
       /etc/mpv  or /usr/local/etc/mpv), the user-specific one is ~/.config/mpv/mpv.conf. For details
       and platform specifics (in particular Windows paths) see the FILES section.

       User-specific options override system-wide options and options given on the command line over\xe2\x80\x90
       ride  either.  The  syntax of the configuration files is option=value. Everything after a # is
       considered a comment. Options that work without values can be enabled by setting them  to  yes
       and disabled by setting them to no. Even suboptions can be specified in this way.

          Example configuration file

              # Use GPU-accelerated video output by default.
              vo=gpu
              # Use quotes for text that can contain spaces:
              term-status-msg="Time: ${time-pos}"

   Escaping spaces and special characters
       This is done like with command line options. The shell is not involved here, but option values
       still need to be quoted as a whole if it contains certain characters like spaces. A config en\xe2\x80\x90
       try can be quoted with ", as well as with the fixed-length syntax (%n%) mentioned before. This
       is like passing the exact contents of the quoted string as command line  option.  C-style  es\xe2\x80\x90
       capes  are  currently _not_ interpreted on this level, although some options do this manually.
       (This is a mess and should probably be changed at some point.)

   Putting Command Line Options into the Configuration File
       Almost all command line options can be put into the configuration file. Here is a small guide:

                               \xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90
                               \xe2\x94\x82Option            \xe2\x94\x82 Configuration file entry \xe2\x94\x82
                               \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\:
The strange appearance is because 'man' already uses a pager for output and passing it through less just complicates things since less is trying to make sense of the formatting code from the pager man uses and displays the hex codes as text instead.

Have you ever use man and NOT been able to page up and down through the document as you wished?

Man pages are meant to provide the info to understand what the app does and how to use it. Some man pages are long, others are short, and it depends on the complexity of the app and its capabilities. You have to read the details to find what you are interested in, and see what it can do for you.

This is the portion you posted with using 'man mpv' on my system.
Code:
CONFIGURATION FILES
   Location and Syntax
       You  can put all of the options in configuration files which will be read every time mpv is run. The system-wide configu‐
       ration file 'mpv.conf' is in your configuration directory (e.g. /etc/mpv or /usr/local/etc/mpv), the user-specific one is
       ~/.config/mpv/mpv.conf. For details and platform specifics (in particular Windows paths) see the FILES section.

       User-specific  options  override system-wide options and options given on the command line override either. The syntax of
       the configuration files is option=value. Everything after a # is considered a comment. Options that work  without  values
       can be enabled by setting them to yes and disabled by setting them to no. Even suboptions can be specified in this way.

          Example configuration file

Last edited by computersavvy; 12-18-2021 at 12:19 PM.
 
Old 12-18-2021, 02:11 PM   #25
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
Have you ever use man and NOT been able to page up and down through the document as you wished?
Everything was fine with man .. just when the man page is too long, i got uncomfortable with it.
Hence i piped it to "less" thinking i can scroll in page by page manner, which somehow i am more comfortable with.
But since man page is already passed to a pager and i pipe it to another pager (less) is not working.. so be it..
I rather not pursue down the gully..
I understand today that man page has pager built in, hence no need to pipe to less in the future.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Riding the Rails with WebSphere Part 1 LXer Syndicated Linux News 0 02-01-2008 06:40 AM
LXer: Jboss World Berlin: riding with Red Hat LXer Syndicated Linux News 0 11-23-2006 06:21 AM
Enjoying riding the learning curve steelcap LinuxQuestions.org Member Intro 2 01-17-2006 05:24 PM
over riding system calls djgerbavore Programming 11 08-20-2004 12:03 AM
over riding udma -not a specific linux question salparadise Linux - Hardware 3 08-19-2003 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration