Fixed bug in 2nd asyncio.wait_for

This commit is contained in:
ArabCoders 2024-03-05 20:06:26 +03:00
parent f0a538dad2
commit 31e6ed87e4

View file

@ -218,15 +218,15 @@ class DownloadQueue:
already.add(url) already.add(url)
try: try:
LOG.debug(f'extracting info from {url=}') LOG.debug(f'extracting info from {url=}')
data = asyncio.get_running_loop().run_in_executor( entry = await asyncio.wait_for(
fut=asyncio.get_running_loop().run_in_executor(
None, None,
ExtractInfo, ExtractInfo,
mergeConfig(self.config.ytdl_options, ytdlp_config), mergeConfig(self.config.ytdl_options, ytdlp_config),
url, url,
bool(self.config.ytdl_debug) bool(self.config.ytdl_debug)
) ),
timeout=self.config.extract_info_timeout)
entry = await asyncio.wait_for(data, timeout=self.config.extract_info_timeout)
if not entry: if not entry:
if not self.config.keep_archive: if not self.config.keep_archive:
@ -236,17 +236,19 @@ class DownloadQueue:
} }
LOG.debug(f'No metadata, Rechecking with archive disabled. {url=}') LOG.debug(f'No metadata, Rechecking with archive disabled. {url=}')
data = await asyncio.get_running_loop().run_in_executor(
entry = await asyncio.wait_for(
fut=asyncio.get_running_loop().run_in_executor(
None, None,
ExtractInfo, ExtractInfo,
mergeConfig(self.config.ytdl_options, ytdlp_config), mergeConfig(self.config.ytdl_options, ytdlp_config),
url, url,
bool(self.config.ytdl_debug), bool(self.config.ytdl_debug),
True True
),
timeout=self.config.extract_info_timeout
) )
entry = await asyncio.wait_for(data, timeout=self.config.extract_info_timeout)
if not entry: if not entry:
return {'status': 'error', 'msg': 'Unable to extract info check logs.'} return {'status': 'error', 'msg': 'Unable to extract info check logs.'}