Repository navigation
Conversation
yt-dlp can fail to download a playlist page and then crash inside an extractor (for example the peertube extractor calls .get() on a bool) instead of raising DownloadError. Only DownloadError was caught in Fetcher.get_unprocessed_entries, so the AttributeError aborted `ytcc update` for every playlist. Catch any exception from the playlist fetch, log it the same way as a DownloadError, and continue with the remaining playlists. Adds a regression test that mocks YoutubeDL.extract_info to raise an AttributeError.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #143
Problem
When yt-dlp fails to download a playlist page, some extractors crash with a non-
DownloadErrorexception instead of reporting a clean error. The peertube extractor, for example, calls.get()on a bool response and raisesAttributeError.Fetcher.get_unprocessed_entriesonly caughtyoutube_dl.DownloadError, so the exception escaped and abortedytcc update.Change
ytcc/updater.py: catch any exception raised while fetching a playlist, log it with the same message used forDownloadError, and continue with the other playlists.tests/test_updater.py: regression test that replacesYoutubeDLwith a stand-in whoseextract_inforaisesAttributeError, and asserts that no entries are returned instead of an exception.Validation
master(AttributeErrorpropagates) and passes with this change.hatch test/ pytest on this branch: 32 passed, 2 failed. The 2 failures (test_cli.py::test_download,test_cli.py::test_play_video) also fail onmasterin my Windows environment, and I did not touch them. They look like they need mpv/ffmpeg.ruff checkon the changed files reports only ICN001 (datetimeimport alias) on the existing line inupdater.py, which is also reported onmaster.