Try to refresh formats after download failed

This commit is contained in:
tcely 2025-02-19 17:48:18 -05:00 committed by GitHub
parent ad8fa72123
commit b01af70098
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -553,6 +553,8 @@ def download_media(media_id):
err = (f'Failed to download media: {media} (UUID: {media.pk}) to disk, '
f'expected outfile does not exist: {filepath}')
log.error(err)
# Try refreshing formats
media.refresh_formats
# Raising an error here triggers the task to be re-attempted (or fail)
raise DownloadFailedException(err)