fix if statement, rename channel test file

This commit is contained in:
jbannon 2022-08-01 19:29:50 +00:00
parent 743a76d508
commit db0d9b143e
3 changed files with 9 additions and 2 deletions

View file

@ -1,5 +1,6 @@
import abc import abc
import contextlib import contextlib
import copy
import json import json
import os import os
import time import time
@ -185,6 +186,7 @@ class Downloader(DownloadArchiver, Generic[DownloaderOptionsT, DownloaderEntryT]
""" """
num_tries = 0 num_tries = 0
entry_files_exist = False entry_files_exist = False
ytdl_options_overrides = copy.deepcopy(ytdl_options_overrides)
while not entry_files_exist and num_tries < self._extract_entry_num_retries: while not entry_files_exist and num_tries < self._extract_entry_num_retries:
entry_dict = self.extract_info(ytdl_options_overrides=ytdl_options_overrides, **kwargs) entry_dict = self.extract_info(ytdl_options_overrides=ytdl_options_overrides, **kwargs)
@ -193,6 +195,11 @@ class Downloader(DownloadArchiver, Generic[DownloaderOptionsT, DownloaderEntryT]
time.sleep(self._extract_entry_retry_wait_sec) time.sleep(self._extract_entry_retry_wait_sec)
num_tries += 1 num_tries += 1
# Remove the download archive so it can retry without thinking its already downloaded,
# even though it is not
ytdl_options_overrides["download_archive"] = None
if num_tries < self._extract_entry_retry_wait_sec: if num_tries < self._extract_entry_retry_wait_sec:
download_logger.debug( download_logger.debug(
"Failed to download entry. Retrying %d / %d", "Failed to download entry. Retrying %d / %d",

View file

@ -65,8 +65,8 @@ class Entry(EntryVariables, BaseEntry):
------- -------
True if the file and thumbnail exist locally. False otherwise. True if the file and thumbnail exist locally. False otherwise.
""" """
thumbnail_exists = os.path.isfile( thumbnail_exists = (
self.get_download_thumbnail_path() os.path.isfile(self.get_download_thumbnail_path())
or self.get_ytdlp_download_thumbnail_path() is not None or self.get_ytdlp_download_thumbnail_path() is not None
) )
file_exists = os.path.isfile(self.get_download_file_path()) file_exists = os.path.isfile(self.get_download_file_path())