MX 19.4 xfce 64bit - yt-dlp - how to remove string in brackets, please?
antiX / MX LinuxThis forum is for the discussion of antiX and MX Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
MX 19.4 xfce 64bit - yt-dlp - how to remove string in brackets, please?
Using youtube-dl with no options afterwards, I used to get the file with the file name, followed by its extension.
But now, with the successor of youtube-dl, called yt-dlp, using it alike, I'm getting a file with the file name, followed by some brackets like this [] and a string inside, according to the final section of the url of the wanted clip and then, there's the file extension.
How can I remove the brackets and the string inside, in order to have only the file name and its extension, like it used to be with youtube-dl, please?
As far as I understand that guide, I have to add the string that I want to remove, manually, to each and every single download command.
But that's not what I had in mind, sorry, because since that string is different for each download, that's very uncomfortable.
What I'm asking for is how to remove these brackets with the string inside, automatically?
The differences between yt-dlp and youtube-dl are described in the yt-dlp readme, along with mention of the option "--compat-options youtube-dl" to revert those changes.
The only section that I found, referring to the output template, is this
Quote:
The default output template is %(title)s [%(id)s].%(ext)s. There is no real reason for this change. This was changed before yt-dlp was ever made public and now there are no plans to change it back to %(title)s-%(id)s.%(ext)s. Instead, you may use --compat-options filename
but there's no information about how to revert something.
The only section that I found, referring to reverting something is this
Quote:
The default format selector is bv*+ba/b. This means that if a combined video + audio format that is better than the best video-only format is found, the former will be prefered. Use -f bv+ba/b or --compat-options format-spec to revert this
but it doesn't refer to the output template.
So I don't understand what you mean or what I have to do to get the old output template.
Could you please just tell me what exactly I have to do, instead of pointing me to some readme that I don't understand anyway?
I did read it several times, but still, I've got no clue about what to do, to get this fixed.
FWIW I am still using youtube-dl. Is there a feature of yt-dlp that you must use?
eg for mp3 I run...but I am sure there are smarter ways
Code:
youtube-dl https://youtu.be/N_KB0Ow4fVo -x --audio-format mp3
[youtube] N_KB0Ow4fVo: Downloading webpage
[download] Destination: Dave Cousins Blue Angel The Strawbs-N_KB0Ow4fVo.webm
[download] 100% of 9.57MiB in 02:01
[ffmpeg] Destination: Dave Cousins Blue Angel The Strawbs-N_KB0Ow4fVo.mp3
Deleting original file Dave Cousins Blue Angel The Strawbs-N_KB0Ow4fVo.webm (pass -k to keep)
The only section that I found, referring to the output template, is this
Quote:
The default output template is %(title)s [%(id)s].%(ext)s. There is no real reason for this change. This was changed before yt-dlp was ever made public and now there are no plans to change it back to %(title)s-%(id)s.%(ext)s. Instead, you may use --compat-options filename
but there's no information about how to revert something.
Read the highlighted text.
Quote:
The only section that I found, referring to reverting something...
Aside from the first two, every bullet point in the "Differences in default behavior" section is referring to reverting/undoing/resetting an change in defaults that yt-dlp developers made.
Quote:
Could you please just tell me what exactly I have to do, instead of pointing me to some readme that I don't understand anyway?
In addition to linking to the documentation I provided the exact option you just need to make all non-bug yt-dlp behaviour the same as youtube-dl.
:|
If you don't want to type it every time, put it in a config file - that section includes an example of using a config file for changing the output filename.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.