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(
None, fut=asyncio.get_running_loop().run_in_executor(
ExtractInfo, None,
mergeConfig(self.config.ytdl_options, ytdlp_config), ExtractInfo,
url, mergeConfig(self.config.ytdl_options, ytdlp_config),
bool(self.config.ytdl_debug) url,
) bool(self.config.ytdl_debug)
),
entry = await asyncio.wait_for(data, timeout=self.config.extract_info_timeout) 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,16 +236,18 @@ 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(
None,
ExtractInfo,
mergeConfig(self.config.ytdl_options, ytdlp_config),
url,
bool(self.config.ytdl_debug),
True
)
entry = await asyncio.wait_for(data, timeout=self.config.extract_info_timeout) entry = await asyncio.wait_for(
fut=asyncio.get_running_loop().run_in_executor(
None,
ExtractInfo,
mergeConfig(self.config.ytdl_options, ytdlp_config),
url,
bool(self.config.ytdl_debug),
True
),
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.'}