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
Update ytdl_hook.lua: Fix yt-dlp's Incomplete data received error which is rather non-critical to catch #12511
Conversation
Because `Incomplete data received` isn't critical, should only check if json is blank.
Can confirm this PR solves the very same issue I was experiencing recently; tested on commit f9234d8. |
yt-dlp also returns non zero status codes for other non critical errors, but some of those cases can result in not all playlist entries getting listed, and the way it is now there is no feedback that there even is something that wasn't fully successful. Have you looked at the specific status code? Maybe we can react differently to different status codes. Edit: Apparently the current exit codes are this and here is a related issue yt-dlp/yt-dlp#2947. There doesn't seem to have been any progress 😞 Edit2: It's a already known issue on yt-dlp's side yt-dlp/yt-dlp#8206 |
This solved the problem with YouTube playlists. |
I debugged it quite a bit Full result logging if you want it:
|
No surprise there, considering the exit codes I linked. I still don't like that the error gets completely ignored now. We should at least print a warning with stderr and status when |
How about parsing the JSON first, I'll create a new commit and let's see if it's okay. Actually I followed your idea and just print a warning instead. |
Add warning about error code != 0 and JSON is parsed without errors.
Hmm...
|
> at least print a warning with stderr and status
It's done. |
Read this before you submit this pull request: |
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.
https://github.com/mpv-player/mpv/blob/master/DOCS/contribute.md#write-good-commit-messages
https://github.com/mpv-player/mpv/blob/master/DOCS/contribute.md#always-squash-fixup-commits-when-making-changes-to-pull-requests
The PR template literally says
Read this before you submit this pull request:
https://github.com/mpv-player/mpv/blob/master/DOCS/contribute.md
Reading this link and following the rules will get your pull request reviewed
and merged faster. Nobody wants lazy pull requests.
Co-authored-by: christoph-heinrich <christoph-heinrich@users.noreply.github.com>
@po5 @christoph-heinrich I see, I've read the guide and thanks! |
Download the artifacts for this pull request: |
Can you please squash your commits? |
fwiw that specific playlist issue has already been fixed by yt-dlp. It may still make sense to allow parse-able jsons to continue, but I'm worried that it will end up leading to crashes because the json didn't contain fields that are assumed to exist by other parts of the ytdl_hook. I don't know if such a scenario can actually happen, and technically there is always the possibility of them changing up their json structure, but it's a concern nonetheless. |
Oh I had assumed it was another one of those "the ytdl_hook is outdated again" things. If there's no actually concrete issue this solves anymore, then I don't think we need this? All the concerns you raised are valid and if there's a use case then, we can revisit it later. |
Because
Incomplete data received
isn't critical, should only check if json is blank.Currently if you open a playlist with MPV, it's throwing this error:
Read this before you submit this pull request:
https://github.com/mpv-player/mpv/blob/master/DOCS/contribute.md
Reading this link and following the rules will get your pull request reviewed
and merged faster. Nobody wants lazy pull requests.