mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 02:48:38 -04:00
Handling when a video has no channel, but should not be downloaded again.
This commit is contained in:
parent
0c2250ea12
commit
f3b49b3551
1 changed files with 10 additions and 6 deletions
|
|
@ -181,13 +181,17 @@ class VideoDownloader(Downloader, ABC):
|
|||
logger.warning(f'VideoDownloader failed to download: {download.url}', exc_info=e)
|
||||
if _skip_download(e):
|
||||
# The video failed to download, and the error will never be fixed. Skip it forever.
|
||||
source_id = info.get('id')
|
||||
logger.warning(f'Adding video "{source_id}" to skip list for this channel. WROLPi will not '
|
||||
f'attempt to download it again.')
|
||||
try:
|
||||
source_id = info.get('id')
|
||||
logger.warning(f'Adding video "{source_id}" to skip list for this channel. WROLPi will not '
|
||||
f'attempt to download it again.')
|
||||
|
||||
with get_db_session(commit=True) as session:
|
||||
channel = session.query(Channel).filter_by(id=channel.id).one()
|
||||
channel.add_video_to_skip_list(source_id)
|
||||
with get_db_session(commit=True) as session:
|
||||
channel = session.query(Channel).filter_by(id=channel.id).one()
|
||||
channel.add_video_to_skip_list(source_id)
|
||||
except Exception:
|
||||
# Could not skip this video, it may not have a channel.
|
||||
logger.warning(f'Could not skip video {url}')
|
||||
|
||||
# Skipped downloads should not be tried again.
|
||||
raise UnrecoverableDownloadError() from e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue