New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor bug fixes #165
Minor bug fixes #165
Conversation
Fix cache option presence checking When dumping json of a playlist, do not throw exception if the playlist has only some "erratic" videos and not all
|
||
if (exitCode > 0) { | ||
if (exitCode > 0 && (!json || (json && out.isEmpty()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this not be solved using --ignore-errors
flag?
If not, maybe we should still throw exception if out is not a valid json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I have to make some tests. About throwing an exception on invalid JSON, you are definitely right. I will try to make this part more robust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made one more test. --ignore-errors
does not prevent ytdlp returning 1 and not 0 when having a single erratic video in a playlist.
We could change the condition as follows
if (exitCode > 0 && (!json || (json && (out.isEmpty() || !request.hasOption("--ignore-errors"))))) {
For json sanity checking we could use the code inside getInfo
. Obviously we should try to parse the output only if the above condition fails and exitCode
is > 0. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition looks good. But maybe make it a little easier to read. Something like this with the remaining condition inside ignoreErrors
function.
exitCode > 0 && !ignoreErrors(request, out)
We don't have to do the json sanity part because you added the --ignore-errors
in the condition. That is good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment, but I'm approving the changes.
Thanks for the contribution!
…dable and ignores exit codes grater than 0 honoring the --ignore-errors input switch
Now it should be OK. |
Looks good. Feel free to merge. |
Hi,
with this PR I am fixing some minor bug I found in the code. They are:
Keep last value of progress and ETA when parsing fails
Fix cache option presence checking
When dumping json of a playlist, do not throw exception if the playlist has only some "erratic" videos and not all
Thanks for your work.