Loop for youtube-dl to download one of either formats (depending on errors)
up vote
1
down vote
favorite
Trying to download 100+ videos, most of which are available in "-f 43 format" I do sometimes get an error "ERROR: requested format not available".
So I'd like to have a loop that in those cases tries the same download, but in "-f 18" format (which is similar enough).
I think this should be possible, probably in bash, but I have no clear idea how. Any help is greatly appreciated!
bash loops error-handling youtube-dl
add a comment |
up vote
1
down vote
favorite
Trying to download 100+ videos, most of which are available in "-f 43 format" I do sometimes get an error "ERROR: requested format not available".
So I'd like to have a loop that in those cases tries the same download, but in "-f 18" format (which is similar enough).
I think this should be possible, probably in bash, but I have no clear idea how. Any help is greatly appreciated!
bash loops error-handling youtube-dl
1
Welcome to SO. Stack Overflow is a question and answer site for professional and enthusiast programmers. The goal is that you add some code of your own to your question to show at least the research effort you made to solve this yourself. Please take a look at How to create a Minimal, Complete, and Verifiable example.
– Cyrus
Nov 10 at 18:13
Thanks, I understand my question is 'bland' (or perhaps even appears lazy) but I haven't tried much more since 1) I didn't know where to start, and 2) I hoped there was some other solution (like the one below). I do genuinely appreciate your tip though, I will keep it in mind in the future.
– marc111011
Nov 10 at 21:13
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Trying to download 100+ videos, most of which are available in "-f 43 format" I do sometimes get an error "ERROR: requested format not available".
So I'd like to have a loop that in those cases tries the same download, but in "-f 18" format (which is similar enough).
I think this should be possible, probably in bash, but I have no clear idea how. Any help is greatly appreciated!
bash loops error-handling youtube-dl
Trying to download 100+ videos, most of which are available in "-f 43 format" I do sometimes get an error "ERROR: requested format not available".
So I'd like to have a loop that in those cases tries the same download, but in "-f 18" format (which is similar enough).
I think this should be possible, probably in bash, but I have no clear idea how. Any help is greatly appreciated!
bash loops error-handling youtube-dl
bash loops error-handling youtube-dl
asked Nov 10 at 18:04
marc111011
5116
5116
1
Welcome to SO. Stack Overflow is a question and answer site for professional and enthusiast programmers. The goal is that you add some code of your own to your question to show at least the research effort you made to solve this yourself. Please take a look at How to create a Minimal, Complete, and Verifiable example.
– Cyrus
Nov 10 at 18:13
Thanks, I understand my question is 'bland' (or perhaps even appears lazy) but I haven't tried much more since 1) I didn't know where to start, and 2) I hoped there was some other solution (like the one below). I do genuinely appreciate your tip though, I will keep it in mind in the future.
– marc111011
Nov 10 at 21:13
add a comment |
1
Welcome to SO. Stack Overflow is a question and answer site for professional and enthusiast programmers. The goal is that you add some code of your own to your question to show at least the research effort you made to solve this yourself. Please take a look at How to create a Minimal, Complete, and Verifiable example.
– Cyrus
Nov 10 at 18:13
Thanks, I understand my question is 'bland' (or perhaps even appears lazy) but I haven't tried much more since 1) I didn't know where to start, and 2) I hoped there was some other solution (like the one below). I do genuinely appreciate your tip though, I will keep it in mind in the future.
– marc111011
Nov 10 at 21:13
1
1
Welcome to SO. Stack Overflow is a question and answer site for professional and enthusiast programmers. The goal is that you add some code of your own to your question to show at least the research effort you made to solve this yourself. Please take a look at How to create a Minimal, Complete, and Verifiable example.
– Cyrus
Nov 10 at 18:13
Welcome to SO. Stack Overflow is a question and answer site for professional and enthusiast programmers. The goal is that you add some code of your own to your question to show at least the research effort you made to solve this yourself. Please take a look at How to create a Minimal, Complete, and Verifiable example.
– Cyrus
Nov 10 at 18:13
Thanks, I understand my question is 'bland' (or perhaps even appears lazy) but I haven't tried much more since 1) I didn't know where to start, and 2) I hoped there was some other solution (like the one below). I do genuinely appreciate your tip though, I will keep it in mind in the future.
– marc111011
Nov 10 at 21:13
Thanks, I understand my question is 'bland' (or perhaps even appears lazy) but I haven't tried much more since 1) I didn't know where to start, and 2) I hoped there was some other solution (like the one below). I do genuinely appreciate your tip though, I will keep it in mind in the future.
– marc111011
Nov 10 at 21:13
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
There is no need for external coding; youtube-dl includes this functionality natively. Simply add slashes in your -f
parameter. For instance, if you want format 43, failing that 18, and failing that simply the best available single file, call youtube-dl like this:
youtube-dl -f 43/18/best https://www.youtube.com/watch?v=BaW_jenozKc
For more information, refer to the official documentation on format selection.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
There is no need for external coding; youtube-dl includes this functionality natively. Simply add slashes in your -f
parameter. For instance, if you want format 43, failing that 18, and failing that simply the best available single file, call youtube-dl like this:
youtube-dl -f 43/18/best https://www.youtube.com/watch?v=BaW_jenozKc
For more information, refer to the official documentation on format selection.
add a comment |
up vote
1
down vote
accepted
There is no need for external coding; youtube-dl includes this functionality natively. Simply add slashes in your -f
parameter. For instance, if you want format 43, failing that 18, and failing that simply the best available single file, call youtube-dl like this:
youtube-dl -f 43/18/best https://www.youtube.com/watch?v=BaW_jenozKc
For more information, refer to the official documentation on format selection.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
There is no need for external coding; youtube-dl includes this functionality natively. Simply add slashes in your -f
parameter. For instance, if you want format 43, failing that 18, and failing that simply the best available single file, call youtube-dl like this:
youtube-dl -f 43/18/best https://www.youtube.com/watch?v=BaW_jenozKc
For more information, refer to the official documentation on format selection.
There is no need for external coding; youtube-dl includes this functionality natively. Simply add slashes in your -f
parameter. For instance, if you want format 43, failing that 18, and failing that simply the best available single file, call youtube-dl like this:
youtube-dl -f 43/18/best https://www.youtube.com/watch?v=BaW_jenozKc
For more information, refer to the official documentation on format selection.
answered Nov 10 at 19:58
phihag
191k47359401
191k47359401
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241908%2floop-for-youtube-dl-to-download-one-of-either-formats-depending-on-errors%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Welcome to SO. Stack Overflow is a question and answer site for professional and enthusiast programmers. The goal is that you add some code of your own to your question to show at least the research effort you made to solve this yourself. Please take a look at How to create a Minimal, Complete, and Verifiable example.
– Cyrus
Nov 10 at 18:13
Thanks, I understand my question is 'bland' (or perhaps even appears lazy) but I haven't tried much more since 1) I didn't know where to start, and 2) I hoped there was some other solution (like the one below). I do genuinely appreciate your tip though, I will keep it in mind in the future.
– marc111011
Nov 10 at 21:13