Refresh formats only after metadata was saved

This commit is contained in:
tcely 2025-03-15 20:31:09 -04:00 committed by GitHub
parent bc6f209d8d
commit ec96a86c07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -565,7 +565,8 @@ def download_media(media_id):
f'expected outfile does not exist: {filepath}') f'expected outfile does not exist: {filepath}')
log.error(err) log.error(err)
# Try refreshing formats # Try refreshing formats
media.refresh_formats if media.has_metadata:
media.refresh_formats
# Raising an error here triggers the task to be re-attempted (or fail) # Raising an error here triggers the task to be re-attempted (or fail)
raise DownloadFailedException(err) raise DownloadFailedException(err)